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)

Problem inserting Amount, numeric field in AX webservices from Silverlight (.NET)

(0) ShareShare
ReportReport
Posted on by

Hi All,

I am facing problem inserting Numeric and Amount field in AX 2012 from .NET application through AX 2012 web services.

 I have written folloing code for the same :

trx[0].NetAmount = decimal.Parse("-20.00",CultureInfo.GetCultureInfo("en-us"));

trx[0].GrossAmount = decimal.Parse("-20.00", CultureInfo.GetCultureInfo("en-us"));
trx[0].CostAmount = decimal.Parse("-20.00", CultureInfo.GetCultureInfo("en-us"));
trx[0].PaymentAmount = decimal.Parse("-20.00", CultureInfo.GetCultureInfo("en-us"));
trx[0].NumberOfItems = 1;
 
trx[0] is the object of an AX 2012 RetailTranTable.
Please advice.
Thanks and Regards,
Arindam

*This post is locked for comments

I have the same question (0)
  • 640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    What is the problem that you are facing ??

  • Community Member Profile Picture
    on at

    I am not able to insert following feilds in the AX table from Silverlight code :

    1. Enum

    2. Amount

    3. Date.

    I am not getting any error message neither from Silverlight nor AX 2012 for the same.

    I am successfully able to insert String field. I provided the code I am using for inserting "Amount" datatype.

    Is there anything in the Syntax I am doing wrong ?

    Please let me know in case you need any further information.

    Thanks and regards,

    Arindam

  • Suggested answer
    640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    social.msdn.microsoft.com/.../a1bca402-cbe1-4233-8eb3-ce01b8cefcd4

    Set the specified field for these field

  • Community Member Profile Picture
    on at

    Could you please elaborate what exactly I need to use as Syntax ?

  • Verified answer
    640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    same for all other fields.

    trx[0].PaymentAmountSpecified = true;

  • Community Member Profile Picture
    on at

    Thank you Huzaifa. Your suggestion solved my problem.

    I used the following code:

    trx[0].PaymentAmountSpecified = true;

    trx[0].PaymentAmount = decimal.Parse("-20.00", CultureInfo.GetCultureInfo("en-us"));

    Now I am able to insert Amount, Date fields in AX 2012 table from .NET.

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