
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 08:01 AM
Hello,
On the contract form have 3 fields. Contract end date should be calculated based on Contract start date + duration months. I created a client script and a script include but somehow I always get "null".
I work in scope, but both client script and script include are created in scope.
e.g.
Contract start date: 2022-01-01
Duration months: 12
Contract end date: should be 2022-12-31
My client script:
My script include:
My log from script include returns the correct answer:
My info message from client script returns null:
What am I missing?
Thank you,
Elena
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 09:13 PM
Hi,
Your script include is in Service Module Integration scope so the API name should not start with global.
Can you try creating a fresh script include in your scope and verify this
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 08:33 AM
Check this
1) the script include API name should not be global. since it is not in global scope; it's in Service Module Integration scope the scope name would be different
2) try to add gs.info() to debug in the script include function; gs.log() will break the code in scoped app
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 10:04 AM
1) the API name of the script include is: global.AddendumCalculation
2) used gs.info, but the answer is still null 😞
Am I missing something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 09:13 PM
Hi,
Your script include is in Service Module Integration scope so the API name should not start with global.
Can you try creating a fresh script include in your scope and verify this
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2023 01:18 AM
any update to this one?
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader