Hi
Is it possible to get the current record in a lookup event handler in a form extension?
I have the following code that demonstrates what I need to do. I have created a new table called CustomRecord that has ContactPersonId, ItemId and Configuration as fields. I have extended the smmContactPerson form and added a new grid for the CustomRecord table. I want the dropdown for the Configuration field to be based on the ItemId field, but I cant work out how to get the data from the currently selected CustomRecord record.
[ExtensionOf(FormStr(smmContactPerson))] final public class smmContactPersonEventHandler_Extension { [FormControlEventHandler(formControlStr(smmContactPerson, CustomRecord_Configuration), FormControlEventType::Lookup)] public void CustomRecord_Configuration_OnLookup(FormControl sender, FormControlEventArgs e) { CustomRecord customRecord; FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs; // TODO: find out how I retreive the current CustomRecord record CustomRecord::lookupConfiguration(sender, customRecord.ItemId); ce.CancelSuperCall(); } }
Can someone point me in the right direction please?
Thanks,
Joe