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)

how to assign value to array in X++ consuming web service

(0) ShareShare
ReportReport
Posted on by

hi, 

I have question in AX 2009 X++

I have an web service that is outbox GeneralLedger to create ledger header and detail lines. 

I am trying to consume this web service from X++, so I follow instruction to add Reference in AOT witch is successful

now my question is, in X++ edit, how can I assign Dimension value? 

the web service has LedgerJournalTrans.Set_Dimension() method. which I think it is Array type. 

what's format to use the method to assign Dimension set value?

 

thanks. 

 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    What exactly do you need? To create a CLR array of strings? If so, it's pretty simple:

    System.String [] stringArray = new System.String[5]();
    stringArray.SetValue("Value 1", 0);
    stringArray.SetValue("Value 2", 1);
  • Community Member Profile Picture
    on at

    Hi Martin, thanks for your reply,

    I try to consume AX AIF web service GeneralJournalService,

    this service has Create function which can create LedgerJournalTable and LedgerJournalTrans record

    I use X++ to call the service inside AX, setup and adding reference are successful.

    now, I write a class to call , in the class, I need to assign some value to entity field, one of the field from LedgerJournalTrans table, is Dimension. how can I assign for this field?

    for example, I can use:

    LedgerJournalTrans.Set_AccountNum("10002")  to assign value for ledgerJournalTrans.AccountNum field

    whats format for LedgerJournalTrans.Set_Dimension() ? it's array type.

    thanks again.

  • 640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    I think this what you are looking for ?

    http://technet.microsoft.com/en-us/library/hh272858.aspx

  • Suggested answer
    Community Member Profile Picture
    on at

    hi all, thank you for your help.

    I think I have figured out how its works.

    my goal is to consume AIF web service that using X++, General ledger creation is the sample.

    in order to create GL line, need line dimension value fill in. dimension value is array type.

    here is what my code only for dimension part in case someone else need:

    //first declare an array type valuable using System.array class, like below

    System.string[] dimensionset ;

    .

    .

    .

    ;

    dimensionset = new System.string[3]; // my dimension array has 3 dim

    dimensionset.setvalue("01",0);

    dimensionset.setvalue("02",1);

    dimensionset.setvalue("03",2);

    ledgerjournalTrans.set_dimension(dimensionset); //THIS WAS MY QUESTION BEFORE

    .......

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