Your code added to CAmount - OnValidate is not going to work. The OnValidate trigger can be activated (called) either from code, by calling VALIDATE(CAmount), or when CAmount is exposed on the Page and is made editable, so the user can change value in it. CAmount - OnValidate trigger is never called be the system when data in other tables changes in a way which would change the content in CAmount
Take the code out of CValidate trigger, and move it to Amount - OnValidate. also add CALCFIELDS(CAmount) call before using it in your calculation:
Your balance will only be updated if you validate/change Amount field. Changes in CAmount will not be automatically reflected in your "Balance Amount".
Your code added to CAmount - OnValidate is not going to work. The OnValidate trigger can be activated (called) either from code, by calling VALIDATE(CAmount), or when CAmount is exposed on the Page and is made editable, so the user can change value in it. CAmount - OnValidate trigger is never called be the system when data in other tables changes in a way which would change the content in CAmount
Take the code out of CValidate trigger, and move it to Amount - OnValidate. also add CALCFIELDS(CAmount) call before using it in your calculation:
Your balance will only be updated if you validate/change Amount field. Changes in CAmount will not be automatically reflected in your "Balance Amount".
Answers
Take the code out of CValidate trigger, and move it to Amount - OnValidate. also add CALCFIELDS(CAmount) call before using it in your calculation:
Your balance will only be updated if you validate/change Amount field. Changes in CAmount will not be automatically reflected in your "Balance Amount".
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03