Calling Codeunit 1012 Job Jnl.-Post Line when posting a purchase invoice

Hello all,

When I post a purchase invoice with a job number, the codeunit ‘Job Jnl.-Post Line’ (1012) is being called. But I cant find the actual code that calls the codeunit. I searched through codeunit 12 and 90 without any luck.

Any help greatly appreciated!


It seems to me that COD12 is calling COD1001 (i.e. the function PostGenJnlLine) which in it’s turn is calling COD1012 …

I´m not sure about that, because in the PostGenJnlLine function (CU 1001) this code is executed:

IF GenJnlLine.“System-Created Entry” THEN

But the InsertPurchLine in CU 1001 is called which calls CU 1012. But from where is InsertPurchLine in CU 1001 called??

Petan, I am not sure what you are searching for. You initially wrote “I cant find the actual code that calls the codeunit.” and I thought I had pointed out where it is called (i.e. where the posting of job jnl lines is initiated). Apparently you want to know something different (or more) than that. Could you elaborate on this a bit more.

BTW: have you ocnsidered to setup and use the NAV Developer’s Toolkit and analyze (through Where Used) where COD1012 is being called from?

I think I found it. The CU1001 is beeing called from CU90 when posting a sales invoice:


So CU90 → CU1001 → CU1012

You know, I just had setup the Developer’s Toolkit (that took some time) and with 20 seconds I showed the same.

1106.NDT Where Used COD1001&1012.JPG

Luc, you are right. I must admit it, that I spend close to an hour. Thanks for the tip.