The CreatorCon Call for Content is officially open! Get started here.

Funktion for StartEndDateValidation not working in Service Operations Workspace and CSM Workspace

nherm
Tera Expert

Hello together,

this post describes the way how to validate the start and end date. https://www.servicenow.com/community/developer-articles/two-quick-steps-to-achieve-end-date-after-st...

I tried this for change_task table. Additional to (out of the box) existing Client scripts I added the 3 new one for change_task with the same code like the existing for change_request (because the field names are the same). 

nherm_4-1706622692046.png

 

My problem is, that in classic view everthing looks good, also when I open the view for SOW and Workspace via Classiv view.

nherm_0-1706622367603.png

nherm_1-1706622396508.png

 

 

But when I switch to the real SOW  and Workspace view, I dont get any messages when my end date is before the start date. 

nherm_2-1706622437449.png 

nherm_3-1706622453092.png

 

 

Does someone have an idea, why? 

Best regards Nicole

1 ACCEPTED SOLUTION

Hello Mark,

it was only in my PDI, I didnt delete something in our dev/prod system 😉 But thanks for the hint. 

In the meantime, I found another solution and code. I only use now one Client script. The OOTB Client script and UI Script I switched back to original one. Message was created in sys_ui_message table as well. Thanks and best regards Nicole

nherm_0-1706775738524.png

 

View solution in original post

4 REPLIES 4

Mark Manders
Mega Patron

Do you have your 'isolate script'field on the client script set to true?

Is UI type set to 'all'?

Is global set to true?

 

If all of this doesn't help, can you share your script?

 


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

nherm
Tera Expert

Hello Mark,

thanks for the info and for your help. I tried it, but in SOW and CSM Workspace nothing happened 😞 

I have the following scripts:

UI Script (was OOTB already there). I deleted the old UI Script and created a new one with UI Type "All"

nherm_0-1706686884736.png

 

Client Script "Date Validation Load" was OOTB already there. I deleted the old Client Script and created a new one with UI Type "All"

nherm_1-1706686968798.png

 

3 Client Scripts which I created new, now with all this points what you mentioned.

"BASActual Start date onChange validation"

nherm_2-1706687096503.png

 

"BAS Actual End Date onChange validation"

nherm_3-1706687148742.png

 

"BAS Actual Start/End Dates Validation"

nherm_4-1706687187094.png

 

Best regards Nicole

Mark Manders
Mega Patron

You deleted old scripts and added new ones? That can get you into some trouble when in an upgrade the scripts get reintroduced. Best practice is to adjust the OOB script(s) so any change by an upgrade can be validated. Old best practice can also be used: inactivate old scripts and create new ones.

Can you undelete the OOB scripts to see if they worked or not? If this has something to do with the workspaces, you can go to ServiceNow is OOB objects don't work (because that would also explain why yours don't work while they are the same). 


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

Hello Mark,

it was only in my PDI, I didnt delete something in our dev/prod system 😉 But thanks for the hint. 

In the meantime, I found another solution and code. I only use now one Client script. The OOTB Client script and UI Script I switched back to original one. Message was created in sys_ui_message table as well. Thanks and best regards Nicole

nherm_0-1706775738524.png