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...
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?

I have the same question (0)
  • Gerardo Rentería García Profile Picture
    27,087 Most Valuable Professional 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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,119 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,522 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,177 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans