web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Regarding - To calculate the two fields and the answer should automatically want to generated.

(0) ShareShare
ReportReport
Posted on by 190

Hi all, 

I'm unaware of the part calculation between two fields .

my requirement is 

field 1 * field 2 = field 3 should calculate automatically.

And I need the procedure of the code using AL code.

Regards,

Thanks in Advance.

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    sorry I am not getting your problem.

    Thanks.

  • Suggested answer
    Vaishnavi J Profile Picture
    3,096 on at

    Hi,

    You can add the below logic  on

    trigger OnValidate of field 2

    begin

    Rec.Field3:=Rec.Field 1 * Rec.Field 2;

    end;

    But how are you going to fill the value in Field  1 and field 2  manually or you want to pull data from somewhere?

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

  • karthikeyani c Profile Picture
    190 on at

    Manually ,

    I want to enter the details manually in both the fields and that should automatically wants to get calculated and generated.

    Field 1 + Field 2 = Field 3 (the field3 should get automatically as I manually enter the two fields ).

    And need the Procedure of code in AL.

  • Suggested answer
    Vaishnavi J Profile Picture
    3,096 on at

    Hi,

    You can create a procedure as well.

    But easiest way is to write the calculation logic in on the Triger that is OnValidate trigger of field 2

    trigger OnValidate of field 2

    begin

    Rec.Field3:=Rec.Field 1 + Rec.Field 2; // Addition of both the field value will be set in field 3 when you assign some value in the field value 2.

    end;

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 590 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 445 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 395 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans