Hello,
We have a view with a grid which displays some contacts and in addition there is a button which calls « Send emails » method.
<grid title="Catalog Emails to Contacts" name="catalog-contact-email-grid" model="com.axelor.apps.crm.db.CatalogContactEmail" canNew="false" canEdit="false" canDelete="true" canSave="false">
<toolbar>
<button title="Send Email" name="Send Email" onClick="action-email-catalogs-contacts" showIf="batch != null" />
<button title="Delete All Draft Emails" name="Delete All Draft Emails" onClick="action-delete-all-draft-emails" showIf="batch == null" />
</toolbar>
<field name="contact" />
<field name="catalogLineList" />
<field name="emailStatus" />
</grid>
After opening this view and pressing the button emails are sent correctly, no issue.
But if we try to delete some contacts from the grid using Delete button « Send Email » button no longer works and in addition it breaks Axelor I must press refresh on a browser to reload web page.
I’ve found a work around for this, after deleting the records pressing « Refresh » button (on the right from delete button) fixes this issue, « Send Email » button works.
Another issue is after deletion it shows incorrect number of items in a list (before deletion it showed 1 to 12 of 12) after deleting 5 records its showing 1 to 12 of 7.
- Does anyone know what could cause this issue?
- Is there a way to force a refresh after pressing delete button?
Thanks in advance.