- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2015 05:24 AM
Hello Everyone,
I am facing an issue, I want to redirect URL from one table to another table in Mobile interface.
For example I am trying something like this...
I have list of Approvals from "sysapproval_approver" table in Mobile interface under "My Approvals".
Now, I have created List Buttons to open the records in form view.
Issue is: List of records i.e. RITM's are under "sysapproval_approver" table which has URL something like this:
https://<instance-name>/$m.do#/list/sysapproval_approver/<query>
And I am trying to Redirect it to following URL using action.setRedirectURL(url);
url is used as shown: https://<instance-name>/$m.do#/form/sc_req_item/current.sys_id
Now when I click on button it redirects me to new window but without any data, i.e.its Blank.
Please suggest on same.
Thank You!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2015 11:18 AM
Hi Vineet Kumar, actually, try this code. Disclaimer: It would work for any type of record which needs an approval.
var url = "https://<instance-name>/$m.do#/form/" + sysapproval.sys_class_name + "/" + current.sysapproval;
action.setRedirectURL(url);
This is possible since through the sys_class_name we can refer to the type of table that the reference sysapproval is of.
I hope all this has been helpful . Please let me know if you have any questions.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2015 06:56 AM
Hi Vineet, to which table is your UI Action associated to?
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2015 07:07 AM
Hi Berny,
My UI Action is associated to "sysapproval_approver" table.
And I want it to redirect it to "sc_req_item" table URL using the UI action.
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2015 10:54 AM
Hi Vineet,
Your UI action script should then be something like the following:
var url = "https://<instance-name>/$m.do#/form/sc_req_item/" + current.sysapproval;
action.setRedirectURL(url);
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2015 11:00 AM
Perhaps to provide some further explanation/suggestions:
a) since the table on which your UI action exist is sysapproval_approver, then the context of current is the current sysapproval_approver record. By pointing to the sysapproval you will be able to reference the sc_req_item the approval is for.
b) It's important to highlight that the prior code would only work for approvals for the sc_req_item table. Depending on what you're looking for you could either add a condition so that UI action is only displayed when the record on the sysapproval relates to a sc_req_item or make a small tweak to the previously shared script to make the table name flexible to the one the approval record is for.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2015 11:18 AM
Hi Vineet Kumar, actually, try this code. Disclaimer: It would work for any type of record which needs an approval.
var url = "https://<instance-name>/$m.do#/form/" + sysapproval.sys_class_name + "/" + current.sysapproval;
action.setRedirectURL(url);
This is possible since through the sys_class_name we can refer to the type of table that the reference sysapproval is of.
I hope all this has been helpful . Please let me know if you have any questions.
Thanks,
Berny