Hi Folks,
Check out this link for the new very useful update on extensibility on D365FO.
https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/extensibility/extensibility-changes-811
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
Search This Blog
October 22, 2018
October 20, 2018
[SOLVED] Error while get latest on source control Dynamics365FO
Hi Folks,
One of our customers have few ISV and while do a get latest on source control, the system throws an error of permissions and post that nothing works.
The quick fix I found is
1. Stop all below services on dev box,
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
One of our customers have few ISV and while do a get latest on source control, the system throws an error of permissions and post that nothing works.
The quick fix I found is
1. Stop all below services on dev box,
IIS Admin
MS Batch server
MS DIXF server
Management reporter
World wide web
2. Do a get latest
3. Build the entire application with DB synch.
4. Turn on all these services back.
That's it. :)
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
October 15, 2018
Table Event handler methods in Dynamics 365 FO
Hi Guys,
In my last post Form Event hander methods in Dynamics 365 FO, we discussed different event handlers which available on Form. Let’s continue this discussion with Table event handler method today.
Let’s see the different type of event handler in today’s post.
You need to add a new class to write the event handler methods. I would recommend adding one class to one table. To make it easy for another developer postfix the name by EH or eventHander or Hander so your teammate can identify if they need to add more business logic than create a new class from scratch.
1. Table onValidateField event handler
2. Table OnValidated event hander (same logic you can try for many other event hander)
[DataEventHandler(tableStr(InventLocation), DataEventType::ValidatedField)]
public static void InventLocation_onValidatedField(Common sender, DataEventArgs e)
{
InventLocation inventLocation = sender as InventLocation;
ValidateFieldEventArgs fieldArgs = e;
boolean ret;
InventLocation inventLocationLoc;
switch(fieldArgs.parmFieldId())
{
case fieldNum(InventLocation, field1):
if(inventLocation.MyWorkerAssociate != '')
{
<Your code/ business ogic/validation>
<ret = true or false>
fieldArgs.parmValidateResult(ret);
}
}
}
Let me know if it helps you or you got some more example.
Cheers,
Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
In my last post Form Event hander methods in Dynamics 365 FO, we discussed different event handlers which available on Form. Let’s continue this discussion with Table event handler method today.
Let’s see the different type of event handler in today’s post.
You need to add a new class to write the event handler methods. I would recommend adding one class to one table. To make it easy for another developer postfix the name by EH or eventHander or Hander so your teammate can identify if they need to add more business logic than create a new class from scratch.
1. Table onValidateField event handler
2. Table OnValidated event hander (same logic you can try for many other event hander)
[DataEventHandler(tableStr(InventLocation), DataEventType::ValidatedField)]
public static void InventLocation_onValidatedField(Common sender, DataEventArgs e)
{
InventLocation inventLocation = sender as InventLocation;
ValidateFieldEventArgs fieldArgs = e;
boolean ret;
InventLocation inventLocationLoc;
switch(fieldArgs.parmFieldId())
{
case fieldNum(InventLocation, field1):
if(inventLocation.MyWorkerAssociate != '')
{
<Your code/ business ogic/validation>
<ret = true or false>
fieldArgs.parmValidateResult(ret);
}
}
}
Let me know if it helps you or you got some more example.
Cheers,
Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
September 23, 2018
RecordInserList class for optimized insert operation
Hi Folks,
RecordInsertList class is the really useful and fastest way to
insert records in AX table(s). This method is useful you don't want to run any
validation while insertion for an example; insert in a temp table or
SSRS reports.
Below is the simplest example of set based
RecordInserList class,
void copyVendor()
{
VendTable sourceVend;
MyTmpTable targetVend;
//RecordInserList calss decarion
RecordInsertList VendList;
//Object initialization
VendList = new RecordInsertList(tableNum(Vendtable));
while select sourceVend
where sourceVend.vendgroupId == ‘Local’
{
targetVend.data(sourceVend);
targetVend.vendorAccount = sourceVend.vendorAccount;
.
.
.
.
VendList.add(targetVend);
}
VendList.insertDatabase(); //mandatory call
}
Another example from MSDN
public void tutorialRecordInsertList()
{
MyTable myTable;
RecordInsertList
insertList = new RecordInsertList(
myTable.TableId,
True);
int i;
for ( i = 1; i
<= 100; i++ )
{
myTable.value = i;
insertList.add(myTable);
}
insertList.insertDatabase();
}
RecordInserList class will capture all record in temp and hit The DataBase only once when we call insertDatabase(). add() insert certain
blocks followed by insertDatabase to complete the insert operation.
This is how we can reduce the SQL call and optimize the
performance as well.
Cheers,
Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
Subscribe to:
Posts (Atom)