Showing posts with label lookup. Show all posts
Showing posts with label lookup. Show all posts

Tuesday, July 17, 2012

Quick Tip - Allow Lookup fields to search by multiple attributes

Lookups as you know in CRM show a list of records of a related entity. Using the lookup, you can search for records by typing in the search key words to filter the list.

This search is performed on all fields that is listed in the Find columns in the Quick Find View of the entity.

Instead of clicking the lookup button, the same search can be performed by directly typing in the search string in the lookup field.

The Lookup field is designed to auto-resolve the text to a matching record in the lookup entity.

This little known feature is very helpful in cases, where you identify the records not by thier names but by a unique id. Take for example you have a form in CRM that you need a user to fill in, and the user is aware of the SSN # of the contact and it would be a time saver if the user could type in the SSN# in the Contact lookup and it would auto-resolve to the Contact.

To acheive this follow the steps below

1. Customize the Contact entity
2. In Views, Select Quick Find View


3. Click on the Add Find Columns

4. Check the SSN field


5. Save and publish the entity.

Open the Account form. In the Primary contact type in the SSN# and tab out...



It will auto resolve to the contact that has that SSN# assigned.


Hope this little trick saves a lot of data entry time!

Friday, July 1, 2011

How to Enable and Disable the most recently used items for lookup field only.

In CRM 2011, we have found the new feature for the lookup type fields that you have the ability to see the most recently used items for that lookup while creating the records for entity.
Also you can disable this feature as well by default it is enable for all lookup types fields. If you like to see those items then, during creation of record, you need to “Double Click” on the lookup field.

See the below example for details:
• Below we have shown the account form which has the lookup field “Parent Location” and “Disable most recently used items” option is unchecked for this field as shown in below screen shot.


When you “Double Click” on Parent location field it will show you the below result.



To disable this feature you need to check the “Disable most recently used items” option then Save and publish the Form. It will disable above feature.

Thanks!

Tuesday, October 13, 2009

How to edit the list of entities displayed in the Look for picklist in Lookup window

The regarding lookup windows generally displays a list of all entities that can be associated with an activity. Quite often this feature becomes quite an issue with the users always having to select the appropriate entity from the list before applying the search. The longer the list of entities the more time consuming it is to search using the lookup window.

It would be a boon to have only a selected few listed that you use and do away with the rest. Well this is not available for customization through the CRM customization area. But it could be done with a couple of lines of script added to the onload of the form to manipulate the default properties of a lookup control to get the desired results.

For better understanding of how this works, it would be good to check the source of one of the CRM form that has a lookup control. In our example we are using the source of the Email form. Here when you search for regardingobjectid, you will find the “Lookup Types”, “Lookup Type names” ,”Lookup Type Icons” and “default type” properties of the Lookup control being set.



This provides the list of the entities that shall be displayed in the Look for entity list. To edit this to set your specific list of entities to show up in the Look for section you need to set these properties appropriately through scripting.

//Give the entity type code that you want in below script we want to show account, contact, contract and order in the list //codes
crmForm.all.regardingobjectid.lookuptypes = "1,2,1010,1088";

//Make sure you set the path of the entity images correctly for the list specified above. If you notice it is generally in the form of /imgs_ico_16_
crmForm.all.regardingobjectid.lookuptypeIcons = "/_imgs/ico_16_1.gif:/_imgs/ico_16_2.gif: :/_imgs/ico_16_1010.gif : :/_imgs/ico_16_1088.gif ";

//The below script is to set default entity in the multiple entity lookup. Here we set the default entity to be contact. If you want contract then write 1010 in place of 2 in //below script
crmForm.all.regardingobjectid.defaulttype = "2";

You need to add the above 3 lines of code in the onload event of the email form and publish it. Next time the lookup window for regarding will only list the 4 entities listed above.

Monday, July 13, 2009

Price List Lookup does not show up any Price Lists in Opportunity form

The Price List Lookup on the Opportunity form, displays the price lists for the currency selected on the Opportunity. If no price list has been created for the specified currency it would not show any price lists in the lookup.

In our case this was not the case. Here is what caused it…

We once happened to remove the Price List attribute from the Opportunity form as the customer was not going to use the Price Lists. We had plugns in place to set the Price List by default on the create event of the Opportunity.

But when we removed the Price List from the Form we got the following error

So we planned to put the field back on the form and explained to the customer that price lists would need to be provided on the form so you might as well select the appropriate price list manually from the form.

But what stunned us, is that after putting the field back on the form, the lookup no longer seems to work. It will always bring up an empty lookup window even though we have price lists created in the same currency as that of the Opportunity.



The Price List Lookup works on all other entities except this one as we had initially removed this attribute from the form and later added it back.

On further investigation we found that our adding the attribute back did not bring it to the same state as the original form provided by Microsoft. If you compare the customization file of the original Opportunity entity from MS with the one after you manually added the Price List attribute back… you would notice they are not the same. The original form has the following script that is missing when we added the attribute to the form

Script from our customized Opportunity entity:

<cell id="{2bf4485c-3d3e-444f-ac11-8a6262083d88}">
<labels>
<label description="Price List" languagecode="1033" />
</labels>
<events>
<event name="setadditionalparams" application="true" active="true">
<script><![CDATA[
var oLookup = event.srcElement;
AddTransactionCurrencyParam(oLookup);
]]></script>
<dependencies>
<dependency id="transactioncurrencyid" />
</dependencies>
</event>
</events>
<control id="pricelevelid" classid="{270BD3DB-D9AF-4782-9025-509E298DEC0A}" datafieldname="pricelevelid" />
</cell>

Script from our customized Opportunity entity:

<cell auto="false" showlabel="true" locklevel="0" rowspan="1" colspan="1" id="{2acdf564-bd2b-4392-9a93-52a133f856be}">
<labels>
<label description="Price List" languagecode="1033" />
<label description="Tarifs" languagecode="1036" />
<label description="Preisliste" languagecode="1031" />
<label description="Lista de precios" languagecode="3082" />
</labels>
<control id="pricelevelid" classid="{270BD3DB-D9AF-4782-9025-509E298DEC0A}" datafieldname="pricelevelid" disabled="false">
<<parameters>
<AutoResolve>true</AutoResolve>
</parameters>
</control>
</cell>

And this is the reason that the price list does not work after you add it back…

Resolution: Either populate this field through scripting by copying the customer pricelist to the Price List automatically(this does away with the need to lookup the price list) or replace the Original Opportunity customizations back from an unmodified CRM system.