On clicking a approval button on the form approval form, newly created record should open on the approval Form.

Community Alums
Not applicable

I have a form that creates a Business Application , on submitting the form it actually creates a Request item for the approval , as we have a list of approvers in the Requested Item, on selecting a one approver it takes to the approval form , when we click the approve button in the approval form it should redirect to  the newly created business application form.

Kindly help me with this Requirement.

1 ACCEPTED SOLUTION

Mahendra RC
Mega Sage

Hello Prakash,

As far as I understood your requirement a request is submitted to create a Business application and once the request is submitted, RITM will be created with some approvals on it. When your asked to when some approver opens the approval record to approve the RITM, they click on Approve button on sysapproval_approver table and the RITM is approved. Now once it is approved by clicking on Approve button, the Approve button should redirect to newly created Business Application.

Your business application is created from the Flow that you have created. If that is the case then I believe this is not possible to implement because there is no relationship between the Business Application record and sysapproval_approver table. Also when you click on the Approve button the flow will take say 500ms or 1 second so in this case how the Approve button script will identify if the Business Application is created or not

Please mark my respsone as helpful/correct, if it answer your question.

Thanks

View solution in original post

18 REPLIES 18

Yousaf
Giga Sage

Hi Prakash,

Please find that UI action and add this line and try

action.setRedirectURL(url);
     
  As part of a UI action, you may want to redirect a user to a URL. For example, you might add links to a form or open a new record after it is created from a UI action.
        To redirect a user to a URL from a UI action, use this syntax to define the redirect link:

action.setRedirectURL('http://www.mysite.com/mypage.htm');

        To direct a user to a record, use this syntax, where new_record is the variable name for the GlideRecord:action.setRedirectURL(new_record);

 

Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***

Community Alums
Not applicable

Hi Yousaf,

Thanks for responding .

Yeah I should pass the Business application table URL in the action.setRedirectURL() method but what exactly has to be passed when it should redirect to the newly created Business application form that actually creates on clicking the Approve Button? 

when you create gr.insert() gives you the newly created record so pass it inside the action.setRedirectURL();
I assume the new business application is being created from within the UI action script
If not, then please let me know from where its being generated

 


***Mark Correct or Helpful if it helps.***

Community Alums
Not applicable

Hi Yousaf,

New Business application is not created within the UI action Script.

We have a Work flow in which

1. when the approval action( Marked as Approved) is reached the flow goes to Create Event(Notification to App Owner) and then it goes to Run Script( Create Business application) 

2. It looks thats where a Business application is created .

Now this gives more clarity on the Requirement , Please help me to redirect to new business app form as soon as approve button is clicked