Please be informed, I am new to Navision. Please bear with me if I ask any stupid questions or if I wrote wrong code.
I am trying to generate report from “G/L Entry” table for total material cost and sub contract cost.
In G/L Entry table “Document No.” is the key field and “P-Order No.” is the FlowField.
GL_ENTRY_MatC_Revenue and GL_ENTRY_SubC_Revenue are the C/AL Globals “G/L Entry” Record variables
Material cost works fine (Please find below the code). But I am not able to generate sub contract cost. It keeps running, no stopping, without luck. Can anyone HELP me!!!
//***** Material cost calcuation - Begins ****** //
G/L Entry - OnAfterGetRecord()
GL_ENTRY_MatC_Revenue.SETRANGE(“Document No.”,“G/L Entry”.“P-Order No.”);
IF GL_ENTRY_MatC_Revenue.FIND(’-’) THEN REPEAT
mat_Total_cost += GL_ENTRY_MatC_Revenue.Amount;
jobno := GL_ENTRY_MatC_Revenue.“Document No.”
//***** Material cost calcuation - Ends ****** //
//***** Sub Contract cost calcuation - Begins ****** //
GL_ENTRY_SubC_Revenue.SETRANGE(“P-Order No.”,jobno); // since “P-Order No.” is the flowfield, I stuck with it.
IF GL_ENTRY_SubC_Revenue.FIND(’-’) THEN REPEAT
sub_Total_cost += GL_ENTRY_SubC_Revenue.Amount;
//***** Sub Contract cost calcuation - Ends ****** //