Unit Price not Populating in Great Plains

I'm programmatically creating sales invoices using the Great Plains Web Services.  I'm successfully able to create the sales invoices with line items however ran into a road block where the Unit Price is not being populated in Great Plains.  Post below is the code used to populate the Unit Price for the line items.

SalesInvoiceLine line = new SalesInvoiceLine();

line.IsNonInventory = true;

ItemKey itemKey = new ItemKey();
itemKey.Id = item.Type.ToString();
line.ItemKey = itemKey;

Quantity quantity = new Quantity();
quantity.Value = item.Quantity;
line.Quantity = quantity;
line.UnitPrice = CreateMoneyAmount(item.UnitPrice, currencyKey);

I greatly appreciate the help.

Thank You,

Arthur Tam

  • Just as an update...

    Located in "Dynamics Security Console" there is a policy "Create Sales Invoice Policy" with a behavior "Calculate Unit Price Behavior" that needs to be set to "Do Not Calculate".

  • In reply to Arthur Tam:

    Thanks for posting the update. I was having the same issue and never would have figured this one out.

  • In reply to Arthur Tam:

    Hi Arthur,

    I'm programmatically creating sales returns using the Great Plains WS. I have the same problem as you had. Returns are getting created successfully but the unit price is not being populated in GP. 

    I have tried your solution to it but no luck. Below is my code for the returns :

     SalesReturnLine salesReturnLine;

    SalesReturnQuantities salesReturnQuantity;

    salesReturnLine = new SalesReturnLine();

    salesReturnQuantity = new SalesReturnQuantities();

    salesReturnQuantity.ReturnedQuantity = QuantityParam;

    salesReturnLine.ItemKey = new ItemKey() { Id = LineItemIdParam };

    salesReturnLine.ItemDescription = transactionDescription;

    salesReturnLine.ReturnQuantity = salesReturnQuantity;

    salesReturnLine.Quantity = new Quantity() { Value = QuantityParam.Value .

    salesReturnLine.UnitPrice = new MoneyAmount() { Value = UnitPriceParam, Currency = "AUD" };

    salesReturnLine.UofM = "EA";

     return salesReturnLine;


    Can you also please share the procedure to update the policy in Dynamics Security console.

    I have updated the policy and saved the changes. Do we have to reset the IIS after that??


    Greatly appreciate your help,