hI Team,
[FormDataFieldEventHandler(formDataFieldStr(PurchTable, PurchLine, ItemId), FormDataFieldEventType::Modified)] public static void ItemId_OnModified(FormDataObject sender, FormDataFieldEventArgs e) { PurchLine purchLine = sender.datasource().cursor(); }
But when I create a new line and enter Item Id, then won't get the Recid from Purch Line.
Kindly let me know if anything missing?
Pls give me more shed on this.
thanks!
Yes, To get RecId, record should be inserted. You can add breakpoint on insert method of PurchLine table and try adding new line, add item and dont save the line. If on selecting itemId it hits insert method then you will get RecId. However, PurchLine is not created just by selecting ItemId. You need to write you logic in post insert event handler or after next statement in CoC of insert method in PurchLine table extension class.
thanks Mohit,
I tried in PurchLine table - insert , PurchTable(form) - PurchLine - Insert
but unbale to get the rec id.
my question is, Is required to save the record after selecting the itemid ?
when i select the item id and putting the break point on insert but the purch line showing no data selected.
kindly help me with the code pls
RecId will be created after a record is inserted. In this case, record in purchLine table is not yet created, so no RecId.
That's the correct behaviour. New, unsaved records don't have RecId yet. It's assigned on insert.
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156