Posts

Showing posts from August, 2020

63) Add a Menu Item to a SysOperation dialog - D365

Image
  A short one! Some time ago I explained how to   add a multi selection lookup to a SysOperation dialog   and in this post I’ll explain how to add a Menu Item as a Function button to the SysOperation dialog. Before the  SysOperation Framework  was introduced in AX2012, we used the  RunBase Framework , and maybe doing these things looked easier/quickier with RunBase because all the logic was in a single class. But in the end what we need to do is practically the same but we have to do it in the UIBuilder class. Let me show you and explain all the code. I’ll only show the DataContract and UIBuilder classes as they’re the only important ones in this case. DataContract class 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 [ DataContract ,      SysOperationContractProcessing ( classStr ( AASMenuItemDemoUIBuilder ) ) , SysOperationGroup ( 'VendGrp' , 'Vendor' , '1' ) ] class AASMenuItemDemoDataContract {      V...

62) Skip/Bypass validation in DataEntity Import – D365FO

Image
  I had a scenario where I need to create the State/County dynamically when importing Customer data. For instance, if the given County/State doesnot exist in the input data, the system should bypass the validation and create it. This will be applied if the State/County is disabled in Address Parameters. I tried the import from POSTMAN with the standard CustCustomerV3 entity and ended up with the following error. So, how do we incorporate this validation. Using  Persist method 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public void persistEntity(DataEntityRuntimeContext _entityCtx) {         if(LogisticsAddressParameters::find().ValidateState == NoYes::No)      {                         this.skipDataSourceValidateField(fieldNum(LogisticsPostalAddressBaseEntity,        State), true);   ...