cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Buttons in XML Forms

Former Member
0 Kudos

Hi Experts,

Is there a possibility to create a custom button like when i click the button mail should be sent to concerned person along with form.

and how to create print button?

Edited by: EPADMIN on Feb 7, 2012 8:10 AM

Accepted Solutions (1)

Accepted Solutions (1)

former_member202734
Participant
0 Kudos

To print or send email you can use Javascript in your form. In the show form insert a Label.

(--> in the code replace REF by HREF --> if I put HREF in my post it doesn't work...?)

To print insert

<A REF="
javascript:
window.print()">Click to Print This Page</A>

in the Caption and set property Display HTML to yes.

The same to send mail but put

<A REF="
mailto:yourmailaddress?suject=Support request">
Click to mail</A>

to create a mail to [yourmailaddress] with subject "Support request".

(check mailto syntax for further options).

Former Member
0 Kudos

Hi Vincent,

Thanks for your reply.

but how do i enter this code in XML form which i have created using Form Builder in Portal.

Help me, as i am starter in this XML Froms.

former_member202734
Participant
0 Kudos

OK,

when you have started the form builder and loaded you form go to the show form.

Right clic on the form and choose Add -> Label. At the bottom right of the form builder you have the new element properties. In the property "Caption" enter the HTML code for print or mail. And set property "Display HTML" to Yes.

Note that you can also use an image (Add -> Image) (a printer or envelop) an link the same HTML code to it.

Former Member
0 Kudos

Hi Vincent,

Thanks for your reply,

when i right click on show form chosse add --> label. i have a blank field and as you told in and when i enter this code in caption

"<A REF="
javascript:
window.print()">Click to Print This Page</A>"

and set the propert"Disaply HTML" to yes and generate priview --> then preview itshows me the code!!

Did i miss something hope i am lost, please correct me?

former_member202734
Participant
0 Kudos

It's correct.

Next point that I forgot:

http://help.sap.com/saphelp_autoid2007/helpdata/EN/8f/fe743c74fa6449e10000000a11402f/frameset.htm

==> in the form builder, go to menu Options -> Project, tab forms, set property HTML Markup to "Allow All Tags" or "Determined by Control".

Former Member
0 Kudos

Hi Vincent,

Thanks for your reply, it solved my issue.

one last question when i click on "send mail to" it is opening outlook in my system, if i wanted to avoid this as some of the systems, outlook is not configured.

when i click on mail i should be able to enter the required employee mail ID and click on send. How this is possible?

former_member202734
Participant
0 Kudos

Hello,

the "mailto" function uses the default email program used on the user PC.

So either in Internet Explorer -> Tools -> Options, Programs tab, see email program.

Or on the PC, Start -> control pannel, Folder Options, Files Types, search for URL:MailTo Protocol to see used program (perhaps in advanced, action "open" -> view program in edit.

For you second question search javascript. You can put case option, get document url, get session cookies,...?

Best regards.

Vincent

Answers (0)