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 :
Microsoft Dynamics AX (Archived)

Collection classes and changeCompany Method

(0) ShareShare
ReportReport
Posted on by 700

Hi everyone, how do collection classes like map or list work with the changecompany() Method in a runnable class/job?

1.Question: can a colllection class be used with  the changeCompany keyword?

2.Question: if so, shall one be using Null function to set the collection class and its iterator or enumerator to an empty state?

Thanks all

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Pam B.,

    Collection classes do not have company context, it is applicable only to table records.

    1. Yes, so you may change company, iterate collection and insert data into a table.

    2. You are using null function to clear all fields form a record buffer, like dataareaid that could cause issues, but it is not applicable to collection classes directly.

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Collection classes can be used with changeCompany keyword and they work as expected. Could you provide some more details about your requirement so that we can help you better.

  • OrangeRocks Profile Picture
    700 on at

    Ok, thank you.

    I debugged my class, and found out that when initializing the collection class is the time when old values get deleted.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans