Options

Setting table field values using common

mix2ramix2ra Member Posts: 2
edited 2004-07-15 in Dynamics AX
Hi,

Does any one knows how to assign a value to a field on a common table?

->

Common source, destination;
DictTable dictTable;
;
dictTable = new DictTable(77); //77 is CustTable
source = dictTable.makeRecord();
destination = dictTable.makeRecord();

destination.data(source);
/*
here I would like to change on field e.g. destination.custName = 'aaa'
but I get the error
*/

destination.insert();

<-

the above code is used to duplicate a record (in this case CustTable record).
It should be made that way because the user specifies on which table a replication should be made so tableId is used.

My question is how can I change field values on common object.

Best Regards

Sebastian Widz

Comments

  • Options
    MugurMugur Member Posts: 93
    Hi,

    You can proceed as follows:

    source = custTable::find('4001');
    destination.clear();
    destination = source.data();
    destination.(fieldnum(CustTable,accountnum)) = "5003";
    destination.insert();

    Regards,
    CD
    Kind regards,

    Ciprian Dudau
    Axapta Developer
Sign In or Register to comment.