Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

RE: validation on sales invoice creation

$
0
0

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


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>