Why the request for field is populated with the current login user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 04:27 AM
When I created a new catalog item request, the request for field of the sc_request table is populated automatically with the current login user instead of the taking the value from the request for variable. How can I make sure that this field will populate automatically with the request for variable from the catalog item. Again, Im talking about sc_request table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 05:27 AM
I have noticed in my PDI, default value for "requested_for" variable has set to loggedIn user, so it has came from there
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 05:27 AM
@Alon Grod This is happing due to the default value on requested for field you can check this reference
To set the requested for field from the catalog variable you can onbefore business rule hope this link can help you
Please mark the answer correct/helpful based on Impact.
Regards,
RJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 05:33 AM
@Rahul RJ hi, i double checked and there is no default value on this field. I tried to create on before insert BR on the sc_request table and now when submitting a request using catalog item the requested for field is not populated at all (empty). Before the BR it was populated with current login user.
what am I doing wrong?
(function executeRule(current, previous /*null when async*/) {
// Get the requested for variable value from the catalog item request
var requestedFor = current.variables.requested_for;
// Populate the requested for field on the sc_request table with the requested for variable value
current.requested_for = requestedFor;
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 05:33 AM