Dear Chris,
I have applied the code in my live database but all mandatory fields are working fine except one of my customised fields. My complete code are below.
SendApprovalRequest - OnAction()
TESTFIELD("MKU Order Type");
TESTFIELD("Shortcut Dimension 3 Code");
TESTFIELD("Shortcut Dimension 1 Code");
TESTFIELD("Payment Terms Code");
TESTFIELD("Invoice Type");
SalesLine.SETRANGE("Document Type", SalesLine."Document Type"::Order);
SalesLine.SETRANGE(SalesLine."Document No.","No.");
IF SalesLine.FINDSET THEN BEGIN
REPEAT
IF SalesLine."HSN/SAC Code" ='' THEN
ERROR('"HSN/SAC Code" cannot be blank in Sales Line');
IF ("Payment Terms Code"='PT-040') OR (SalesLine."Unit Price (Custom)" = 0) THEN
ERROR('"Unit Price (Custom)" cannot be blank in Sales Line');
IF SalesLine."Label Ins. Goods" = '' THEN
ERROR('"Label Ins. Goods" cannot be blank in Sales Line');
IF SalesLine."Label Ins. Packing" = '' THEN
ERROR('"Label Ins. Packing" cannot be blank in Sales Line');
UNTIL SalesLine.NEXT=0;
IF ApprovalsMgmt.CheckSalesApprovalsWorkflowEnabled(Rec) THEN
ApprovalsMgmt.OnSendSalesDocForApproval(Rec);
END;
I have insert the data in "Unit Price (Custom)" field but still getting the error while sending for approval, can not blank. What i need to do to resolve it. Please help me. I have attached the screenshot below.
