Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Convert 'System.Object...
Finance forum
Answered

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

Posted on by 112
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?
 
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 229,129 Most Valuable Professional on at
    Convert 'System.Object[]' to type 'Microsoft.Dynamics.Ax.Xpp.XppObjectBase' in X++
    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.
  • ShahzaibAhmed52 Profile Picture
    ShahzaibAhmed52 112 on at
    Convert 'System.Object[]' to type 'Microsoft.Dynamics.Ax.Xpp.XppObjectBase' in X++
    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.
  • Hana Xue Profile Picture
    Hana Xue Microsoft Employee on at
    Convert 'System.Object[]' to type 'Microsoft.Dynamics.Ax.Xpp.XppObjectBase' in X++
    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
  • Layan Jwei Profile Picture
    Layan Jwei 7,150 Super User 2024 Season 2 on at
    Convert 'System.Object[]' to type 'Microsoft.Dynamics.Ax.Xpp.XppObjectBase' in X++
    Hi Shahzaib,

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

    Thanks,
    Layan Jweihan

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

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,802 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,129 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,154

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans