How to populate a catalog variable value in the sc_task customize field

Prasnajeet1
Giga Guru

Hi Team

I have catalog item "Hardware" and in that there is field variable called "Asset Type". "Asset Type" holds different type of value called Laptop, desktop, Macbook etc. I have created customized field "u_asset_type" in the sc_task. Now I want to populate the Asset ype varible value in the "u_asset_type".

 

For that I have written a before BR on insert and update.

current.u_asset_type = current.variables.asset_type;
 
However this is not working. Can someone please help to populate the variable value in the customized field of sc_task at the time of task creation only. Please let me know what are the correction i need to do to achieve this requiement.
3 REPLIES 3

Mark Manders
Mega Patron

Are the choices of the same value? What kind of field is 'u_asset_type'? What does 'current.variables.asset_type' return when you log it? Are you sure the variable is also on the sc_task table and not on a different table? 

Why not handle it in the (work)flow processing this catalog item?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Asset type variable is a dop down field where as u_asset_type is a string value. I have to show only one value so i have created like that.

hat does 'current.variables.asset_type' return when you log it?  - - - - -Not sure

re you sure the variable is also on the sc_task table and not on a different table?  - - - Variable value i can it in the sc_task but variable values i guess it store in a different table.

Why not handle it in the (work)flow processing this catalog item? - - - I tried to map this in the flow design but it is not happening.

 

The start of your answer is in logging the value, to see what it returns. If there is no 'current.variables....' you will need to get it from the RITM. I think, since you can't do it in the flow, nor in through the BR, your variable is either not there, or you can't map the choice value to the string value. 

 

Maybe also put a log in your BR to check what current.variable.asset_type.getDisplayValue()

returns


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark