Need to update location field in Asset table as per the To stockroom enter in transfer_order table.

Prasnajeet1
Giga Guru

Hi All

Need your support in the scripting for the below mentioned requirement.

For example: User has created a record in transfer order table like "From Stockroom =A" and "To Stockroom=B". Now an entry got created in alm_transfer_order_line table and also a "Ship task" got created. When user closed this ship task then Asset state gets change to "In Transit" in alm_hardware_table. Now my requirement is when Asset state is "In Transit" in alm_hardware table then I also need to update the "Location" field in the alm_hardware table as per the "To Stockroom" value from transfer order table. In this case user has enter the "to Stockroom" value as 'B' so my script should update the location field value as 'B' in the alm_hardware table when the assdet state is "In Transit".

 

Please help me in the script part and logic please.

Thank you in advanced. Please support.

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Prasnajeet1 

it's very difficult to understand without any screenshots.

Also share scripts you started with and where are you stuck?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur

Let me try to clear the requirement. 

For Example:

Step1: in alm_transfer_order table user has created a entry where he filled "from_stockroom" value as 'ABC' and "To Stockroom" value as 'XYZ'.

Step2: After that another entry created in alm_transfer_order_line table and a task got created in alm_transfer_order_line_task table.

Step3: Now when user close this task, in the alm_hardware table "state" field value update to "in Transit"

Step4: Main requirement: When asset state update to "in transit", in the same alm_hardware table one more field is there called "location". In this location field , I have to populate the "To stockroom" value which is 'XYZ'. 

Hope I am able to explain it. I am trying with the script but nothing is working for me. So looking for help.

Below is the screen shot.

Step1, Entry created in Transfer order table

Prasnajeet1_0-1691499442840.png

Task closed:

Prasnajeet1_1-1691499507252.png

Once task closed, asset state moved to "in transit" and I need to update location in alm_hardware table.

Prasnajeet1_2-1691499715959.png

 

 

@Prasnajeet1

So unless you share your scripts it's difficult to help you

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader