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.

UI Macro Debug

sai krishna10
Giga Guru

Hi,

 

I used this line in my ui macro <g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" />

I want to debug it and want to know which value will store in the variable var, Can anyone tell me how to debug UI Macros.

 

Thanks,

1 ACCEPTED SOLUTION

here you go.

 

what i had done now. i have created on ui macro and defined the one jvar into the break point to check the log.

 

UI Macro:

 

find_real_file.png

 

now the question is how did you invoke your ui macros, for me i just called it in my ui page

so for this i randomly created on ui page:

UI Page:

 

find_real_file.png

 

 

once you click on "Try It" on the ui page then scroll down and try to search "BreakPoint tag start". refer the screenshot below that i had searched and found.

 

find_real_file.png

 

 

 

Note: enable all the session debug.

 

hope it will help you now. 

View solution in original post

9 REPLIES 9

I tried it but i didnt see the breakpoint and its variable there... I found lot of unwanted stuff.

here you go.

 

what i had done now. i have created on ui macro and defined the one jvar into the break point to check the log.

 

UI Macro:

 

find_real_file.png

 

now the question is how did you invoke your ui macros, for me i just called it in my ui page

so for this i randomly created on ui page:

UI Page:

 

find_real_file.png

 

 

once you click on "Try It" on the ui page then scroll down and try to search "BreakPoint tag start". refer the screenshot below that i had searched and found.

 

find_real_file.png

 

 

 

Note: enable all the session debug.

 

hope it will help you now. 

Hi

But here i am using OOB UI Macro on caller field in incident table.

<g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" />

 

What this GUID Will generate in my case. I found that i will give the sys_id but i which sys_id it is giving.

 

gs.generateGUID() is used to generate unique sysid.

once it get generated you can use it to perform other task for example creating a record through this.

for eg: you can refer this thread.

 

https://community.servicenow.com/community?id=community_question&sys_id=df20d7e5dbdcdbc01dcaf3231f96...

 

 

 

sai krishna10
Giga Guru

Is there anyway to print that variable anywhere either in console or in html like that.. for dubugging easy