web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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/
}
  • 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
    240,744 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,284 Super User 2026 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,826 Super User 2026 Season 1 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,284 Super User 2026 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 426 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 358

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 353 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans