Announcements
No record found.
Hi Experts,
How can i make Chain of Commands of the below code this is dynamics ax 2012 code:-
public void activate(boolean _active) { super(_active); if (purchParmUpdate.CustomsImportOrderType_IN != CustomsImportOrderType_IN::ImportOrder) { specQty.delete("@GLS5652"); } // Added --> start select purchTable where purchTable.PurchId == purchParmTable.PurchId; if(purchTable.DocumentState == VersioningDocumentState::Confirmed && purchTable.PurchStatus == PurchStatus::Backorder) { PurchParmTable_TransDate.allowEdit(false); //PurchParmTable_TransDate.allowEdit(true); } // Added by J9074 on 22-03-2019 --> end //Added by Pavan 01-10-2020 for T17862 - GRN that if it is import order then only BOE option should be allowed to selected for Invoicing the PO if(PurchParmTable.purchTable().purchTable_W().CustomsImportOrder_IN == NoYes::Yes)// && documentStatus == DocumentStatus::PackingSlip) { if(PurchParmUpdate.SpecQty == PurchUpdate::BillOfEntryQuantity_IN) { PurchParmUpdate_ds.object(fieldNum(PurchParmUpdate, Specqty)).allowEdit(false); } } //end } //Added by Pavan 01-10-2020 for T17862 - GRN that if it is import order then only BOE option should be allowed to selected for Invoicing the PO if(PurchParmTable.purchTable().purchTable_W().CustomsImportOrder_IN == NoYes::Yes)// && documentStatus == DocumentStatus::PackingSlip) { if(PurchParmUpdate.SpecQty == PurchUpdate::BillOfEntryQuantity_IN) { PurchParmUpdate_ds.object(fieldNum(PurchParmUpdate, Specqty)).allowEdit(false); } } //end
Best Regards,
Shabir Ahmad
Hi Shabir,
Seems this is form level activate method. You can write either COC for form level or use event handler "OnActivated" method.
Thanks,
Girish S.
Hi You can try below method, create form extension class. The code is just for reference on how it can be done and not compiled.
public void activate(boolean _active) { next activate(_active); FormDataSource PurchParmUpdate_ds = this.datasource(IdentifierStr(PurchParmUpdate)); PurchParmUpdate purchParmUpdate = PurchParmUpdate_ds.cursor(); if (purchParmUpdate.CustomsImportOrderType_IN != CustomsImportOrderType_IN::ImportOrder) { specQty.delete("@GLS5652"); } // Added --> start select purchTable where purchTable.PurchId == purchParmTable.PurchId; if(purchTable.DocumentState == VersioningDocumentState::Confirmed && purchTable.PurchStatus == PurchStatus::Backorder) { PurchParmTable_TransDate.allowEdit(false); //PurchParmTable_TransDate.allowEdit(true); } // Added by J9074 on 22-03-2019 --> end //Added by Pavan 01-10-2020 for T17862 - GRN that if it is import order then only BOE option should be allowed to selected for Invoicing the PO if(PurchParmTable.purchTable().purchTable_W().CustomsImportOrder_IN == NoYes::Yes)// && documentStatus == DocumentStatus::PackingSlip) { if(PurchParmUpdate.SpecQty == PurchUpdate::BillOfEntryQuantity_IN) { PurchParmUpdate_ds.object(fieldNum(PurchParmUpdate, Specqty)).allowEdit(false); } } //end } //Added by Pavan 01-10-2020 for T17862 - GRN that if it is import order then only BOE option should be allowed to selected for Invoicing the PO if(PurchParmTable.purchTable().purchTable_W().CustomsImportOrder_IN == NoYes::Yes)// && documentStatus == DocumentStatus::PackingSlip) { if(PurchParmUpdate.SpecQty == PurchUpdate::BillOfEntryQuantity_IN) { PurchParmUpdate_ds.object(fieldNum(PurchParmUpdate, Specqty)).allowEdit(false); } } //end
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 545 Super User 2026 Season 1
Giorgio Bonacorsi 408
Adis 267 Super User 2026 Season 1