Happy New Year!
I have faced some problem when sending a Sales Order to Authorization.
The error message is: "No Setup exists for this Amount.".
Noticed some wrong coding in the codeunit ID 13700 Multilevel Authorization.
Details given below.
IF "Transaction Type" = "Transaction Type"::Sale THEN BEGIN
SalesSetup.GET;
IF SalesSetup."Authorization Required" THEN BEGIN
WFAmount := 0;
IsValid := FALSE;
SalesHeader.GET("Document Type","Document No.");
WFPurchLine.SETRANGE("Document Type","Document Type");
WFPurchLine.SETRANGE("Document No.","Document No.");
IF WFPurchLine.FIND('-') THEN
REPEAT
WFAmount := WFAmount + WFPurchLine."Amount To Vendor" + WFPurchLine."TDS Amount";
UNTIL WFPurchLine.NEXT = 0;
//Comment
//WFPurchLine should be "Sales Line" Table
//WFPurchLine."Amount To Vendor" should be Amount
//To Customer of the Sales Line Table
//WFPurchLine."TDS Amount" should be "TDS/TCS Amount" of the
//Sales Line Table
//Customized code
IF "Transaction Type" = "Transaction Type"::Sale THEN BEGIN
SalesSetup.GET;
IF SalesSetup."Authorization Required" THEN BEGIN
WFAmount := 0;
IsValid := FALSE;
SalesHeader.GET("Document Type","Document No.");
WFSalesLine.SETRANGE("Document Type","Document Type");
WFSalesLine.SETRANGE("Document No.","Document No.");
IF WFSalesLine.FIND('-') THEN
REPEAT
WFAmount := WFAmount + WFSalesLine."Amount To Customer" + WFSalesLine."TDS/TCS Amount";
UNTIL WFPurchLine.NEXT = 0;
//Comment WFSalesLine (Record Variable) referes to the table Sales Line
0
Comments
http://ssdynamics.co.in