Delete entry in a sub pannel, not available since suiteCRM 8

Hello there,

Finally migrating to SuiteCRM8.
PHP 8.2
Suite CRM 8.7.0

Im trying to know if there is any way to re implement the delete button on a subpannel entry?
Now the button only unlink the entry, but I want to delete completely a Note attached to an Account.

Tried to force the /custom/modules/Notes/metadata/subpanels/Account_subpanel_accounts_notes_1.php
And add the delete_button like in suiteCRM 7, but it do nothing.
Now it’s remove_button, that is used to unlink.

Will I need to re code this myself or there is a tip to have it back ?

Have a wonderfull day!

I believe that even in v7, the buttons in subpanels usually unlink records instead of deleting them. In other words: they delete the relationship, but not the target record itself.

In order to create a real “delete” button i na subpanel, you would need to do it the v8 way, changing metadata by injecting the differences into the configuration.

See SuiteCRM Developer Insights - Adding Bulk Actions for an example with List views actions. If you examine the metadata getting sent when doing a full screen refresh on a Record view, you can see the similar things done for subpanel actions.

Hopefully the back-end action already exists (if you can figure out what it’s called) and so you would be able to have the button just call existing code.

1 Like

No there was a real delete button in sub pannel in V7.
Calling on click javascript:sub_p_del(‘leads_notes_1’, ‘Notes’, ‘27f73b37-34f1-3ef7-a194-673dc7c87c45’, 0);

For a note linked to a lead. And it actually delete the note, not the relationship.

If you go in the studio in V7, to a sub pannel you have two delete/remove buttons.

  • [delete_button]
  • [remove_button]

One delete the entry, the other remove the relationship.

Tried to force in studio or via code to have both, sadly now only remove_button actually display something.

For everyone having the same need :

This could work, just need to customize aswell the icon to like a trash bin or something than make more sense that this unlink icon

When I found the time to do it I’ll paste my code here :slight_smile: