Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 5.x > Installation and deployment > Bizform Recipient/Department Drop Down Selector List View modes: 
User avatar
Member
Member
jade-falcon-software - 11/9/2010 11:32:25 AM
   
Bizform Recipient/Department Drop Down Selector List
Greetings.

I have a situation with a form that I need to have a list of 'departments' which the form presents to the user. The dropdown is a list of targets with 'email hidden' which the visitor selects depending on their query.

For instance the visible text is Tech Support or Billing or General Inquiries each with a unique email address that will be used.

Does anyone have a simple guide that I can follow for setting up this list? I believe it would fall under 'Notification Email' ??

Thank You!!

User avatar
Kentico Support
Kentico Support
kentico_radekm - 11/17/2010 9:47:52 AM
   
RE:Bizform Recipient/Department Drop Down Selector List
Hello.

You can define Field type: Drop-down list in your bizform and define values in pairs, like:

Value1; email1
Value2; email2

Then, you can ensure requested behavior in OnAfterSave() handler of your bizform, and according to value selected in drop-down list set SendNotificationEmail() method with requested e-mail address. For example:

if (viewBiz.BasicForm.FieldControls["SendTo"].ToString() = "value1")
{
viewBiz.SendNotificationEmail(<someparameters>);
}

else
(viewBiz.BasicForm.FieldControls["SendTo"].ToString() = "value2")
{
viewBiz.SendNotificationEmail(<someOtherparameters>);
}


You can access value of the field via
viewBiz.BasicForm.FieldControls["<columnName>"]
. You may need retype it as per field´s data type.

More info and example can be seen here.

Best Regards,
Radek Macalik