0

I need to get the value from a lookup field and need to auto-write this value to another string field. I used Modified field event to auto-populate string fields but when it comes to lookup I cannot get the value. I am dealing with this for 3 days. I would be really grateful if anyone can help...

I used this code to populate sting fields. And there needs to be field 3 which is lookup.

[
    FormDataFieldEventHandler(formDataFieldStr(InventSite, InventSite, Field1), FormDataFieldEventType::Modified),
    FormDataFieldEventHandler(formDataFieldStr(InventSite, InventSite, Field2), FormDataFieldEventType::Modified)       
]
public static void Field1_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
    // get the form DataSource
    FormDataSource dataSource = sender.datasource();    
    // get current record
    InventSite inventSite = dataSource.cursor();
    // contatenate string values
    str details = strFmt("%1, %2",  inventSite.Field1, inventSite.Field2);
Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
Granger
  • 21
  • 1
  • 10
  • Please update [your original question](https://stackoverflow.com/questions/67446884/how-can-i-auto-populate-a-lookup-field-from-a-string-field-with-x) instead of posting a duplicate question... – Sander May 11 '21 at 11:34
  • Does this answer your question? [How can I auto populate a lookup field from a string field with x++?](https://stackoverflow.com/questions/67446884/how-can-i-auto-populate-a-lookup-field-from-a-string-field-with-x) – FH-Inway May 12 '21 at 09:57

0 Answers0