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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Command button (DeleteRecord) for a grid deletes other datasource record

(0) ShareShare
ReportReport
Posted on by 1,244

Hi,

I have a command button (of command DeleteRecord) in a form's button group control. The datasource selected on that button group, and all it's parent form controls is PurchReqLine.

I also have PurchReqTable as one of the datasources.

The JoinSource on the PurchReqLine datasource is PurchReqTable (LinkType: InnerJoin).

Whenever I select a record in the PurchReqLine and hit the Remove button, it deleted record from PurchReqTable.

Is there anything wrong?

Regards,

Abhinay

I have the same question (0)
  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Does it delete ONLY the PurchReqTable? Or also PurchReqLine?

    Also please double check that all the parent controls of the CommandButton are really pointing to PurchReqLine.

    If you still have the issue, perhaps you could share some screenshots of your form design, and this button.

  • Abhinay Tharwal Profile Picture
    1,244 on at

    Hi Nikolaos,

    Thank you for your reply!

    The PurchReqTable has the delete action which deletes the relevant records from the PurchReqLine table.

    I put a break-point on the delete() method of both the datasources, the PurchReqTable's DS gets executed first.

    Best regards,

    Abhinay

  • Sukrut Parab Profile Picture
    71,741 Moderator on at

    You must have highlighted header receive record and hit remove that's why header got removed and the addosiated lines. If that is not the case  , please check if you have modification which is causing this.

  • Abhinay Tharwal Profile Picture
    1,244 on at

    Hi Sukrut,

    Thank you for your reply.

    The expected behavior is that, the datasource specified on the button group should be referred to for the actions of a command button.

    A form grid will always have a record in selection.

    The record selected in the PurchReqTable should not matter when the datasource specified on the button group is PurchReqLine.

    Regards,

    Abhinay

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Hi Abhinay,

    if you still have the issue, could you provide the information that I requested previously?

  • Abhinay Tharwal Profile Picture
    1,244 on at

    Hi Nikolaos,

    Sorry, I cannot share any screenshots here because of the non disclosure clauses. But please take my word that the datasources selected are correct.

    The behavior changes when I remove the JoinSource of PurchReqLine, and only the expected records get deleted.

    That means the datasources selected are correct.

    Regards,

    Abhinay

  • Verified answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    If I'm looking at some standard header-lines forms such as SalesTable, the Link Type of the line data source is "Delayed", not "InnerJoin".

    Does it work if you change the link type to Delayed?

  • Abhinay Tharwal Profile Picture
    1,244 on at

    Hi Nikolaos,

    I will try that and update you.

    Regards,

    Abhinay

  • Abhinay Tharwal Profile Picture
    1,244 on at

    Hi Nikolaos,

    The JoinSource property should be set to 'Delayed' to avoid this situation.

    I would have to figure out another way to achieve this, as I need the JoinSource to InnerJoin.

    Thanks!

    Regards,

    Abhinay

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Hi, why do you need it to be InnerJoin?

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 566 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 504 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 429

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans