How to create a button on record producer?

manmathpanda
Giga Guru

Dear Developers,

I want to generate an offer letter after clicking a button on record producer as belofind_real_file.png

aNow my requirement is 

11. How to create "Geneare Off Ltr" button on Record producer.

22. when i click on this button , it will download an offer letter(in Word Format) according to the Nationality(Let's say inida, india offer letter will create, if germany - Germany offer letter will be created.) and these offer letter templates are created on a table already and the table name is let's say NTL_OFR_LTR where 12 countries offer letter templates are created.

pPlease help me on how to achieve this requirement.

 

 

 

ss

 

 

 

3 REPLIES 3

Gaurav Shirsat
Mega Sage

Hi Manmathpanda

as per my knowledge,

Adding Buttons to Record Producer is possible using UI Page/UI Macro/Portal Pages, once you are done with the button code in any one of them create a variable on record producer with type to UI Page or Macro or Macro with Lable. If you use portal page (widget), then select a Macro and in the default values select the widget.

You can create a new UI page or you can update the UI page: com.glideapp.servicecatalog_cat_item_view which is used for displaying a record producer.

You can get the sys_id of catalog through the link, and only for that ID, create 2 buttons. I believe you might have accomplished it that far.onClick of these buttons you can make a glideAjax call to script includes, which can then be used to perform updates on state field.

refer the DOC:-https://community.servicenow.com/community?id=community_question&sys_id=58fba4c6db663f044819fb243996...

 

Please Mark Correct and Helpful

Thanks and Regards

Gaurav Shirsat

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can have a button created by using variable of type UI page or UI macro

On click of button you would require custom code to generate the word file and download it

for generating word/pdf files sharing few links:

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

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

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

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

Mark āœ… Correct if this solves your issue and also mark šŸ‘ Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Megha Padale
Giga Guru

Hi Manmathpanda,

Adding to Gaurav's point, you can create a link directly to the attachment record. For example,

https://YOURINSTANCE.service-now.com/sys_attachment.do?sys_id=3cc358dadb8be2002e38711ebf96190d

You may need a simple UI macro that you can place on the form that says "Geneare Off Ltr".

http://wiki.servicenow.com/index.php?title=UI_Macros

If my answer helped you in any way, mark answer as helpful and correct.

Thanks and regards,

Megha.