We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Resource assignment is deleted after resource is assigned

Gaspar Fiks
Tera Expert

Hello Community! 

At the moment a Resource Assignment is assigned to a Resource, it is deleted, and a new one is created within the same Resource Plan. I think this is expected to happen because on the resource plan form we can see the logs like this: 

GasparFiks_0-1764168517288.png

 

I am now having a problem; I have some custom fields on the Resource Assignment form and when the new one is created, is not getting the field values from the original RA. 

 

GasparFiks_1-1764168727980.png

 


Can you please help me finding where is the background logic of this and how to fix it? 

Thank you all! 

 

1 ACCEPTED SOLUTION

Hello Gaspar, 

 

ResourceBoardActionServiceSNC is protected, but you should use the extended script: ResourceBoardActionService. In this script you have to add the full function "_getFieldValueMap" and modify it with the line I mentioned before.

Good luck!

View solution in original post

5 REPLIES 5

PatriciaM485071
Tera Guru

Hello Gaspar, 

 

To populate the new Resource Assignment, ServiceNow is using the function "_getFieldValueMap" in the script "ResourceBoardActionServiceSNC".

 

You will need to override this function in the script "ResourceBoardActionService" and then add the following just before the return of the function:

fieldValueMap[<custom_field_name>] = this.asmtGr.getValue(<custom_field_name>);

This is not the best approach as you need to customise the script, but I didn't find any other way. I hope ServiceNow can include this as a configuration in the future 🙂

 

Hi Patricia, thank you so much for your answer. I'll need to request ServiceNow to open the record since it's a protected one, and after that I'll try your suggestion. Thanks a lot in advance!

Hello Gaspar, 

 

ResourceBoardActionServiceSNC is protected, but you should use the extended script: ResourceBoardActionService. In this script you have to add the full function "_getFieldValueMap" and modify it with the line I mentioned before.

Good luck!

Thank you SO much @PatriciaM485071 !!! This is perfectly working!