PEG_LIST icon indicating copy to clipboard operation
PEG_LIST copied to clipboard

sfpegListCmp - Refresh Treegrid after record create or update with standard__objectPage

Open Ceabhar opened this issue 1 year ago • 6 comments

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

To Reproduce Steps to reproduce the behavior:

  1. Set an action type "standard__objectPage" on metadata sfpegAction__mdt: { "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

Ceabhar avatar Jun 12 '24 01:06 Ceabhar

@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 avatar Jun 13 '24 07:06 pegros

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 avatar Jun 13 '24 07:06 pegros

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?

Ceabhar avatar Jun 20 '24 03:06 Ceabhar

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

pegros avatar Jul 01 '24 14:07 pegros

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!

Ceabhar avatar Jul 01 '24 14:07 Ceabhar

My apologies @Ceabhar for the latency. I am currently pretty busy on my DSFR_LWR repository. I shall implement the dsform+standard object layout capability ASAP.

pegros avatar Jul 25 '24 10:07 pegros