how to copy variable field on catalog task form to another field ?

chercm
Mega Sage

how to copy variable field on catalog task form to another field ?

 

i need to copy select from select a peripheral to the asset field , is it to use business rule ?

1 ACCEPTED SOLUTION

Hi @chercm ,

 

Can you please try the below in your business rule:

current.u_asset = current.request_item.variables.item_requested;

 

If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.

 

Thanks,

Amitoj Wadhera

 

View solution in original post

10 REPLIES 10

Hi @chercm 

 

Your script is wrong.

Line 6 : current.u_asset change to request.u_asset and remove line no 9

 

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

@PrashantLearnIT  not working . i set the BR to before , 

 

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

var request =current.request.getRefRecord();


request.u_asset = current.variables.item_requested;



 
})(current, previous);

Hi @chercm ,

 

Can you please try the below in your business rule:

current.u_asset = current.request_item.variables.item_requested;

 

If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.

 

Thanks,

Amitoj Wadhera

 

@Amitoj Wadhera just to check is it possible to do that that when the stockroom gets changed, if the asset is not in the in stock status, it will clear from the asset box ? Can I limit all these when used in a certain request type like peripheral request ???

chercm
Mega Sage

@Pratima Kalamka @Amitoj Wadhera 

 

i am not getting any result on the asset field 

 

image.png