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

Odata API Customization

(0) ShareShare
ReportReport
Posted on by 15
GET {{resource}}/data/SalesOrderHeaders
Using above OData API I want to fetch order created date in its response. how I can do it?
Adding screenshot for reference
7384.MicrosoftTeams_2D00_image.png
  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Moderator on at
    RE: Odata API Customization

    If worked, please don't forget to Verify answer/s that helped you, so it can help someone in future.

    You can verify answer/s by clicking Yes to 'Did this answer your question?'

  • Suvarna Punekar Profile Picture
    Suvarna Punekar 15 on at
    RE: Odata API Customization

    Thanks Mohit for your help.

    Thanks to André Arnaud de Calavon

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Moderator on at
    RE: Odata API Customization

    Thank for sharing it, The issue is that you are calling SalesOrderHeaders (SalesOrderHeaderEntity) but have made changes in SalesOrderHeadersV2 (SalesOrderHeaderV2Entity) data entity. Please call the correct entity and let me know the results.

  • Suvarna Punekar Profile Picture
    Suvarna Punekar 15 on at
    RE: Odata API Customization

    Hi Mohit,

    Sales order response

    {

        "@odata.context""https://<AOS>/data/$metadata#SalesOrderHeaders",
        "value": [
            {
                "@odata.etag""W/\"JzEsNjg3MTk1MjIzOTc7MCwwOzAsMDswLDA7MCwwJw==\"",
                "dataAreaId""usrt",
                "SalesOrderNumber""012656",
                "OrderTotalChargesAmount"0,
                "FiscalDocumentOperationTypeId""",
                "OrderTakerPersonnelNumber""000020",
                "RequestedReceiptDate""2023-04-06T12:00:00Z",
                "EInvoiceDimensionAccountCode""",
                "IsOwnEntryCertificateIssued""No",
                "InvoiceAddressStreet""",
                "FormattedDelveryAddress""",
                "CampaignId""",
                "Email""",
                "DefaultShippingSiteId""",
                "TransportationBrokerId""",
                "TransportationModeId""",
                "DeliveryAddressDescription""",
                "CFPSCode""",
                "IsInvoiceAddressPrivate""No",
                "IsSalesProcessingStopped""No",
                "TMACustomerGroupId""",
                "BankSpecificSymbol""",
                "SalesOrderStatus""Backorder",
                "NumberSequenceGroupId""",
                "SalesOrderOriginCode""",
                "InvoiceAddressLatitude"0,
                "TransportationTemplateId""",
                "CustomerPaymentFinancialInterestCode""",
                "BankConstantSymbol""",
                "OrderTotalTaxAmount"0,
                "IsOneTimeCustomer""No",
                "SalesOrderPoolId""03",
                "DeliveryAddressCountryRegionId""",
                "DeliveryAddressLatitude"0,
                "TotalDiscountCustomerGroupCode""",
                "DeliveryAddressCity""",
                "SalesRebateCustomerGroupId""",
                "ThirdPartySalesDigitalPlatformCNPJ""",
                "SalesOrderPromisingMethod""ATP",
                "ShippingCarrierId""",
                "TotalDiscountPercentage"0,
                "DeliveryAddressDistrictName""",
                "DeliveryAddressCountyId""",
                "ConfirmedReceiptDate""1900-01-01T12:00:00Z",
                "DeliveryAddressZipCode""",
                "FiscalOperationPresenceType""DoesNotApply",
                "QuotationNumber""",
                "IsConsolidatedInvoiceTarget""No",
                "LanguageId""en-us",
                "DeliveryAddressDunsNumber""",
                "MultilineDiscountCustomerGroupCode""",
                "InvoiceAddressStateId""",
                "ServiceFiscalInformationCode""",
                "CustomerPaymentMethodSpecificationName""",
                "CommissionCustomerGroupId""",
                "DeliveryAddressName""Sania",
                "InvoiceAddressCountryRegionId""",
                "PaymentTermsBaseDate""1900-01-01T12:00:00Z",
                "DeliveryAddressStreetNumber""",
                "CreditNoteReasonCode""",
                "ChargeCustomerGroupId""",
                "InvoiceAddressStreetNumber""",
                "TaxExemptNumber""",
                "IsDeliveryAddressPrivate""No",
                "AreTotalsCalculated""No",
                "TotalDiscountAmount"0,
                "OrderTotalAmount"0,
                "CustomersOrderReference""",
                "FormattedInvoiceAddress""",
                "ExportReason""",
                "OrderResponsiblePersonnelNumber""000020",
                "DeliveryAddressCountryRegionISOCode""",
                "CashDiscountCode""",
                "PaymentScheduleName""",
                "IntrastatTransactionCode""",
                "URL""",
                "CurrencyCode""USD",
                "OrderTotalDiscountAmount"0,
                "InvoiceType""Invoice",
                "ArePricesIncludingSalesTax""No",
                "InvoiceCustomerAccountNumber""00121",
                "DeliveryAddressLocationId""",
                "CustomerTransactionSettlementType""OpenTransact",
                "CommissionSalesRepresentativeGroupId""",
                "WillAutomaticInventoryReservationConsiderBatchAttributes""No",
                "IntrastatStatisticsProcedureCode""",
                "IsEInvoiceDimensionAccountCodeSpecifiedPerLine""No",
                "DeliveryAddressStreet""",
                "IsExportSale""No",
                "DeliveryModeCode""",
                "ConfirmedShippingDate""1900-01-01T12:00:00Z",
                "FixedDueDate""1900-01-01T12:00:00Z",
                "TransportationDocumentLineId""00000000-0000-0000-0000-000000000000",
                "SalesTaxGroupCode""",
                "IsDeliveryAddressOrderSpecific""No",
                "CustomerRequisitionNumber""",
                "InvoiceAddressLongitude"0,
                "FiscalDocumentTypeId""",
                "InvoiceAddressCity""",
                "IsFinalUser""No",
                "InvoiceAddressPostBox""",
                "ShippingCarrierServiceGroupId""",
                "ContactPersonId""",
                "EUSalesListCode""IncludeNot",
                "InvoiceAddressDistrictName""",
                "ThirdPartySalesDigitalPlatform""No",
                "PaymentTermsName""",
                "CustomerPostingProfileId""GEN",
                "DeliveryAddressLongitude"0,
                "InvoiceAddressZipCode""",
                "DeliveryTermsCode""",
                "ShippingCarrierServiceId""",
                "DefaultLedgerDimensionDisplayValue""",
                "DeliveryAddressTimeZone"null,
                "SalesOrderName""Sania",
                "DefaultShippingWarehouseId""",
                "IsEntryCertificateRequired""No",
                "DeliveryAddressStateId""",
                "DeliveryBuildingCompliment""",
                "IntrastatTransportModeCode""",
                "InvoicePaymentAttachmentType""None",
                "DeliveryAddressPostBox""",
                "InvoiceAddressTimeZone"null,
                "InvoiceAddressCountyId""",
                "DirectDebitMandateId""",
                "LineDiscountCustomerGroupCode""",
                "IntrastatPortId""",
                "OrderingCustomerAccountNumber""00121",
                "CustomerPaymentFineCode""",
                "InvoiceBuildingCompliment""",
                "PriceCustomerGroupCode""",
                "DeliveryReasonCode""",
                "IsServiceDeliveryAddressBased""No",
                "InventoryReservationMethod""None",
                "RequestedShippingDate""2023-04-06T12:00:00Z",
                "SalesOrderProcessingStatus""Active",
                "TransportationRoutePlanId""",
                "CustomerPaymentMethodName""",
                "SalesUnitId""",
                "FixedExchangeRate"0
            }
        ]
    }
  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Moderator on at
    RE: Odata API Customization

    Can you share Odata response for just one sales order.

  • Suvarna Punekar Profile Picture
    Suvarna Punekar 15 on at
    RE: Odata API Customization

    Hi Mohit,

    Now CreatedDateTime1 field showing in SalesOrderHeaderV2Entity in data management (see below screenshot)& also generated mapping from Modify Target mapping for this data entity.

    But still not showing in OData response.

    pastedimage1683123244078v1.png

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Moderator on at
    RE: Odata API Customization

    Hi Suvarna, You can use 'TransDateTime' EDT by drag drop or copy paste this EDT into the stating table and renaming the field.

  • Suvarna Punekar Profile Picture
    Suvarna Punekar 15 on at
    RE: Odata API Customization

    Hi Mohit,

    Yes, I have added CreatedDateTime in SalesOrderHeaderV2Entity.

    Now i have started again from scratch but still same issue.

    https://d365ffo.com/2021/05/06/d365ffo-ax-add-new-field-to-a-data-entity/

    In above blog mentioned that "Add the field into Staging table fields.

    You can add it by opening PurchTable extension and drag and drop the field to your staging table"

    But I don't see CreatedDateTime field in PurchTable. here is the screenshot

    pastedimage1683053126467v1.png

    Please let know how I can drag CreatedDateTime field in PurchPurchaseOrderHeaderV2Staging.

    Thanks,

    Suvarna

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Moderator on at
    RE: Odata API Customization

    I'm not able to replicate your issue. As mentioned, we have added CreatedDateTime in SalesOrderHeaderV2Entity and I can see this field via OData.

    The issue is that you are not using correct field. Instead of OrderCreatedDateTime, please use createdDateTime field from SalesTable and generate mapping in data entity to add the new field.

    The field you are referring to in the Sales order form is 'CreatedDateTime' in SalesTable. Please make the changes and it should work.

  • Suvarna Punekar Profile Picture
    Suvarna Punekar 15 on at
    RE: Odata API Customization

    Hi Andre,

    Yes, I synchronize the database but still ORDERCREATIONDATETIME field not coming in API response.

    Thanks

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,401 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans