WITH GenJnlLine DO BEGIN IF "Delayed Unrealized VAT" AND "Realize VAT" THEN IF ("Applies-to Doc. No." <> '') OR ("Applies-to ID" <> '') THEN PostDelayedUnrealizedVAT; // Post G/L entry InitGLEntry( "Account No.","Amount (LCY)", "Source Currency Amount",TRUE,"System-Created Entry"); IF NOT "System-Created Entry" THEN IF "Posting Date" = NORMALDATE("Posting Date") THEN GLAcc.TESTFIELD("Direct Posting",TRUE); GLEntry."Gen. Posting Type" := "Gen. Posting Type"; GLEntry."Bal. Account Type" := "Bal. Account Type"; GLEntry."Bal. Account No." := "Bal. Account No."; GLEntry."No. Series" := "Posting No. Series"; GLEntry."Option Field" := "Option Field"; // Newly assigned option field value IF "Additional-Currency Posting" = "Additional-Currency Posting"::"Additional-Currency Amount Only" THEN BEGIN GLEntry."Additional-Currency Amount" := Amount; GLEntry.Amount := 0; END; InitVat; InsertGLEntry(TRUE); IF EntryType = GLEntry."Entry Type"::Definitive THEN BEGIN PostJob; PostVAT; END; END;
WITH GenJnlLine DO BEGIN IF Cust."No." <> "Account No." THEN Cust.GET("Account No."); Cust.CheckBlockedCustOnJnls(Cust,"Document Type",TRUE); IF "Posting Group" = '' THEN BEGIN Cust.TESTFIELD("Customer Posting Group"); "Posting Group" := Cust."Customer Posting Group"; END; CustPostingGr.GET("Posting Group"); CustPostingGr.TESTFIELD("Receivables Account"); DtldCustLedgEntry.LOCKTABLE; CustLedgEntry.LOCKTABLE; CustLedgEntry.INIT; CustLedgEntry."Customer No." := "Account No."; CustLedgEntry."Posting Date" := "Posting Date"; . . . CustLedgEntry.Prepayment := Prepayment; CustLedgEntry."Option Field" := "Option Field"; // Newly assigned option field value . . .This is working fine.