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

Harsh Vardhan
Giga Patron

SagarTajane
Kilo Expert

Hello 

 

This link may helpful :

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

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

 

Using <g:breakpoint /> throws out a lot of variables, beyond the ones you are creating. Of course you can fine tune what variable you are looking for by writing it as <g:breakpoint var="[variable_name_comes_here" />. This can go anywhere in the UI Macro as long as it is after the variable declaration.

For example:

 

<j:set var="jvar_testVariable" value="${gs.hasRole('admin')}" />

 

<g:breakpoint var="jvar_testVariable" />

 

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.

 

Thanks
Sagar Tajane

sai krishna10
Giga Guru

I refered it previously and added <g:breakpoint var="jvar_testVariable" /> but i didn't understand below line.

To see the output you would, of course, need to enable Session Debug > Debug Log (or look at the logs, but I prefer session debug) and you will get output that looks something like this:

 

i didnt get any data after clicking on debug log.

Hello,

 

If you scroll down the page , you can see this kind output. there you can see your logs output.

 

 

 

find_real_file.png