
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2017 12:04 PM
I need to write an onLoad Client script that checks if the parent field starts with a 3 letter prefix of "CUS". I have not has much success with this can someone show me how this would be written?
Thanks,
Edwin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2017 12:20 PM
Okay... sounds like a UI Policy to flick the visibility of the related list may do the trick... provided you can dot-walk to the parent field.
I may have a play with this to see if the parent field is accessible.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2017 12:11 PM
Startwith does not work in client script.
You have to get the value using getValue and then check the string start with "CUS" using match function (Javascript)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2017 12:30 PM
Hi Edwin,
You can try like this:-
var a=g_form.getValue('field name');
if(a.startsWith('CUS'))
{
you code.......
}
else
{
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2017 12:14 PM
I need to write an onLoad Client script
Does it need to be a Client Script?
What's the end objective? If it meets this criteria... what then?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2017 12:16 PM
If the parent field starts with 'CUS' then I need to show a certain related list, otherwise I need to hide that related list.