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

Community site session details

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

How to convert from Set type To int ?

(0) ShareShare
ReportReport
Posted on by 229

Hi friends,

Do someone know how to convert records from Set Type to Int ?

Thanksfully.

I have the same question (0)
  • nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to convert from Set type To int ?

    Hi,

    could you share any more details about your actual requirement? I'm sure there's some actual scenario/issue that you're working with.

    Sets, records and integers are three completely different things (and can't be converted to each other) so at least I don't understand the question.

  • Awaxx Profile Picture
    229 on at
    RE: How to convert from Set type To int ?

    Yes i wanna pass from form A args().parmObject(SetRecords); to another form B

    And then i wanna try to gives to recId values of the SetRecords that i got

  • nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to convert from Set type To int ?

    So you have a set of records, and you want to get recIds of those records?

    Did I understand correctly?

  • Awaxx Profile Picture
    229 on at
    RE: How to convert from Set type To int ?

    Yes i was doing that on form A :

            eukSelectedMenus  = selectionHelper.getFirst();
    
            if (eukSelectedMenus.RecId)
            {
                while (eukSelectedMenus.RecId != 0)
                {
                    selectedRecords.add(eukSelectedMenus);
                    eukSelectedMenus = selectionHelper.getNext();
                }
            }
            
            args.parmObject(selectedRecords); //Assign to args values

    My problem is to get that values on form B and deal with it to make some query on RecId for example

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to convert from Set type To int ?

    I'm still not sure that I understand.

    If you need  to access selected records of form A on form B you can do it directly by using the caller data source. You don't need any sets.

    Anyway, if you have a set of records, and you want to also have a set of rec ids of those records, you should be able to solve it by using your current skills. Just fetch each record from the set, and add it's RecId to another set (of type Int64).

  • Awaxx Profile Picture
    229 on at
    RE: How to convert from Set type To int ?

    Yes that what i want to do ... but i'm still newbie on D365 and i dont find the right way to code that

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to convert from Set type To int ?

    SetEnumerator setEnum = setOfRecords.getEnumerator(); // setOfRecords is the one that you have
    Set setOfRecIds = new Set(Types::Int64);
    
    while (setEnum.moveNext())
    {
        MyRecord myRecordLocal = setEnum.current();
        setOfRecIds.add(myRecordLocal.RecId);
    }

  • Awaxx Profile Picture
    229 on at
    RE: How to convert from Set type To int ?

    Thank you very much ... i didnt figure how to do that

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans