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 :
Supply chain | Supply Chain Management, Commerce
Answered

Any workaround for upsert in OData/Logic App

(0) ShareShare
ReportReport
Posted on by 90

Hi Folks,

I have a requirement to synchronize customers, addresses, contacts, Notes etc as continous integration from 3rd party app to FinOps. I could not find any Dynamics 365 for FinOps Odata connector in Logic App for upsert. Any workaround to avoid several calls Get a record, Create a record and Update a record on multiple data entities?

Any thoughts?

I have the same question (0)
  • A.Prasanna Profile Picture
    8,223 on at

    this might help: marketplace.visualstudio.com/items

  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    Amith, could you please explain how it could help? Just mentioning a whole website isn't very useful - please point to the relevant piece (if there is any).

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi prkr,

    I believe if you want to use oData you don't have any other workarounds except getting record first with GET request and based response decide on insert or update. What is your concern in additional GET? Do you have high-volume integration in this area?

  • Verified answer
    WillWU Profile Picture
    22,363 on at

    Hi prkr,

    Agree with Sergei, I think you have to create a get a record connector in D365FO and there are no triggers for D365 FO in logic app.

    If you want your data entity do an incremental export, you can try to configuring the entity export option use BYOD.

    See the change tracking for incremental push:

    docs.microsoft.com/.../export-entities-to-your-own-database

  • prkr Profile Picture
    90 on at

    There are multiple D365FO OData calls to several customer related data entities endpounts on incoming JSOn data. Thoughts was to avoid mulyiple calls for Get/Insert or Update. Can OData actions be utilized to shift the logic to OData actions?

    Any thoughts?

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi prkr,

    oData actions and web services can be utilize to receive some input parameters and based on this make insert or update but it's much harder to support them comparing to entities and you need to develop them.

  • @frankrasta Profile Picture
    30 on at

    Hi,

    Maybe this code help you:

    public void CreateSalesOrderOneTrans()

           {

               string salesOrderNumber = "";

               string company = "agr";

               string itemId = "";

               int rowCount = 0;

               try

               {

                   SalesOrderHeader salesOrder = new SalesOrderHeader();

                   DataServiceCollection<SalesOrderHeader> salesOrderCollection = new DataServiceCollection<SalesOrderHeader>(context);

                   salesOrderCollection.Add(salesOrder);

                   //salesOrder.SalesOrderNumber = salesOrderNumber; // Change number sequence setting in AX to allow user to set values.

                   salesOrder.CurrencyCode = "UYU";

                   salesOrder.OrderingCustomerAccountNumber = "ABT-000001";

                   salesOrder.DataAreaId = company;

                   //Save salesorder

                   context.MergeOption = MergeOption.OverwriteChanges;

                   context.SaveChanges(SaveChangesOptions.PostOnlySetProperties | SaveChangesOptions.BatchWithSingleChangeset);

                   //Take Sales order next number sequence

                   salesOrderNumber = salesOrder.SalesOrderNumber;

                   //Address

                   /*

                   salesOrder.DeliveryAddressName = "Uruguay";

                   salesOrder.DeliveryAddressStreet = "street 123";

                   salesOrder.DeliveryAddressCity = "Montevideo";

                   salesOrder.DeliveryAddressStreetNumber = "876";

                   */

                   #region SalesOrderLine

                   DataServiceCollection<SalesOrderLine> salesOrderLineCollection = new DataServiceCollection<SalesOrderLine>(context);

                   SalesOrderLine salesOrderLine;

                   while (rowCount <= 1)

                   {

                       salesOrderLine = new SalesOrderLine();

                       salesOrderLineCollection.Add(salesOrderLine);

                       //salesOrder is updated through save operation before, so i can assign the correct Operations generated SalesOrderNumber to the line

                       salesOrderLine.SalesOrderNumber = salesOrder.SalesOrderNumber;

                       salesOrderLine.OrderedSalesQuantity = rowCount;

                       salesOrderLine.DataAreaId = company;

                       //salesOrderLine.SalesUnitSymbol = UnitOfMeasureCodeSymbol.Kilograms.ToString();

                       itemId = (rowCount == 1) ? "011" : "020";

                       if (itemId == "011")

                       {

                           salesOrderLine.ItemNumber = itemId;

                           salesOrderLine.ShippingSiteId = "BG";

                           salesOrderLine.ShippingWarehouseId = "wert";

                           salesOrderLine.ShippingWarehouseLocationId = "Production";

                       }

                       else

                       {

                           salesOrderLine.ItemNumber = itemId;

                           salesOrderLine.ShippingSiteId = "BG";

                           salesOrderLine.ShippingWarehouseId = "poi";

                       }

                       rowCount++;

                   }

                   #endregion

                   context.SaveChanges(SaveChangesOptions.PostOnlySetProperties | SaveChangesOptions.BatchWithSingleChangeset);

                   Console.WriteLine(string.Format("SalesOrder {0} - Saved !", salesOrder.SalesOrderNumber));

               }

               catch (DataServiceRequestException e)

               {

                   Console.WriteLine(string.Format("SalesOrder {0} - Save Failed !", "Error"));

               }

           }

    regards ,

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 > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 301 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans