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

Convert 'System.Object[]' to type 'Microsoft.Dynamics.Ax.Xpp.XppObjectBase' in X++

(0) ShareShare
ReportReport
Posted on by 148
Hi,
 
is there a way to convert 'System.Object[]' to type 'Microsoft.Dynamics.Ax.Xpp.XppObjectBase' in X++?
 
If yes can you share code snippet or a reference link?
 
I have the same question (0)
  • Layan Jwei Profile Picture
    8,112 Super User 2025 Season 2 on at
    Hi Shahzaib,

    can you please share the code where you are trying to do this conversion?

    Thanks,
    Layan Jweihan
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Hi,
    Have you already tried converting? If so, can you provide more information? Such as screenshots or code. You can explain it in more detail so that other experienced people can help you.
    Best Regards,
    Hana
  • ShahzaibAhmed52 Profile Picture
    148 on at
    I have not tried to convert it as I don't know how to do it. All I have is a System.Object[] which I need to convert into Microsoft.Dynamics.Ax.Xpp.XppObjectBase.
    There is an third-party API that returns that object but i need it to be converted into Microsoft.Dynamics.Ax.Xpp.XppObjectBase.
  • Verified answer
    Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at
    Casting is impossible - these types aren't compatible.
     
    But a conversion is possible. For example, if you have System.Object[] containing strings, you can iterate them and put them to List class in F&O. The exact solution depends on what you're doing, which you didn't tell us.
     
    Also, XppObjectBase is an abstract class that you can't use as such, but it's a parent of all native X++ classes. You'll need to use a a non-abstract class instead of XppObjectBase.

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

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans