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 :
Microsoft Dynamics AX (Archived)

Integration class need to call once when delete multiple lines from Sales order

(0) ShareShare
ReportReport
Posted on by 56

Hi All,

As per requirement when user going to delete lines from Sales order then the line parameters should go to dynamics CRM. this is the integration between AX and CRM. and it's working fine.

Basically I wrote the code in SalesLineType - Delete method.

Suppose user select multiple lines ( 2 ) and clicked on removed button , then as per standard behaviour , the Delete method is called TWICE and integration is called twice. Because delete method is called one by one record to delete.

That is working fine, BUT customer wants to call integration class ONCE to delete multiple lines from Sales order.

Kindly let me know how to achieve this.

Thanks!

*This post is locked for comments

I have the same question (0)
  • Sukrut Parab Profile Picture
    71,735 Moderator on at

    From where user selects line  AX ? Do you pass line reference through integration and stored in CRM somewhere  ? if its store you could store line recId's  as list or container and  change the way you call integration instead of call it from delete method.

  • @rp@n Profile Picture
    56 on at

    Thanks Sukrut

    Could you please let me know which place is the best to do this?because I need to store recid's before delete the record from sales line. Means before calling super method.  If i am not wrong.

    Please give me more shed on this.

    Thanks!

  • Sukrut Parab Profile Picture
    71,735 Moderator on at

    I don't know the way your classes are designed and  limited knowledge on your business scenario  , so it would be hard for me to give you exact suggestions. But if you store recid's in delete method you have to find a way to called integration once using the stored recid's.

  • @rp@n Profile Picture
    56 on at

    Sukrut, that I wants to know how I will store multiple recid's for multiple lines? Because delete method called for each and every line .

    Give me the solution for this only. Rest I will handle on my integration class with those recid's.

    Please give me more shed on this.

    Thanks!

  • Martin Dráb Profile Picture
    239,364 Most Valuable Professional on at

    It's quite trivial. On deletion, write information about the data you want to send to a separate table (let's say integration request table).

    Then you'll have process reading data from the  integration request table and sending it to CRM. It shouldn't be a part of the transaction deleting the data anywayt, because otherwise your integration would be slowing down business process in AX and a malfunction could render AX unusable, which is not what you want in your mission-critical ERP system.

  • Sukrut Parab Profile Picture
    71,735 Moderator on at

    You can store in table as Martin said , make sure you  designed that table properly with some flag or any other column which will select the correct records needs to be deleted  from other system when you query this table to send data to other system.  

  • @rp@n Profile Picture
    56 on at

    Thanks Martin and Sukrut

    That means , I need to stored data on separate table while user going to delete records from Salesline.

    Then from this table I can send multiple or single  recid's to CRM. Once it's done we can delete those records from this table.

    This table I can use only for passing single or multiple parameters to CRM.

    Is it corect?

    Please give me more shed on this.

    Thanks!

  • Sukrut Parab Profile Picture
    71,735 Moderator on at

    You can either delete records from the table or use a flag to indicate the record has been already sent to other system. Its up to you.

  • Suggested answer
    Khushhal Garg Profile Picture
    1,514 on at

    One option is once all selected lines are deleted from the caller in AX, pass sales order id to CRM and based on your mapping between AX and CRM on sales lines, delete lines from CRM that don't exist in AX for order id passed.

    Second use SalesLineDelete table and lines deleted are stored here if "Mark order as voided" parameter is enabled in AR parameters. Once all selected lines are deleted from AX, this table can be passed or read from CRM based on order id to find out which lines are deleted for an order and delete those lines from CRM.

    In both options, call CRM integration once at the end deletion of all selected lines from caller in AX

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans