defaulting selected field value into another field

I have a table which consists of 4,f2,f3,f4. filed f1 has a pk fk relation with ia m getting a lookup in fied f1.the look up consists of 3 columns eg …c1,c2, the field f1 i select a value my requirement is when i select field c1 in f1. the field relted to c1(like c2 and c3)must be automatically get defaulted in to field f2 and f3 how to achieve this in ax 2012??

Hi Durga,

I hope your foreign Key Based Primary Key field name is DirPartyTable in your Table.

Just Override modifiedField method of Your Table… Try the below code same as it is

public void modifiedField(FieldId _fieldId)
DirPartyTable dirPartyTable;


if (_fieldId == fieldNum(YourTableName, DirPartyTable)) // Here DirPartyTable is FK based PK Field
dirPartyTable = DirPartyTable::findRec(this.DirPartyTable);

this.F2 = dirPartyTable.PartyNumber;
this.F3 = dirPartyTable.Name;

Hope this solution can work for you.