Posts

Active method Chain of command in form datasource

 [ExtensionOf(formdatasourcestr(RetailPositionPosPermission,RetailPositionPosPermission))] final class UPOS_RetailPositionPosPermissionForm_Extension {     public int active()     {         next active();         this.updateKisokPrivileges();         this.refresh();         this.refreshEx();         this.reread();         int ret;         return ret;     }     ///     /// updateKisokPrivileges method     ///     protected void updateKisokPrivileges()     {         this.UPOSKioskPrivileges();     }     ///          /// UPOSKioskPrivileges update in RetailPositionPosPermission     ///          protected void UPOSKioskPrivileges()     {       ...

Lookup Event handler in d365

 [FormControlEventHandler(formControlStr(EcoResProductDetailsExtended, CST_MixNMatch_CST_MixMatchRevItemId), FormControlEventType::Lookup)]     public static void CST_MixNMatch_CST_MixMatchRevItemId_OnLookup(FormControl sender, FormControlEventArgs e)     {         SysTableLookup      sysTableLookup  = SysTableLookup::newParameters(tableNum(InventTable), sender);         InventTable inventTable;         Query query = new Query();         QueryBuildDataSource qbds;         QueryBuildRange queryBuildRange;         FormDataSource  formDataSource = sender.dataSourceObject();         InventParameters inventParameters = formDataSource.cursor();         qbds = query.addDataSource(tableNum(InventTable));         qbds.addRange(fieldNum(InventTable, CST_MixNMatch)).value...

COC for data entity methods

  EcoResReleasedProductV2Entity entity Methods : insert, update,validatewrite [ExtensionOf(tableStr(EcoResReleasedProductV2Entity))] final class CST_EcoResReleasedProductV2_Extension {     public void update()     {         InventTable         inventTable;         CST_ItemSubMaster   cST_ItemSubMaster;            next update();         if(this.CST_ParentItemId != this.ItemNumber)         {             cST_ItemSubMaster.ParentItem = this.CST_ParentItemId;             cST_ItemSubMaster.ChildItem  = this.ItemNumber;             cST_ItemSubMaster.insert();         }     }     public void insert()     {         InventTable         inventT...

Table level Event Handlers

  ValidatedField Event Handler: [DataEventHandler(tableStr(InventTable), DataEventType::ValidatedField)]     public static void InventLocation_onValidatedField(Common sender, DataEventArgs e)     {         CST_ItemSubMaster cST_ItemSubMaster;         InventTable inventTable = sender as InventTable;         ValidateFieldEventArgs fieldArgs = e;         boolean ret;         switch(fieldArgs.parmFieldId())         {             case fieldNum(InventTable,CST_ParentItemId):                 select firstonly cST_ItemSubMaster where cST_ItemSubMaster.ChildItem == inventTable.CST_ParentItemId;                 if(cST_ItemSubMaster.ChildItem)                 {              ...

Post Load Method in Data Entity in D365

  // post load method in data entity public class BA_UnifonicOrderSendDataEntity extends common {     /// <summary>     ///     /// </summary>     public void postLoad()     {         SalesTable salesTable;         ARF_CapacityMasterTable masterTable;         SalesLine salesLine;         SalesQty totalOrderedQty;         super();                  select SalesId, ARF_DestinationCode, ShippingDateConfirmed from salesTable where salesTable.SalesId == this.SalesId;         select sum(SalesQty) from salesLine where salesLine.SalesId == salesTable.SalesId;         totalOrderedQty = salesLine.SalesQty;         select firstonly RecId, ARF_Date from masterTable             where      ...

chain of commands with different controls

Image
 [ExtensionOf(formControlStr(SalesTable,WhatsAppNotification))] final class BA_UnifonicOrderSendService_Extension {     public void clicked()     {         FormControl formButtonControl = any2Object(this) as FormControl;         FormDataSource formDatasource = formButtonControl.formRun().dataSource(tableStr(SalesTable));         SalesTable salesTable = formDatasource.cursor();         next clicked();         info(strFmt("%1",salesTable.SalesId));        // BA_SendNotificationToWhatsApp sendService = new BA_SendNotificationToWhatsApp();        // sendService.sendNotificationsToWhatsApp();     } } // second chain of command /// <summary> ///This class is used to update the delivery status in salestable /// </summary> [ExtensionOf(formControlStr(InventOnhandReserve,ReserveNow))] final class BA_onModifiedRe...

X++ code to Delete multiple selected records from a form

  This code will delete the selected records from the form. Note :- Override clicked method of button. And enable multi select property of the button and put the code  public void clicked()         {                        super();             Employee_ds.deleteMarked();           }