pegros / PEG_LIST

Set of configurable/actionable LWC list components for Salesforce Lightning UX
MIT License
20 stars 8 forks source link

sfpegListCmp - Refresh Treegrid after record create or update with standard__objectPage #73

Open Ceabhar opened 3 weeks ago

Ceabhar commented 3 weeks ago

Describe the bug Creating a record doesn´t refresh the Treegrid table.

To Reproduce Steps to reproduce the behavior:

  1. Set an action type "standardobjectPage" on metadata sfpegActionmdt: { "name": "new", "label": "Nuevo", "iconName": "utility:new", "action": { "type": "navigation", "params": { "type": "standard__objectPage", "attributes": { "objectApiName": "ShareHolder__c", "actionName": "new" }, "state": { "defaultFieldValues": "Account__c={{{RCD.Id}}}", "nooverride": "1", "useRecordTypeCheck": "1", "navigationLocation": "RELATED_LIST" }, "next": {"type": "done","params": {"type": "refresh"} } } } }
  2. Create new record
  3. The record is created but not shown on Treegird (until manual Refresh)

Expected behavior Record is created and visible on Treegrid

pegros commented 3 weeks ago

@Ceabhar this is unfortunately not a bug but rather a limitation due to the fact that the action is a navigation one even if a popup is displayed. In your configuration, the refresh is triggered upon opening of the standard creation popup. For the time being, I did not find a way to detect the actual save from the standard popup. Usually, I use a LDS form creation action instead for which the refresh may be triggered after the actual save as the popup is managed by the PEG_LIST framework. Beware to where you locate the "next" property in the JSON in such a case as this will trigger the next action upon opening of the form popup or upon actual save.

pegros commented 3 weeks ago

What I might propose as a workaround is to give the option to open the standard object layout in the ldsForm action instead of having to list all fields in the configuration. I might include a recordType selection step upon creation as in the standard page.

Ceabhar commented 2 weeks ago

What I might propose as a workaround is to give the option to open the standard object layout in the ldsForm action instead of having to list all fields in the configuration. I might include a recordType selection step upon creation as in the standard page.

@pegros Thanks for the quick answer. I did some tests and reread the documentation but I couldn´t use ldsform+standart object layout. Is this feature available?

pegros commented 3 days ago

@Ceabhar My apologies for my slow answer: currently displaying the standard object layout is not supported but I shall include this feature ASAP.

Ceabhar commented 3 days ago

My apologies for my slow answer: currently displaying the standard object layout is not supported but I shall include this feature ASAP.

Hi, thanks for your answer. As workaround I set 1 button (LDSform create) for each recordType. The downside is that Edit option should be removed (showing a 1 button for each recordType and User choosing the correct one was too risky).

thanks for you help!