Javascript

developersn
Tera Contributor

One variable - business_unit(Choice- X,Y,Z,A,B,C)

Another variable- impacted_business_unit (reference to business_unit variable)

 

Requirement : To map the impacted_business_value for all the records(1000s) with below mentioned conditions :

1. All the records with choice X & Y Selected in Impacted business unit, it should be changed to Choice A.

2. All the records with choice Z & C selected in Impacted business unit, it should be changed to Choice B.

 

Any help on this would be highly appreciated.

 

 

 

 

1 ACCEPTED SOLUTION

Hi @developersn

Please confirm if that business_unit & impacted_business_unit both are mapped in some custom table or its just value in record table like incident.

 

If this mapping is already configured in some table ( either system table or custom ) then go with fix script code, here some of our friends already shared the code snippet logic try that. 

In case, you have any issue please share the mapping table details and fix script code you are writing so we can debug the issue.

 

Suggestion : Code the fix script and run it for few record only , once test pass then go for all records. 

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

View solution in original post

6 REPLIES 6

AshishKM
Kilo Patron
Kilo Patron

Hi @developersn,

You can update the business_unit value from X & Y to A ( and Z & C to B ) , to all impacted_business_unit record in the table.

Please check the table columns, business_unit and  impacted_business_unit, first filter the records with business_unit =  X Or Y, once you have result you can change the business unit value to A. Repeat the same for Z & C.

In the list view, you can update 100 records in one go, you can use "Update Selected" or "Update All" option for bulk update. 

Let us know if there is any other challenges with this update at your end.

 

AshishKMishra_0-1697651697277.png

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

developersn
Tera Contributor

Hi @ AshishKMishra,

Thanks for the response.

 

Actually we are looking for a solution with script as this update requires to be done on multiple tables. Kindly suggest.

 

Thanks

Hi @developersn ,

 

The logic for the script should be somewhat like this 

 

    // Check if business_unit is X or Y, then set impacted_business_unit to A

    if (current.business_unit == 'x' || current.business_unit == 'y') {

        current.impacted_business_unit = 'a';

    }

    // Check if business_unit is Z or C, then set impacted_business_unit to B

    else if (current.business_unit == 'z' || current.business_unit == 'c') {

        current.impacted_business_unit = 'b';

    }

 

If u r running a fix script add this logic in there n try once.

 

Thanks,

Danish

 

Hi @developersn

Please confirm if that business_unit & impacted_business_unit both are mapped in some custom table or its just value in record table like incident.

 

If this mapping is already configured in some table ( either system table or custom ) then go with fix script code, here some of our friends already shared the code snippet logic try that. 

In case, you have any issue please share the mapping table details and fix script code you are writing so we can debug the issue.

 

Suggestion : Code the fix script and run it for few record only , once test pass then go for all records. 

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution