Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Customizing BizForm Logic View modes: 
User avatar
Member
Member
scott_hancock-urmc.rochester - 3/9/2011 9:39:40 AM
   
Customizing BizForm Logic
I'd like to add logic to my BizForms so that when the form is submitted, the data is forwarded by email to the appropriate person. I know that there is an OnSave event for BizForms but where do I put this code? I haven't been able to find any information or samples in the documentation.

User avatar
Certified Developer 9
Certified Developer 9
charbf-gmail - 3/9/2011 2:02:34 PM
   
RE:Customizing BizForm Logic
It's a build in function of the BizForm

check out the tab Notification e-mail in the BizForms properties

if you need more advanced functions you can duplicate the Bizform webpart and add the OnSave function

User avatar
Member
Member
scott_hancock-urmc.rochester - 3/9/2011 2:12:04 PM
   
RE:Customizing BizForm Logic
So there is no way to add logic to an individual BizForm?

User avatar
Member
Member
eagleag - 3/9/2011 2:46:59 PM
   
RE:Customizing BizForm Logic
Hi,
Is this what your looking for?
http://devnet.kentico.com/docs/devguide/index.html?bizform_notifications.htm

if not, please be more specific at what you are trying to do?

Are your trying to get this
, the data is forwarded by email to the appropriate person.
-> appropriate person -> is this suppose to be a dynamic email, depending on something selected by user?


User avatar
Member
Member
scott_hancock-urmc.rochester - 3/9/2011 3:12:37 PM
   
RE:Customizing BizForm Logic
No that's not it. I know how to set email notifications with BizForms. I want to add logic specific to a form.

Here is what I want to do:

User 1 fills out the form and selects "Lemon"; when they submit the form, the data is emailed to Bob (because he is the contact for lemons).

User 2 fills out the form and selects "Lettuce"; when they submit the form, the data is emailed to Sally (because she is the contact for lettuce).

I would want to do this in response to the OnSave event. Is the only way to do this to modify the BizForm webpart? That would apply the logic to all forms. How would I apply it to a specific form? For example (Modifying the BizForm webpart):

OnStart()
{
If this is form A Then do the following
{}
}

User avatar
Member
Member
eagleag - 3/10/2011 1:52:49 AM
   
RE:Customizing BizForm Logic
this is something I've done.



protected void viewBiz_OnBeforeSave()
{
this.viewBiz.BasicForm.DataRow["emailRecipient"] = emailRecipient;
//emailRecipient -> should get email.
}


then go to BizForm Properties -> Notification e-mail ->To e-mail: -> insert this macro {%emailRecipient%}

the macros will get email that was saved in emailRecipient field in bizForm,by this function -> viewBiz_OnBeforeSave()

I hope my explanation helps. If not clear please ask.


User avatar
Kentico Support
Kentico Support
kentico_radekm - 3/16/2011 2:50:40 AM
   
RE:Customizing BizForm Logic
Hello.

You can check value of any field in your bizform from this.viewBiz.BasicForm.DataRow["columnName"], as following example states, and send notification e-mail dynamically, according to this value and using SendNotificationEmail() method.

If you want to call this logic for particular bizform only, you can get current bizform name via this.viewBiz.FormName, and decide according to this.

Best Regards,
Radek Macalik