declarative actions make visible on SOW workspace

irfan_fedserv
Tera Contributor

Hi all , 

I am trying to make a declarative action available on sow workspace for some RITMS , 
sc_req_items with item is 'cat item' and when state is 'work in progress' , 
when clicked on the action , user should be able to make the state change to awaiting response .
The configurations i have done is as below ;
1. Created a declarative action

irfan_fedserv_0-1792923106940.png

Client script : "

function onClick() {

    var comments = g_form.getValue('additional_comments');

    if (!comments) {
        g_form.addErrorMessage('Please enter Awaiting employee response comments');
        return;
    }

    g_form.setValue('state', 9);
    g_form.save();
}"
irfan_fedserv_1-1792923166322.png


2. Then , i go to ux form action layout of 'sc_req_item' and added it in there.

irfan_fedserv_2-1792923274693.png

But the action is not visible in workspace . 
What is the structured steps to make a declarative action available on workspace.?
Did i miss something ?
Any help would be appreciated .

1 ACCEPTED SOLUTION

irfan_fedserv
Tera Contributor

Hi @Aditya_hublikar @Shaik Dimple @Tejas Adhalrao , 

Thank you for replying.  The problem was not with the script or layout configuration , It was the view selected in declarative action. when i disabled it , The action worked fine .

View solution in original post

4 REPLIES 4

Tejas Adhalrao
Mega Sage

hi @irfan_fedserv ,

Please open UI Builder and navigate to the SOW Workspace list page. Select the List component and check whether Enable declarative actions is enabled in its properties.

 

If it is disabled, enable it and save or publish the changes. Then check whether your declarative action is visible in the workspace.

Also, make sure the action conditions and the UX Form Action Layout configuration are correct for the RITM records.

 

Regards, Tejas

Aditya_hublikar
Giga Sage

Hello @irfan_fedserv ,

 

Have you configured action configuration as SOW Action to see that Declarative action for form level .

Aditya_hublikar_0-1792943671613.png

 

Then it will visible on form .

Aditya_hublikar_1-1792943759904.png

  As per my understanding you cant directly access comments on client side by directly using g_form.getValue('additional_comments') because whenever you post comment it will stored on sys_journal_field table directly . There is element_id field  on sys_journal_field table which can indicate which comment is of which record by that record sys_id . so check this once .

 

If this helps you then mark it as helpful and accept as solution .

Regards,

Aditya

Shaik Dimple
Kilo Sage
 

Hi @irfan_fedserv ,

 

I tried the same script on my PDI and the button showed up fine, so the issue is likely in the configuration, not the script. Only change needed is "additional_comments" → "comments".

ShaikDimple_0-1792949655820.pngShaikDimple_1-1792949699945.png

 

 

For visibility, try removing the cat item condition and keep only State is Work in Progress. If the button shows, the issue is in that item condition.

 

Note that g_form.getValue('comments') only returns the text before you post it, so the agent has to type the comment and click the action without hitting Post Comments.

 

Attaching my test result for reference. If this helps, please mark it helpful😊.

 

Thanks

Dimple Shaik

 

irfan_fedserv
Tera Contributor

Hi @Aditya_hublikar @Shaik Dimple @Tejas Adhalrao , 

Thank you for replying.  The problem was not with the script or layout configuration , It was the view selected in declarative action. when i disabled it , The action worked fine .