Dynamically pass record fieldname into function

AndyClarkeAndyClarke Member Posts: 6
Hi,

I'm new to Navision and am not even sure if what I'm trying to do is possible?

I've got some code in a function ...

IF(ModelRec.Transmission <> ModelTemp.Transmission) THEN BEGIN

But so I can reuse it I want to do something like ...

IF(ModelRec("FieldName") <> ModelTemp("FieldName")) THEN BEGIN

where FieldName is a Text field passed into the function (containing 'Transmission')

Is this even possible? If so, could someone assist me with the syntax please?

Thanks,

Andy

Comments

  • matttraxmatttrax Member Posts: 2,309
    I'm afraid not. You can look into RecRef and FieldRef, though. Just go to the help menu in the client or search the forum. Basically they are variables that can refer to any table or any field in a table. So you might be able to accomplish what you are trying to do with those.

    They do consume a decent amount more CPU cycles, though, then just a few IF statements, so you might just be better off doing it the "old fashioned" way.
Sign In or Register to comment.