Friday, August 13, 2010

Ontario Sport Bike Insurance

Multientity - (as the client) Customizing

Sometimes we need a lookup which allows us to handle both accounts and contacts (similar to that in the form of cases) or lookups as "Concerning." While it's own CRM functionality in this ejempplo (which is based on this post ) we will emulate a multi-entity lookup which allows us to make the registration of a contact or account. Suppose you have a custom entity called: jl_entidad. Must build relationships with account and contact the institution where they are the principals. Add fields jl_accountid lookup and type in the form jl_contactid jl_entidad. OnLoad event Now, copy the following code: var accountLookup = crmForm.all.jl_accountid;
contactLookup var = crmForm.all.jl_contactid; accountLookup.lookuptypeIcons =" \u200b\u200b/ _imgs/ico_16_1.gif: / _imgs/ico_16_2.gif " if (contactLookup.DataValue! = null) { accountLookup.DefaultValue = contactLookup.DataValue;
accountLookup.DataValue = contactLookup.DataValue;
if (typeof (accountLookup.DataValue [0]. data)! = "undefined") {
accountLookup.DefaultValue [0]. accountLookup.DataValue data = [0]. data;
 
}}

OnSave In the event copy the following: var

accountLookup = crmForm.all.jl_accountid;
contactLookup var = crmForm.all . jl_contactid;
if (accountLookup.DataValue == null) {
contactLookup.DataValue = null;

} else {var customer = accountLookup.DataValue
[0];
if (customer.type == "1") {
contactLookup.DataValue = null;
} else {
contactLookup.DataValue = accountLookup.DataValue;
accountLookup.DataValue = null;
}}





0 comments:

Post a Comment