Hi,
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