Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Calling UI Macro from client script in Scoped Application

Bala19
Tera Contributor

Hello All,

 Does anyone now how to call the UI macro from catalog client scripts in scoped application?

I see somewhere ref_contributions has to be added. But not sure how to add the same?

UI Macro 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<html>
<head>
<script>
function checkDetails()
{
alert('Hello');
}
</script>
</head>
</html>
</j:jelly>

Catalog client Script

 

function onLoad() {
 checkDetails();

}

Thanks

Bala

 

9 REPLIES 9

I will try and keep posted

Bala19
Tera Contributor

Nothing working out. Could you please anyone elaborate bit? it is very critical. thanks

Harsh Vardhan
Giga Patron

may i know why do you want to call UI Macro in client script ?

if you have some client side scripts defined in UI Macro and for that purpose you are calling your UI Macro in client script then i would suggest , write the code in UI Script and then call it in your client script. 

Please share your business need. 

Bala19
Tera Contributor

Hello,

Thank you for the response. I have a date/time picker in my application(scoped application). Actually it shows the time in GMT. But server runs in pacific time. I have to reset the date/time picker to show them time in Pacific. So I am trying to reset this. But unfortunately I couldn't succeed as many options not available in scoped application. So though I call it from client to macro to update the same. I am not sure whether some other options are available

 

thank you

Hello Bala,

 

did u get the solution for this, i have the same query.

Any suggestions are highly appreciated!!!

 

Thanks,

Prerana