Get statement

I have a custom report i am adding more fields to… in I already have Item/Item ledger entries tables returning records… I am needing to add the jobs table… in the report under

Item Ledger entry - OnAfterGetRecord() i am using JobRecord.Get(“No.”);

I amrunning into a problem where some of the Item Ledger entries do not have a Job number association. So when i run the report i have the error Job No. ‘’ does not exist. I presume what i need to do after the GET is say

IF JobRecord.Get(“No.”) <> ‘’ then JobRecord.Get(“No.”)

Else JobRecord.Get(’’) ;

but this gives me a syntax error. Is there anyone that has suggestions of examples of this type of syntax?

Thanks

Hi, try this instead;

IF JobRecord.GET('No.") THEN BEGIN

// code here if record exists

END ELSE BEGIN

// code here if doesn’t exist

END;

Refer to the Help file in regard to GET function. It’ll provide you with good coding syntax

Ah, yes the help was a lot better than trying to goolge it :slight_smile: thanks

No problem at all. The C/SIDE Reference Guide is a pretty handy tool. Good luck!