Using Filtered Lookup Funtionality in MS-CRM
Shown with concept of Responsible contact on case form
and can also be used for city ,State , Country.
and can also be used for city ,State , Country.
And Finally Populating Values in the Base Field
address1_city , address1_state , address1_country in case of city state country lookup
address1_city , address1_state , address1_country in case of city state country lookup
One of the most common Customized features in Microsoft Dynamics CRM has
always been filtered lookup fields.
For example, say you replace country and state
text fields with lookup fields—it is a very common request to filter the available states
based on the country selected.
CRM has taken a major step forward with the introduction of
filtered lookup fields. In this example, I want to filter the Case form “Responsible Contact”
lookup to only include the contacts associated with the selected Case account. From the
case form customization view, I’m going to select the “Contact” field. By clicking
the “Change Properties” button, I will see the field properties for the contact lookup.
Under the Related Records Filtering section of this form, I can check a check box that will filter the available values of this lookup field to records related to the value selected in another lookup field. In this example, I said to only show contacts contained in the case account. Note that I can select whether or not to allow users to turn off the filter—this gives me the ability to choose whether my filter is “hard,” limiting my users to just the filtered records, or “soft,” allowing users to select something outside of the filter. This is important because some filters are there to prevent users from selecting invalid record combinations, while others are there for user convenience, but may need to be overridden for exceptions.
JScript to be used with City , State and Country Look up Fields
function UpdateCountry()
{
var _country = new Array();
_country = Xrm.Page.getAttribute("new_country").getValue();
if(_country != null)
{
Xrm.Page.getAttribute("address1_country").setValue(_country[0].name);
}
}
function UpdateState()
{
var _state = new Array();
_state = Xrm.Page.getAttribute("new_state").getValue();
if(_state != null)
{
Xrm.Page.getAttribute("address1_stateorprovince").setValue(_state[0].name);
}
}
function UpdateCity()
{
var _state = new Array();
_state = Xrm.Page.getAttribute("new_city").getValue();
if(_state != null)
{
Xrm.Page.getAttribute("address1_city").setValue(_state[0].name);
}
}



No comments:
Post a Comment