Skip to main content

Posts

Showing posts from February, 2019

Cache enabled display field not refreshing issue in Operations

Cache enabled display field not refreshing issue in Operations Scenario:  I have created a display method which is a calculated field called "grossweight". This simply adds two fields net weight+tara weight. Added this display method to form grid. Whenever i change value in grossweight or gross weight, display field should be updated accordingly.  This works fine when you have not enabled cache on the display field. Cache is enabled in order to improve the performance of the form. Issue here is when we enable cache our display method stopped refreshing with the new values. In my case when changing netweight value grossweight display field was not updated. This is a standard behaviour but from a user perspective this is not acceptable.  Solution: On modified of fields gross weight and net weight call cacheCalculateMethod. This will recalculate the display field value hence requirement is achieved. Also performance is not affected as we call the met...

D365 ModifiedField method in class for Table Extension

D365 ModifiedField method in class for Table Extension Ex: Creating class for HcmWorker table extension (HcmWorker_Extension) [ExtensionOf(tableStr(HcmWorker)] // It shows that it is extension of HcmWorker table final public static class HcmWorker_Extension // extension class must end with “_Extension” {               [DataEventHandler(tableStr(HcmWorker), DataEventType::ModifiedField)]               Public static void HcmWorker_onModifiedField(Common sender, DataEventArgs e)               {                              ModifiedFieldEventArgs       event = e as DataEventArgs;      ...

Table event handler example for ModifiedField method in Microsoft dynamics 365 for Operations

Table event handler example for ModifiedField method in Microsoft dynamics 365 for Operations [DataEventHandler(tableStr(PurchAgreementHeader), DataEventType::ModifiedField)]     public static void PurchAgreementHeader_onModifiedField(Common sender, DataEventArgs e)     {         ModifyFieldEventArgs    event = e as DataEventArgs;         PurchAgreementHeader    purchAgreementHeader = sender as PurchAgreementHeader;         FieldId                 fieldId = event.parmFieldId();         date                    emptyDate;         switch(fieldId)         {             case fieldNum(PurchAgreementHeader, BankGuarantee):                 if(purchAgreementHea...