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 GP (Archived)

Create Sales Invoice - subtotal and line unit price is always zero.

(0) ShareShare
ReportReport
Posted on by

Hi, I'm using the  CreateSalesInvoice method from the GP web service and successfully created the records in SOP10100 and SOP10200. When I verified the test transaction on GP, the unit price is zero making the sub totals to zero as well. How should I add the unit price? What am i missing in my code? Thanks in advance for the help.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Jun,

    Can you cross check for the Item in GP whether the price is setup by going to Cards>> Inventory>>Item>> GOTO>> Item Price List

    If the setup is done, then it is something to check your current code. Can you share the code ?

  • Community Member Profile Picture
    on at

    Hi Shan,

     Thanks for the response. We don't have that kind of setup for the items in our GP.  In our old application using Econnect, we were setting the values for UnitCost, UnitPrice and ExtendedCost before we call

    taSopLineIvcInsert_ItemsTaSopLineIvcInsert.

    Now that we are shifting to the GP web service, we're unable to set the Unit Cost and the items just shows zero. Here's the code snippet for setting the invoice lines.

    using (var client = new DynamicsGPClient())

    {

    foreach (var line in details)

    {

    gpItem = client.GetItemByKey(new ItemKey {Id = line.ItemNumber}, _gpContext);

    var invoiceLine = new SalesInvoiceLine

    {

    Key = new SalesLineKey { LineSequenceNumber = (int)line.LineSequenceNumber }),

    ItemKey = line.ItemNumber,

    Quantity = line.QuantityShipped,

    FulfillDate = line.RecordCreateDate,

    UofM = line.uofM}

    invoiceLine.UnitPrice = new MoneyAmount

    {

    Value = gpItem.CurrentCost.Value,

    DecimalDigits = 5,

    Currency = DefaultCurrency

    };

    }

    SalesInvoiceLineList.Add(invoiceLine)

    }

    salesInvoice.Lines = SalesInvoiceLineList.ToArray();

    using (var client = new DynamicsGPClient())

    {

    var policy = client.GetPolicyByOperation("CreateSalesInvoice", _gpContext);

    client.CreateSalesInvoice(saleInvoiceModel, _gpContext, policy);

    }

  • Heather Roggeveen Profile Picture
    9,146 on at

    Hi

    I am not a programmer - but I may be able to offer some little sanity check here.  Have you checked the settings for web services - I can't remember exactly what it is called but maybe someone can pitch in with the right name. 

    There is a configuration area where you tell the system what you are supplying and what you are defaulting and there are a number of things you can set.  It could be worth checking that area to see that there is nothing that would impact this.

    Cheers

    Heather

  • Verified answer
    babubaskaran@outlook.com Profile Picture
    12 on at

    Hi,

    I agree with Heather, Please check the Dynamics Security Console and under policy you might check the particular module and check the settings.

  • Community Member Profile Picture
    on at

    Hi Babu, Heather,

     Thanks for the suggestion, checked the create sales invoice policy settings and used the default ones. Would you have any idea which specific confiv will affect the unit price? Thanks

  • Heather Roggeveen Profile Picture
    9,146 on at

    Hi

    I don't have access to a console on this so can't look at the specific items - look for anything to do with price - there may be options to default (i.e. use system pricing) or pass the information.

    I certainly know that there are options for taxes and gl coding.

    If you can share a screen shot of the policy settings, I may be able to spot something.

    Cheers

    Heather

  • Community Member Profile Picture
    on at

    Thanks Heather for the info, it worked. On the Create Sales Invoice policy, I set the values of the following to "Do not Calculate".

     - Calculate Unit Price behavior

     - Calculate Total Amount behavior

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 GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans