- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 07:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 07:52 AM
I prefer to use a Display Business Rule and put the property in to a g_scratchpad variable. You can then use it in an onLoad script.
BR:
g_scratchpad.my_property = gs.getProperty('my.property');
CS:
var myProperty = g_scratchpad.my_property
I believe we covered this in episode 5 of TechNow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 12:53 AM
Hi
You need to create client script like this
var ga = new GlideAjax('HelloWorld');
ga.addParam('sysparm_name', 'helloWorld');
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer); }
Script include
var HelloWorld = Class.create();HelloWorld.prototype = Object.extendsObject(AbstractAjaxProcessor, { helloWorld:function() { var property = gs.getProperty(“PropertyName”)return property; } , } });
Mark Correct if this helps.
Warm Regards,
Omkar Mone
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 01:06 AM
Hi Omkar,
Client script is already present and it is a UI page client script.
I have already tried the solution which you have recommended but that asynchronously provides the appropriate response and by then the UI would already be rendered.
I need to know a method where I can fetch the sys_property and then render the content based on that.
Mehtods tried:-
GlideAjax : - responds after the UI is rendered alert for sys_property shows null.
g_scratchpad:- doesn't work (tried writing a on display BR on sys_ui_page table).
getXMLWait():- Does work but not sure whether to use as it is synchronous and may have performance impact.
Regards,
Zabeeulla.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 01:44 AM
Hi
If you want to render the content after the response you have to use Synchronous perspective.
It hampers performance when it takes time to fetch the value from the server.
Use getXMLWait() for the above requirement of your's with a callback function.
Mark correct if it helps.
Warm Regards,
Omkar Mone
www.dxsherpa.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 04:31 AM
Can you explain the business requirement (not the technical requirement).
WHY are you trying to retrieve properties?
What is the functionality you are trying to accomplish?
What does this UI page do (and why)?
It could be that there are other (and possibly better) ways to do what you are a attempting. If you can provide us with some context, we may have other ideas than focusing on specific technical solutions that may lead to issues later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 01:22 AM