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 :
Microsoft Dynamics AX (Archived)

Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

(0) ShareShare
ReportReport
Posted on by 130

Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin).

Enabled Margin alert in AR parameters, and we can see margin alert in Sales Order line, but if provide the lesser value , system will accept.

As per the organizations rules, below cost invoice ( zero margin) should be restricted. So How can we enable the validation message to inform users before posting like storage/tracking dimension validation

*This post is locked for comments

I have the same question (0)
  • RaviRaj Profile Picture
    530 on at

    Hi Sunil,

       Its possible,Sales order workflow is the only solution for this requirement,already we faced this same requirement.

  • CU07101257-0 Profile Picture
    130 on at

    Thank your for your reply. Could you please explain, how can we configure

  • RaviRaj Profile Picture
    530 on at

    You need only validation message or get approve from manager tell me..

  • CU07101257-0 Profile Picture
    130 on at

    Cost Validation message if entered unit price under cost. After manager approval need to post

  • RaviRaj Profile Picture
    530 on at

    Hi Sunil,

    Use the below code to salesline  table -->validatefield method :-    

    CostPrice    costPrice;

    InventQty    costInventQty;

    AmountCur    costInventValue;

    InventTable  inventtable;

    [costInventQty, costInventValue] = InventTrans::calcCostValue(InventTransOrigin::findByInventTransId(this.InventTransId).RecId);

    if (costInventQty)

    {

      costPrice = costInventValue/costInventQty;

    }

    else

    {

      costPrice = inventTable.costPcsPrice(updatesalesline.InventDimId);

    }

    if(costPrice < this.salesprice)

    {

     error("unit price less than cost price");

    }

  • CU07101257-0 Profile Picture
    130 on at

    Thanks willl try

  • RaviRaj Profile Picture
    530 on at

    Its working now ..??

  • guk1964 Profile Picture
    10,888 on at

    Its a little more tricky  in that the default functionality sets the margin for the whole sales order.  Which is fine when you are only concerned with 0 margin threshold. However if you have  a different minimum margin by item then customisation is needed. The order can then be set to hold or you can customise further for the system to do this and for an approval processes to be followed.

    We typically have to do this for most customers.

  • CU07101257-0 Profile Picture
    130 on at

    Informed our programmer to do the validation.

  • RaviRaj Profile Picture
    530 on at

    Hi Sunil,

    Issue resolved means verified the answer,its useful to some other users.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dserp Profile Picture

dserp 4

#2
dekion Profile Picture

dekion 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans