Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

element.args().record() Wrong argument types in variable assignment error

Posted on by 114

Hi everyone;

I want read other form's datasource's selected record info. But i can't.  

0535.Ekran-Al_3101_nt_3101_s_3101_.JPG

*This post is locked for comments

  • Dick Wenning Profile Picture
    Dick Wenning 8,705 on at
    RE: element.args().record() Wrong argument types in variable assignment error

    if(element.args() &&

     element.args().record() &&

     elements().record().tablid == Tablenum(ProjVendPaymentTable)

    {

    _buzEhaProjVendPaymentTable= element.args().record() as ProjVendPaymentTable;

    }

  • Martin Dráb Profile Picture
    Martin Dráb 230,214 Most Valuable Professional on at
    RE: element.args().record() Wrong argument types in variable assignment error

    Could you explain what you mean by "I did what you said but i failed"?

    Using a compatible type is always possible and you didn't give us enough information about why you failed, so we can't tell you how to fix it.

  • XB Profile Picture
    XB 1,867 on at
    RE: element.args().record() Wrong argument types in variable assignment error

    To catch a record from other form

    if you call one form from another, setup dataSource propierty in the button that you use to call the new form and then in your new form use element.args.record to cath it.

  • Emre Karakus Profile Picture
    Emre Karakus 114 on at
    RE: element.args().record() Wrong argument types in variable assignment error

    Hi Iulian;

    I did what you said but i failed. What can I do to read the selected record in the data sources in different forms .

  • Suggested answer
    Iulian Cordobin Profile Picture
    Iulian Cordobin 8,201 on at
    RE: element.args().record() Wrong argument types in variable assignment error

    Are you sure you are getting something in the args().record() and if you are it is the same type? You should make a check before like:

    if (element.args() && element.args().dataset() == tableNum(Your_table))

    { do assign }

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans