web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

won't get the recid from purchline , when select the itemid

(0) ShareShare
ReportReport
Posted on by 30

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!

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    238,550 Most Valuable Professional on at

    That's the correct behaviour. New, unsaved records don't have RecId yet. It's assigned on insert.

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    RecId will be created after a record is inserted. In this case, record in purchLine table is not yet created, so no RecId.

  • @rp@n Profile Picture
    30 on at

    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

  • Verified answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 629 Super User 2025 Season 2

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 444 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 288 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans