- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 09:10 AM
I have a reference field (Request Submitted For (u_request_submitted_for)) on a catalog item, and I'd like to populate a Request Submitted For (u_request_submitted_for) field on the RITM with the value that team members put in on the catalog item. I've tried a few things to make this happen, but nothing seems to work. It will work if I want to take the reference field on the catalog item and map it to a string field on the RITM, but it does not work to map it to a reference field on the RITM.
We'd like to use the reference field so that we can run a report that says, Request Submitted By (requested_for) "Pivec, Richelle" or Request Submitted For (u_request_submitted_for) "Pivec, Richelle." Using a text field would technically work for reporting but it would confuse our team members as to why they are different field types. (Of course the catalog automatically puts in the Requested Submitted By (requested_for) value, but that comes from the Catalog itself and is not inside the catalog item.
Is this something that can even be done? I am beginning to suspect that one cannot write a reference field on a catalog item to a reference field on an RITM...
Thanks,
Richelle
Solved! Go to Solution.
- 3,808 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 11:28 AM
I see your issue ... You have them switched where you are trying to set the values.
Your script
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (current.variables.RequestSubmitted != "")
current.RequestSubmitted = current.variables.u_request_submitted_for.toString();
})(current, previous);
What should work
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (current.variables.RequestSubmitted != "")
current.u_request_submitted_for = current.variables.RequestSubmitted.toString();
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 10:46 AM
Think you have issues with the names of things. Can you send me a screenshot of the variable on the catalog item, and a screenshot of the dictionary record for the field on the RITM? Then I can adjust the script to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 10:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 11:28 AM
I see your issue ... You have them switched where you are trying to set the values.
Your script
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (current.variables.RequestSubmitted != "")
current.RequestSubmitted = current.variables.u_request_submitted_for.toString();
})(current, previous);
What should work
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (current.variables.RequestSubmitted != "")
current.u_request_submitted_for = current.variables.RequestSubmitted.toString();
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 11:38 AM
Yes! That worked.
Thank you so much!
Richelle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 10:56 AM
I did have them named the same thing in both places, but it started confusing me so I made the catalog item different. However, when I tried the straight up "Map to Field" option, the names were matching.
Thanks,
Richelle