In BEFORE Global Data it throws Field not found: RECORD - if I move it to Global Data it does compile but it doesn’t have any fields, at least Intellisense doesn’t show fields - if i use a GROUP instead of LIKE intellisense does show fields, but during compilation it throws an error the field is not found, so:
typeRec:Table GROUP(FILE:Record),TYPE
END
Also using the PRE doesn’t compile - need to use the full file label
I’ve done (PRE:Record pRecord) before. But you have to make sure that the file is always generated so that the prototype can see it. The chicken has to be hatched before the egg is laid, or something like that.
don’t include { } inside of the prototype
Please show us your actual code, so we can help you
Yes you can pass the record buffer as a group, or better yet as a typed group
I like to write:
gtRec_ADJ GROUP(ADJ:Record),TYPE,PRE(gtADJ); END
I use dot notation on the group - I don’t use it’s prefix
But it’s required to add a prefix - to replace the original prefix in the file
Keys need to have a prefix so nearly all files need to have a prefix
so with that data type I can write:
SomeProc PROCEDURE(*gtREC_ADJ xADJ)
CODE
xADJ.ID = 42 ! point being I have access to all of the fields in the file
I can call :
SomeProc( ADJ:Record )
SomeProc( Adjustment.Record )
SomeProc( Adjustment{PROP:Record} ) ! this might work, I haven't tested it