Great question. The Portal Connector forms functions similarly to Dynamics CRM forms, meaning you have to put all custom form logic in JavaScript. To do this in the
Portal Connector requires both page and form widgets. To do what you requested you must first put all the required controls on the form:
-
Rules Manager (JavaScript API)
-
Multiple choice field (source field)
-
CRM Text Field (target field)
The Rules Manager here requires no configuration, it just provides the JavaScript API that we need. Open the editor of the Multiple Choice field and go to
the Appearance tab in the designer, the CSS class here will be the unique identifier of the control that the Rules Manager looks for, give it a name with
no spaces (like MultiChoice1). Configure the CRM Text Field to populate the desired field in CRM and note down the name for developers
(similar to CrmTextField_C005).
In order for this to work with The Portal Connector 2.3, you must add a JavaScript control to the page that the form will be residing on
(with the CRM Form Manager widget). The JavaScript widget is in the toolbox under Scripts and Styles. Open the designer for the JavaScript
widget and select the “Write JavaScript” tab; configure the control to include the JavaScript “Where the widget is dropped” and add the following code to
the textbox:
$(window).load(function() {
findControl("MultiChoice1").add_valueChanged(function(sender,args){
findControl("CrmTextField_C005").set_value(sender.get_selectedName());
});
});
This code provides the basic functionality you need. It attaches an event handler when the window loads to the value changed event of the multiple choice
field and sets the value of the CRM Text Field whenever it changes.
If you wish to hide the target field, you must apply a CSS class to it. To do this add a CSS
widget to the page, open the designer and select the “Write CSS” tab and add the following style:
.CrmTextField_C005 {
display: none;
}
I hope this solves the issue.
Last modified on 25 Nov 2014 14:11 by Clinton Bale