Calling global Script Include in a scoped Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 11:40 AM
We brought in moment.js as a global script includes and are trying to access it via a business rule it keeps returning as [Object object].
In our Business rule, we've put in the following:
var x = new global.moment();
gs.addInfoMessage(x);
This returns an info message saying [Object object].
However, when we put in the exact same code in Background Scripts, it returns back as today's date. Any advice?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 01:23 PM
you need to call function in moment script include from your business rule to return any value.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 02:31 PM
how did you define the script include? Did you use classless function for defining moment in the script include?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 05:32 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 06:04 AM