SBX - Search With Button

SBX - Forum Post Title

Diff between 2 Statements

Microsoft Dynamics NAV Forum

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

Question Status

Verified

Hi

   What is the difference between first 2 statements


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

CDNLine.MODIFY;

Thanks

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

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
Suresh Kulla responded on 16 May 2018 7:42 AM
Verified Answer
RockWith NAV responded on 16 May 2018 9:49 AM
My Badges
Verified Answer

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

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

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
Suresh Kulla responded on 16 May 2018 7:42 AM
Verified Answer
RockWith NAV responded on 16 May 2018 9:49 AM
My Badges
Verified Answer

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

Reply

SBX - Two Col Forum

SBX - Migrated JS