cancel
Showing results for 
Search instead for 
Did you mean: 

Emailing contents of XML form

Former Member
0 Kudos

Hi, I have designed an XML form (using XML Forms Builder ) which accepts input from the user and when the user clicks on the "Send" button, the data needs to be saved as well as sent to 3 email addresses. Currently, I have created 2 iviews namely "Admin Form" iView and "Display Form" iView. When I preview "Admin Form" iview, I see a link which says "New InputForm" (where, InputForm is the name of my form). When I click on the "New InputForm" link, I am able to enter data and then preview it. In the "Display Form" iview, I only display the data. Now is it sufficient to have just the "Admin Form" iview since, I just need to accept input from the user? Also, do I have to edit "RenderConfig.properties" file, since I already see only the "New InputForm" link in "Admin Form" iView? If so, can you please tell me how to go about with editing the "RenderConfig.properties" form and also under what name should I save it? Also can you please tell me in which file I can find my source code? I believe I need to call a component from the code which will email the input to the recepients. I have just started learning XML and hence all these questions. Can you please point me in the right direction? Thanks for all your valuable time and effort.

Sincerely,

Sri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sri,

You need to develop a custom EventReceiver (there is an example of a simple eventreceiver somewhere on SDN...), which should be triggered when the user presses the send button. As far as I know, there is no way to find out which button has been pressed, the eventreceiver just listens to events such as "create" and "edit" (So it will work if you always want to email the xmlform).

The flow of the program will be something like:

-user gives input in xmlform, and saves

-eventreceiver gets the "create" event (here you should check if the resourcetype is the xmlform you created)

-eventreceiver gets the content of the xmlform input (most likely you will want the formatted input e.g. use ...Show.xsl), for this you can use the XMLFormsService.

-send the emails using the mail API

Hope this helps.

Johan

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello everyone, thanks for all your help. We are now planning to use KM Taxonomy to identify which forms are meant for which organization (I have an organization combo box in my form and it has various organizations like Sales, Global Communications etc.) and then use Subscription service to email the form to the collaboration room administrators. Once we get started on this, I will update you all. Again, thank you everyone for your valuable time and help.

Sincerely,

Sri

Former Member
0 Kudos

Hi Sri,

Try look in the yourProjectRenderr.xsl file in root\etc\yourproject folder and make the changes there in order of keeping them do generate the project again because it will erase your changes so make sure you backup your changes.

Yoav

daniel_davinci
Active Contributor
0 Kudos

Hi Sri,

the XML forms are located under:

<installation_dir>:\usr\sap\<instance>\SYS\global\config\cm\etc\xmlforms

I'm really not sure if the XML forms are the way to go for what you are trying to achieve as I do not know if it is possible to call your custom java from the XML form events.

Please be sure to post back and let us know how you go.

Regards

Daniel