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

Announcements

No record found.

News and Announcements icon
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,172 Moderator on at

    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

    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,172 Moderator on at

    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

    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,172 Moderator on at

    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

    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,172 Moderator on at

    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

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 722

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 605 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 547

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans