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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Unable to get the data from DirPersonName Table.

(0) ShareShare
ReportReport
Posted on by 185

DirPartyQuickCreateForm.pngCC_2D00_DirPartyTable-Error.png

Hi,

I am doing customization in DirPartyQuickCreate Form in which I am using FirstName and LastName for creating a new field(2,3,5 letter from LastName and 2,3 Letter from FirstName), but the problem is sometimes i am able to get the data from DirPersonName table and some times not. Actually FirstName and LastName are in DirPersonName table and i am using in line querry in event handler to get the data. I am not calling the control values in the event handler, if some how i can use them than please also tell me.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    DirPersonName is date effective table, so by default your query would only return such records where ValidFrom <= now <= ValidTo.

    Perhaps this explains why you don't always get results.

    https://docs.microsoft.com/en-us/dynamicsax-2012/developer/effects-of-valid-time-state-tables-on-read-and-write-operations

  • bilal170795 Profile Picture
    185 on at

    So can you tell me what should be the querry in my case for the recent records?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    The documentation that I shared will tell you the answer.

    Since you shared your select statement as screenshot instead of text, I can't copy it, adjust it and share the corrected version with you.

    But you can check for example Tables\LogisticsPostalAddress\findRecId to see how you can pass "unlimited" date range to the valid time state select statement.

  • bilal170795 Profile Picture
    185 on at

    date          fromDate = dateNull();

    date          toDate = dateMax();

    select validTimeState(fromDate, toDate)

               FirstName, LastName from dirPersonName

               join dirPerson

                   where dirPersonName.Person == dirPerson.RecId

               join dirPartyTable

                   where dirPerson.RecId == dirPartyTable.RecId

                       && dirPartyTable.RecId == custTable.Party;

    that what I have used, Nickalaos isn't it feasible to get the values from the First Name and Last Name controls from DirPArtyQuickCreateForm, actually they are dynamically used and I didn't find the way how to do get their values in the eventhandler?

    Also i tested this querry it is also missing the values sometimes, just for knowledge i am using it in the Inserted event of custTable, since  I have to save the generated value in CustTable.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Well, the first thing that I would try is to simply read them from the form data source:

    DirPersonName.FirstName

    DirPersonName.LastName

    does that work for you?

    Your original select statement will not work before the data is actually saved to the database.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans