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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Modify Price/Profit Calculation field on Item Card

(2) ShareShare
ReportReport
Posted on by 8

Hello!

 

I am currently working with a customer that wants a little change on their Item Card page. Below Costs & Posting, there are these two fields: Standard Cost and Unit Cost. Unit Cost is a field I can edit, while Standard Cost is not editable, which is fine.

 

Below Price & Sales, there is another field called Price/Profit Calculation, where I can choose between a couple of options in a dropdown menu. All of these fields are default Business Central fields. Because of the way my customer uses Business Central, they would like to use the Standard Cost field instead of the Unit Cost field in that Calculation when choosing /Profit=Price-Cost/.

 

I have found the field in the packages, and I can see the calculation. Obviously it is read-only, so I am not able to edit this. Here is the code:

 

 

field(19; /Price/Profit Calculation/; Enum /Item Price Profit Calculation/)

       {

           Caption = 'Price/Profit Calculation';

           trigger OnValidate()

           begin

               case /Price/Profit Calculation/ of

                   /Price/Profit Calculation/::/Profit=Price-Cost/:

                       if /Unit Price/ <> 0 then

                           if /Unit Cost/ = 0 then

                               /Profit %/ := 0

                           else

                               /Profit %/ :=

                                 Round(

                                   100 * (1 - /Unit Cost/ /

                                          (/Unit Price/ / (1 + CalcVAT()))), 0.00001)

                       else

                           /Profit %/ := 0;

                   /Price/Profit Calculation/::/Price=Cost+Profit/:

                       if /Profit %/ < 100 then begin

                           GetGLSetup();

                           /Unit Price/ :=

                             Round(

                               (/Unit Cost/ / (1 - /Profit %/ / 100)) *

                               (1 + CalcVAT()),

                               GLSetup./Unit-Amount Rounding Precision/);

                       end;

               end;

           end;

       }

 

 

Is there any way I can modify this code, and make the calculation the way my customer wants it done, using AL?

  • Gerardo Rentería García Profile Picture
    27,623 Super User 2026 Season 2 on at
    Hi
    You could rely on this event to make some changes.
    BR
    GR

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 728 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 545 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 328 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans