l_recgjLine.INIT; l_recgjLine."Posting Date":= p_recSalesInvHeader."Posting Date"; l_recgjLine."Document Date":=p_recSalesInvHeader."Document Date"; l_recgjLine.VALIDATE("Line No.",10000); l_recgjLine.VALIDATE("Currency Code",p_recSalesInvHeader."Currency Code"); l_recgjLine."Source Currency Code":=p_recSalesInvHeader."Currency Code"; l_recgjLine."Source Currency Amount":=p_decTotalAmount; l_recgjLine.VALIDATE(Amount,p_decTotalAmount); l_recgjLine."Additional-Currency Posting":=l_recgjLine."Additional-Currency Posting"::"Amount Only"; IF (p_recSalesInvHeader."Currency Code"<>'') THEN BEGIN l_recgjLine."Currency Factor":=p_recSalesInvHeader."Currency Factor"; l_recgjLine."FA Add.-Currency Factor" :=p_recSalesInvHeader."Currency Factor"; l_recgjLine.VALIDATE(Amount,p_decTotalAmount/p_recSalesInvHeader."Currency Factor"); END ELSE l_recgjLine."Currency Factor":=1; l_recgjLine.VALIDATE("Document No.",p_recSalesInvHeader."No."); l_recgjLine.VALIDATE("Account No.",p_recSalesInvLine."Deferred Rev. Account"); l_recgjLine.VALIDATE("Document Type",l_recgjLine."Document Type"::Invoice); l_recgjLine."Gen. Prod. Posting Group":=p_recSalesInvLine."Gen. Prod. Posting Group"; l_recgjLine."Gen. Bus. Posting Group" := p_recSalesInvLine."Gen. Bus. Posting Group"; l_recgjLine."Gen. Posting Type" := l_recgjLine."Gen. Posting Type"::Sale; l_recgjLine.Description:= p_recSalesInvHeader."Posting Description"; l_recgjLine."Shortcut Dimension 1 Code":=p_recSalesInvLine."Shortcut Dimension 1 Code"; l_recgjLine."External Document No." := FORMAT(p_recSalesInvLine."Line No."); l_recTempJnlLineDim.DELETEALL; l_recTempDocDim.RESET; l_recTempDocDim.SETRANGE("Table ID",DATABASE::"Sales Header"); l_cduDimMgt.CopyDocDimToJnlLineDim(l_recTempDocDim,l_recTempJnlLineDim); l_cduGenJnlPostLine.RunWithCheck(l_recgjLine,l_recTempJnlLineDim);
Comments
Tino Ruijs
Microsoft Dynamics NAV specialist
Yes it's set to "Sale", but if I put '' Navision gives me an error