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, ...
Answered

How to deal with element.args().parmObject(); and process query on it

(0) ShareShare
ReportReport
Posted on by 229

Hello all,

Is there a way to deal with element.args().parmObject(); like we do with element.args().record(); ?

I'm explaining myself : 

I'm looking for some easy way to work with parmObject() between 2 forms, because parmObject() return an Object which i dont really find a way to process some query on it.

element.args().record() is more useful from my knowledge to filter records and work with recId for example.

So i m wondering how to deal with args.parmObject as easily as args.record.

Thank you for your answer.

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Mack,

    You can use parmObject pretty effectively as well. You can pass an instance of a class using the parmObject and can modify your query based on values stored in this class instance.  For an example, you can check AccountingSourceExplorer form.

    What values are you trying to pass between two forms? Could you please explain your requirements?

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

    It should be exactly as easy to work with both.

    You can use parmObject() to pass objects, and args.record() to pass records.

  • Awaxx Profile Picture
    229 on at

    Hi Gunjan Bhattachayya ,

    I'm still learning and training on D365.

    I'm looking for many ways to pass args from form A to form B.

    In that way i understood the way to do it with args.record .... But i'm still blocked with args.parmObject.

    My example is this one :

    (I already find the way to do it with the best practice i learned with menu item button display and so on)

    Now I created a x++ button in form A to open form B.

    I used an event handler on clicked button to process opening and getting values

    On form A i'm selecting many rows and got it with multipleselecthelper

    I stored the selection in type Set variable

    Then i transfer that values in args.parmObject(setSelection)

    I don't if there is a best way but i'm getting the values i selected with that way.

    Then i'm getting back this values in init method on form B

    There i'm need to find a way to work with parmObject i got and make some query to filter data

    I hope that's explanation is clear.

    Regards.

  • Awaxx Profile Picture
    229 on at

    The fact is more how to deal with on the opened form to use some query and filter data on it ...

  • nmaenpaa Profile Picture
    101,162 Moderator on at

    In your other discussion (community.dynamics.com/.../how-to-convert-from-set-type-to-int) you mentioned that you pass a Set via the args.

    And based on that discussion I think you already know how to read the set from args.parmObject(). Is this correct?

    If it's correct, then I assume your further questions are no longer related to parmObject but something else. Perhaps you want to know how to filter the form data via code? Or something else?

  • Awaxx Profile Picture
    229 on at

    Hi nmaenpaa ,

    You re right i tried the way you teach me but didnt understood how to perform query on it.

    I tried many ways to do that query but stil dont find how to do it ... for now i'm getting only the last value from the loop you teached me.

    So i was wondering is there another way to do it from that point or from the begining of my process to be more efficient.

    Thanksfully

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

    If you want to add query ranges based on the values in the set, you just need to iterate the set and add a new range for every value in that set.

    That's a general answer to a general question, without knowing any details. 

    By the way, could you please update the title of your question to match your actual question? Thanks!

  • Awaxx Profile Picture
    229 on at

     nmaenpaa 

    Thank you for answering and sorry to bother you again.

    Like i said, i'm still learning about D365.

    And the way you showed me before get the values that i want (recId converted from parmObject)

    But there i need to understand how to filter

    i was trying a select statement like :

    while (setEnum.moveNext())
            {
                selection = setEnum.current();
                setOfRecIds.add(selection.RecId);
    
                select buffer1
                    where buffer1.field1 == selection(from ParmObject).field1 && buffer1.field2 == selection(from ParmObject).field2;
                    
            }

    but i didnt reach what i wanna get on form B 

    I tried some query too ... but i got in result only the last value form the loop.

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    If you want to add a filter to a form data source, look again at my answer in your thread How to deal with multiselecthelper on clicked event ?.

  • Awaxx Profile Picture
    229 on at

     goshoom 

    I followed your steps and reach the result i want when i was using args.record and now i understand that way

    Then i'm trying to do the same and use this time args.parmObject.

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 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans