Options

Macro substitution in C/AL

madhuri.sysmadhuri.sys Member Posts: 13
HI ,

here i am trying to execute a statement like this.

glaccount.INIT;
str3:=desttbl1 +'."'+ tempname[1] +'"';
//MESSAGE(FORMAT(recordset2.Fields.Item(1).Value));
str3:=str3+ ':=' +FORMAT(recordset2.Fields.Item(1).Value);

dynamically i am getting str3 as glaccount."No.":= 001

now i would like to execute str3 .

how could i execute this statement.

thanks in advance....

Comments

  • Options
    krikikriki Member, Moderator Posts: 9,090
    You can't!

    To do something like this, you need to use recordreference and fieldreference.
    Something like.
    rerMyRecord.OPEN(DATABASE::"G/L Account");
    rerMyRecord.INIT;
    firMyField := rerMyRecord.FIELD(1);
    firMyField.VALUE := '001';
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.