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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Updating SalesOrderLines via ODATA

(2) ShareShare
ReportReport
Posted on by 6
I created a Sales Order Line tied to a Sales Order with ODATA using a POST request, and it works (see bottom for output cleaned up).
 
I then want to update this line later with some additional information. I have tried taking the same output and using a PUT request, I have tried taking just the data from the EntityKey and doing a PATCH request and I get the same errors.
 
Help on how to update a line. I have tried the below PATCH with and without sales order number/linenumber and get the same following error message.
 
PATCH
{
/dataAreaId/: /abc/,
/InventoryLotId/: /LOT-000089417/,
/LineAmount/: 55,
/SalesOrderNumber/: /SO-000021327/,
/LineNumber/: 4
}
 
/error/: {
/code/: //,
/message/: /An error has occurred./,
/innererror/: {
/message/: /No resources were found when selecting for update./,
/type/: /Microsoft.Dynamics.Platform.Integration.Services.OData.ODataArgumentException/,
/stacktrace/: / at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.GetEntityForUpdat
 
{
/@odata.context/: https:/,
/@odata.etag/: /W////=////,
/dataAreaId/: /abc/,
/InventoryLotId/: /LOT-000089417/,
/RequestedReceiptDate/: /1900-01-01T12:00:00Z/,
/RetailCalculatedTotalDiscountPercentage/: 0,
/EInvoiceDimensionAccountCode/: //,
/FormattedDelveryAddress/: /1025  Dr// , MN 56537-/USA/,
/ShippingWarehouseLocationId/: //,
/SalesOrderLineStatus/: /Backorder/,
/ProjectCategoryId/: /test/,
/ExcludeFromMasterPlanning/: /No/,
/ItemNumber/: /1234/,
/DeliveryAddressDescription/: /  Address/,
/MultilineDiscountPercentage/: 0,
/ShippingWarehouseId/: /1/,
/GiftCardBuyerName/: //,
/GiftCardNumber/: //,
/CustomsDocumentNumber/: //,
/LineDiscountAmount/: 0,
/ProductStyleId/: //,
/ProductConfigurationId/: //,
/DeliverySalesTaxGroupCode/: //,
/IsIntrastatTriangularDeal/: /No/,
/MultilineDiscountAmount/: 0,
/ItemBatchNumber/: //,
/DeliveryAddressCountryRegionId/: /USA/,
/DeliveryAddressLatitude/: 0,
/IsPriceLocked/: /No/,
/DeliveryAddressCity/: / Falls/,
/SalesProductCategoryName/: //,
/SalesOrderPromisingMethod/: /None/,
/ProjectId/: /PRJ-000001234/,
/DeliveryAddressDistrictName/: //,
/ProjectLinePropertyId/: /CHG/,
/SalesRebateProductGroupId/: //,
/DeliveryAddressCountyId/: /King Tail/,
/SalesUnitSymbol/: /Ea/,
/SalesDeliverNow/: 0,
/ItemWithholdingTaxCodeGroupCode/: //,
/ConfirmedReceiptDate/: /1900-01-01T12:00:00Z/,
/ProductSizeId/: //,
/FixedPriceCharges/: 0,
/DeliveryAddressZipCode/: /56537-4303/,
/DeliveryAddressDunsNumber/: //,
/DeliveryTermsId/: //,
/IsSoftReservedExternally/: /No/,
/ServiceFiscalInformationCode/: //,
/RetailCalculatedTotalDiscountAmount/: 0,
/DeliveryAddressName/: /  Address/,
/PackingUnitSymbol/: //,
/OrderedSalesQuantity/: 1,
/BOMId/: //,
/CreditNoteReasonCode/: //,
/DeliveryAddressStreetNumber/: //,
/DeliveryAddressStreetInKana/: //,
/ShippingSiteId/: /1/,
/NGPCode/: 0,
/RetailCalculatedLineDiscountAmount/: 0,
/IsDeliveryAddressPrivate/: /No/,
/LineCreationSequenceNumber/: 4,
/RetailCalculatedTenderDiscountPercentage/: 0,
/InventoryServiceReservationId/: //,
/MainAccountIdDisplayValue/: //,
/OrderedInventoryStatusId/: //,
/GiftCardRecipientEmail/: //,
/DeliveryAddressCountryRegionISOCode/: /US/,
/ItemSerialNumber/: //,
/RetailCalculatedManualLineDiscountPercentage/: 0,
/CalculateLineAmount/: /Yes/,
/RetailCalculatedPeriodicDiscountAmount/: 0,
/IntrastatTransactionCode/: //,
/CurrencyCode/: /USD/,
/DeliveryAddressLocationId/: /00001047/,
/RouteId/: //,
/SalesTaxItemGroupCode/: /ALL/,
/EInvoicePropertyNumber/: //,
/ProductVersionId/: //,
/CommissionSalesRepresentativeGroupId/: //,
/CustomsDocumentName/: //,
/WillAutomaticInventoryReservationConsiderBatchAttributes/: /No/,
/IntrastatStatisticsProcedureCode/: //,
/OverrideSalesTax/: /No/,
/LineDescription/: /Dynamics 365 O/,
/DeliveryAddressStreet/: /1025  Dr/,
/DeliveryModeCode/: //,
/ConfirmedShippingDate/: /1900-01-01T12:00:00Z/,
/FullRunCTPStatus/: /Ready/,
/RetailCalculatedLineDiscountPercentage/: 0,
/SalesTaxGroupCode/: /TAX/,
/ServiceOrderNumber/: //,
/IsDeliveryAddressOrderSpecific/: /No/,
/CustomerRequisitionNumber/: //,
/SalesOrderNumber/: /SO-000021327/,
/FiscalDocumentTypeId/: //,
/PlanningPriority/: 0,
/DeliveryCFOPCode/: //,
/LineDiscountPercentage/: 0,
/SalesPrice/: 45,
/GiftCardGiftMessage/: //,
/SalesOrderLineCreationMethod/: /SalesOrder/,
/FulfillmentStatus/: /Unknown/,
/OrderedCatchWeightQuantity/: 0,
/RetailCalculatedPeriodicDiscountPercentage/: 0,
/OrderLineReference/: //,
/AllowedUnderdeliveryPercentage/: 0,
/DeliveryAddressCityInKana/: //,
/AllowedOverdeliveryPercentage/: 0,
/Catalog/: 0,
/DeliveryAddressLongitude/: 0,
/IntrastatCommodityCode/: //,
/LineNumber/: 4,
/DefaultLedgerDimensionDisplayValue/: /10-1140-NONE------2010/,
/DeliveryAddressTimeZone/: null,
/ProductColorId/: //,
/GiftCardRecipientName/: //,
/CFOPCode/: //,
/DeliverySalesTaxItemGroupCode/: //,
/DeliveryAddressStateId/: /MN/,
/DeliveryBuildingCompliment/: //,
/IntrastatTransportModeCode/: //,
/DeliveryAddressPostBox/: //,
/CustomersLineNumber/: 0,
/CustomsDocumentDate/: /1900-01-01T12:00:00Z/,
/GiftCardType/: /Email/,
/LineAmount/: 45,
/IntrastatPortId/: //,
/IntrastatSpecialMovementCode/: //,
/SalesPriceQuantity/: 1,
/WillRebateCalculationExcludeLine/: /No/,
/RetailCalculatedTenderDiscountAmount/: 0,
/SuframaDiscountPercentage/: 0,
/InventoryReservationMethod/: /None/,
/RequestedShippingDate/: /2024-04-01T12:00:00Z/,
/RetailCalculatedManualLineDiscountAmount/: 0,
/WithholdingTaxGroupCode/: //,
/FulfillmentStoreId/: //,
/SkipCreateAutoCharges/: /Yes/,
/ExternalItemNumber/: //,
/IntrastatStatisticValue/: 0,
/IsLineStopped/: /No/,
/GiftCardBuyerEmail/: //,
/SourceDocumentLine/: 5639552333,
/SalesLineCreatedBy/: //,
/InventTransId/: /LOT-000089417/,
/InventRefId/: //,
/SalesLineModifiedBy/: //,
/SalesLineModifiedDateTime/: /1900-01-01T00:00:00Z/,
/SalesLineCreatedDateTime/: /1900-01-01T00:00:00Z/,
/InventRefTransId/: //,
/InventRefType/: /None/,
/InventRefId/: //,
/SubBillRevenueSplit/: /No/,
/RevRecRevenueScheduleId/: //,
/RevRecSalesDeliverNow/: 0,
/RevRecContractEndDate/: /1900-01-01T12:00:00Z/,
/RevRecOccurrences/: 0,
/RevRecContractStartDate/: /1900-01-01T12:00:00Z/
}
I have the same question (0)
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Hi,
    The link below mentions the same error as yours, you can check if it helps. Or wait for developer support.
    No resources were found when selecting for update (dynamics.com)
    Best Regards,
    Hana
  • Martin Dráb Profile Picture
    237,939 Most Valuable Professional on at
    You showed the body of the request, but your problem likely lies in the URL. Can you share that too, please?
  • Suggested answer
    Layan Jwei Profile Picture
    8,112 Super User 2025 Season 2 on at
    Hi Community member,

    Are you trying to update LineAmount?

    you can follow this using PATCH:

     
    YourEnvironmentUrl/data/SalesOrderLines(InventoryLotId = 'LOT100001163',dataAreaId = 'ABC)?cross-company=true

    Body:
    {
        "SalesPriceQuantity"1,
        "LineAmount"5,
        "SalesPrice"5
    }

    No need to specify in the body, sales order number or line number, as InventoryLotId is unique and it's the entity key. And dataAreaId is already specified in the URL
    ​​​​​​​

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Mohamed Amine Mahmoudi Profile Picture
    26,401 Super User 2025 Season 2 on at
    Hi,
     
    Can you share with us the URL used for POST and PATCH?
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Layan Jwei Profile Picture
    8,112 Super User 2025 Season 2 on at
    Hi,
     
    Is your issue fixed? If yes, then please verify the answers that helped 

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans