Diff between 2 Statements

Question Status

Verified
jsshivalik asked a question on 16 May 2018 6:49 AM

Hi

   What is the difference between first 2 statements


CLine."Sale Amount" := Amount;
CLine.VALIDATE("Sale Amount", Amount);

CDNLine.MODIFY;

Thanks

Reply
Verified Answer
Chris D'silva responded on 16 May 2018 7:06 AM

The first line CLine."Sale Amount" := Amount; will only assign Amount to CLine."Sale Amount"

CLine.VALIDATE("Sale Amount", Amount); will not only assign but also run the code written under  CLine."Sale Amount".

Its recommended to use CLine.VALIDATE("Sale Amount", Amount);

Reply
Verified Answer
Suresh Kulla responded on 16 May 2018 7:42 AM

Check this link

docs.microsoft.com/.../validate-function--record-

Reply
Verified Answer
RockWith NAV responded on 16 May 2018 9:49 AM

Validate calls the OnValidate Trigger of the Field of that Table.

Reply
Verified Answer
Chris D'silva responded on 16 May 2018 7:06 AM

The first line CLine."Sale Amount" := Amount; will only assign Amount to CLine."Sale Amount"

CLine.VALIDATE("Sale Amount", Amount); will not only assign but also run the code written under  CLine."Sale Amount".

Its recommended to use CLine.VALIDATE("Sale Amount", Amount);

Reply
Verified Answer
Suresh Kulla responded on 16 May 2018 7:42 AM

Check this link

docs.microsoft.com/.../validate-function--record-

Reply
Verified Answer
RockWith NAV responded on 16 May 2018 9:49 AM

Validate calls the OnValidate Trigger of the Field of that Table.

Reply