Universal request opened_for field mapping from record producer

Tim Grindlay
Kilo Sage

I've created a record producer for a task extended table and have enabled universal request (UR Certified). 

When a record is created from the record producer, I want to map a custom field 'On behalf of' to the UR field 'Opened for'. When transferring from a UR to the task this seems to be done in the direct transfer settings, but how is it done the opposite way? i.e. When the UR is created automatically from the task. Service requests map correctly from requested_for to opened_by but I can't find where.

5 REPLIES 5

Tim Grindlay
Kilo Sage

OK, I sort of have a workaround and learned something new. I know that when my custom task record is being created, the UR is being created at the same time - but I don't really know which one comes first. After some testing, it appears the UR comes first... 

  1. I created a before insert business rule on the universal request table and I could only log a sys_id of the primary ticket (custom task)
  2. I then created a before insert business rule on the custom task table and I can log other details of the UR, like number and opened_for.

In my before insert business rule for my custom task table I discovered I can also set the values of the UR before they're both inserted without a glide record update() call, so it must be happening in the same transaction. I don't really like this solution because it's overriding some other script logic, but at least it works.

So my workaround would be:

 

Business rule

Table: [Custom task table] (Setup for UR)

Advanced: True

When: Before

Insert: True

Condition: Universal Request IS NOT empty

Script:

(function executeRule(current, previous /*null when async*/ ) {

    var ur = current.universal_request.getRefRecord();

    ur.opened_for = current.on_behalf_of;	

})(current, previous);

 

Keen to hear if anyone has any other ideas.

 

User657582
Tera Contributor

Hi Tim,

Apologies, perhaps this is slightly unrelated question, but it seems that you are doing what I am trying to do as well. How were you able to use the UR Certified checkbox? I created my table which extends task, created my service, field mappings, transfer configuration...etc, but the UR certified checkbox keeps unselecting itself every time I save. the record producer configuration. any idea what I might be missing?

 

thank you in advance!

Hi User657582,

Here's what I found. There is a business rule on the sc_cat_item_producer table called Allow UR creation for compatible service. It calls the isServiceConfiguredForTable in the UniversalRequestUtilsSNC script include. This just checks whether there is an entry in the universal_request_service_conf table for the table you are trying to setup UR for.

You can get to this table by going to Universal Request > Administration > Service Configuration

Take a look and see if you have an entry there for your new table.

Thank you for the Quick reply. yeah the configuration exists, along with field mapping and such. all configurations are done in the custom app scope as well. I reviewed that script include as well and did not see anything aside from what you mentioned.