Hi,
I need to validate unit price is zero on invoice button click in the sales order.
Kindly assist.
Thanks in advance.
Regards,
Selva
*This post is locked for comments
Thanks a lot.. Chaitanya Golla
And what about when you are posting packing slip, Are you posting that with zero price?
There are quite number of ways to acheive this. One way is to introduce the below validation code in createParmLine(After line# 163) method of class SalesFormLetterParmData.
this.insertParmLine(localSalesParmLine);
lineCreated = true;
// Use this code
if ((this.parmDocumentStatus() == DocumentStatus::Invoice) && (localSalesParmLine.salesPrice() == 0))
{
warning(strFmt("Line price is zero for item: %1", localSalesParmLine.ItemId));
}
With this approach a warning appears for all the selected lines on opening of Posting invoice form and if none of the lines gets selected for invoice then no warning appears.
Hope this helps you.
Thanks,
Chaitanya Golla
Hi selva,
Unit price refers to the cost or the sales price in your case?
Best regards,
Ludwig
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 2 Most Valuable Professional
Guy Terry 2 Moderator
Community Member 2