Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

"g_form" not defined - UI action to generate PDF

lightblu
Mega Expert

Hi,

I am trying to make a UI action which generates a PDF out of my request record (extension of sm_order).

Here is my UI action script (taken from UI Action to export to pdf 😞

find_real_file.png

However, apparently I cannot use g_form because this is what comes up in the debug log:

find_real_file.png

How else can I generate a PDF from a record? Thanks!

1 ACCEPTED SOLUTION

rob_pastore
ServiceNow Employee

UI Actions by default are server side, which is why you can use current and gs.log.   g_form is strictly client side.



You can mark a ui action as 'client', which will let you run both types of code.   Look at the OOB Resolve Incident UI action.   It is a perfect example of running the client code first, after which the server code is called.


View solution in original post

1 REPLY 1

rob_pastore
ServiceNow Employee

UI Actions by default are server side, which is why you can use current and gs.log.   g_form is strictly client side.



You can mark a ui action as 'client', which will let you run both types of code.   Look at the OOB Resolve Incident UI action.   It is a perfect example of running the client code first, after which the server code is called.