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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Use the item unit cost on a sales order

(2) ShareShare
ReportReport
Posted on by 526
Hello experts, 
 
Is there a way to use the item unit cost + 15% to be calculated on a Sales Order for a particular customer?
I have the same question (0)
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,150 Super User 2025 Season 2 on at

    Yes, this is possible, but you’ll need a small customization.

     

    If you're a developer, I can share a code snippet to help you implement this logic in AL. Otherwise, I recommend reaching out to a Microsoft partner or a developer who can convert your requirement into AL code. It’s a simple customization and can be done in just a few lines.

     

    Mark this as the verified answer if it helps.

  • LF-16052033-0 Profile Picture
    526 on at
    Please share your suggested code snippet.
  • Suggested answer
    RockwithNav Profile Picture
    8,637 Super User 2025 Season 2 on at
    Unfortunately not on standard but a little quick customization will work -
     
  • Suggested answer
    Ramesh Kumar Profile Picture
    7,529 Super User 2025 Season 2 on at
    Some ISVs like Insight Works’ Pricing Matrix or Lanham Pricing offer cost-plus pricing logic out-of-the-box without needing AL customization.
     
    Thanks
    Ramesh
     
    If this was helpful, please check the "Does this answer your question?" box and mark it as verified.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,838 Super User 2025 Season 2 on at
    Yes, you can achieve this by customizing the pricing logic.
      if Rec.Type = Rec.Type::Item then begin
            // Check for your specific customer
            if Rec."Sell-to Customer No." = 'YOURCUSTOMERNO' then begin
                if Item.Get(Rec."No.") then begin
                    Rec."Unit Price" := Round(Item."Unit Cost" * 1.15, 0.01);
                end;
            end;
        end;
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,150 Super User 2025 Season 2 on at
    codeunit 50100 "Custom Sales Price Handler"
    {
        [EventSubscriber(ObjectType::Table, Database::"Sales Line", 'OnAfterValidateEvent', 'No.', true, true)]
        local procedure SetCustomPriceForCustomer(var Rec: Record "Sales Line"; xRec: Record "Sales Line"; CurrFieldNo: Integer)
        var
            Item: Record Item;
        begin
            // Check if it's a Sales Order and for specific customer
            if Rec."Document Type" = Rec."Document Type"::Order then begin
                if Rec."Type" = Rec."Type"::Item then begin
                    if Rec."Sell-to Customer No." = 'CUST001' then begin
                        if Item.Get(Rec."No.") then begin
                            Rec."Unit Price" := Round(Item."Unit Cost" * 1.15, 0.01);
                        end;
                    end;
                end;
            end;
        end;
    }
     
     
     
    How it works:
     
    Triggers when the item is selected on a Sales Order Line.
     
    Checks if the customer is CUST001.
     
    Pulls the Item Unit Cost and calculates Unit Cost + 15%.
     
    Sets that as the Unit Price.
     
     
    You can extend this logic for more customers or make it data-driven via a setup table.
     
    Mark this as the verified answer if it helps.
     
  • Verified answer
    Sagar Dangar, MCP Profile Picture
    799 Super User 2025 Season 2 on at
    Hi,
     
    You can define on particular items and it will calculate unit price for all customer.
    Note: To make it for particular customers only, you need to add small customization through developer

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans