defaulting selected field value into another field

I have a table which consists of 4 fields.eg.f1,f2,f3,f4. filed f1 has a pk fk relation with dirpartytable.now ia m getting a lookup in fied f1.the look up consists of 3 columns eg …c1,c2,c3.in the field f1 i select a value c1.now 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;
;

super(_fieldId);

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.