Inherit Company data when importing Contacts

I have imported Contacts from an external database (Type: Company) into Navision. Now I want to import the contact (Type: Person) belonging to those Companies, but somehow I cannot get the right data in Navision. My dataport contains these fields: “No.” “Company No.” Name “Search Name” “Phone No.” “Fax No.” “E-Mail” And in the OnAfterImportRecord IF NOT lRecContact.GET("No.") THEN lRecContact."No." := "No."; lRecContact.Name := Name; lRecContact.INSERT(TRUE); lRecContact.Type := lRecContact.Type::Person; lRecContact."Lookup Contact No." := "No."; lRecContact."Company No." := "Company No."; lRecContact."Search Name" := "Search Name"; lRecContact."Phone No." := "Phone No."; lRecContact."E-Mail" := "E-Mail"; lRecContact.MODIFY(TRUE); The records are imported, but I would like the Contact to inherit the field of the Parent Company like Company Name, Address and so on. How could I achieve this?

In our 3.60 database the field values you want inherited are all Normal fields and not Flowfield fields, so no automatic inheritance. And it isn’t coded in the OnValidate of “Company No.” either. [:(] Maybe you can code it in the OnValidate yourself or do a GET(“Company No.”) and assign the values in the OnAfterImportRecord.

Peter, That,s funny, isn’t it? When manually entering a new contact of type Person, the Company details are inherited, depending of the settings in Relationship management setup. I think this is triggered in the OnModify from table 5050. Why doesn’t my last line in the code do the trick then?

It looks like it is coded in the Company No. OnValidate after all. So use a VALIDATE(“Company No.”, “Company No.” in your OnAfterImportRecord.