Scripting with catalog variables on tasks (sc_item_option_mtom) table

nmartinez
Kilo Contributor

I am familiar with accessing [sc_item_option] and [sc_item_option_mtom] to query, modify and even create new catalog variables for request items via scripting; however I am trying to figure out how to associate catalog variables with newly created catalog tasks via scripting in the same fashion that it is done via the visual workflow.

I assume that there must be a related table that connects the catalog variables to the catalog task and then not unlike [sc_item_option_mtom] that would reference the catalog task's sys_id and the [sc_item_option] record. If there is such a table it does not have the "mtom" in the table's name. My second guess was that it would be either a script include or a business rule that is dynamically associating the variables to the catalog tasks. However I've yet to find any scripts that perform this function.

If anyone knows how to accomplish this, I would appreciate some help.

23 REPLIES 23

TJW2
Mega Guru

I'm assuming you are using UI Policies to show/hide the variables required on the Catalog Item. Just a shot in the dark; have you tried using your UI Policies to do this for you? Check the 'Applies on Catalog Tasks' checkbox.


nmartinez
Kilo Contributor

Well, I am a difficult person... 🙂

We're not using UI Policies for this Request Item, because as far as I know/remember you can't build UI polices from changes made to a slush bucket.

I imagine I could use the ture/false script function from within a UI policy, but after reviewing that section I am not seeing the "Applies on Catalog Tasks" checkbox in the UI Policy.


What release are you on? This functionality is available in Calgary. Have you check to see if the field just isn't displayed on the screen.

I am suggesting using a UI Policy on the 'variables' that need to be 'hidden/shown' NOT the slushbucket of variables.

You can use a UI Policy on slushbucket by using 'Variable name CONTAINS sys_id of value'


nmartinez
Kilo Contributor

Yeah, I did check to see if that field just wasn't being displayed. Calgary, it figures.. 🙂

We're still on Berlin. We're not moving into Calgary until they fix a few more issues on the Catalog. From what I've heard the issues we need fixed will be in Patch 4.


You are back to using a Client Script on the 'sc_req_item/sc_task' to hide the variables you don't want to see 😞

Calgary Patch 4 will be out soon 🙂