web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Sunil G Kurup Profile Picture
    130 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

    Not yet solved, because if we have running Sales Agreement we need to omit the validations. We are working on the customization, once its finished will update the status

  • RaviRaj Profile Picture
    530 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

    Hi Sunil,

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

  • Sunil G Kurup Profile Picture
    130 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

    Informed our programmer to do the validation.

  • guk1964 Profile Picture
    10,886 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

    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.

  • RaviRaj Profile Picture
    530 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

    Its working now ..??

  • Sunil G Kurup Profile Picture
    130 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

    Thanks willl try

  • RaviRaj Profile Picture
    530 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

    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");

    }

  • Sunil G Kurup Profile Picture
    130 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

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

  • RaviRaj Profile Picture
    530 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

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

  • Sunil G Kurup Profile Picture
    130 on at
    RE: Restrict the sales order Packing slip & Invoice post if the item price below cost ( zero margin)

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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#1
Guy Terry Profile Picture

Guy Terry 2 Moderator

#1
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans