Today, i will talk about how to filter the result of a lookup field. Before we start note that you can filter your lookup field by the customisation that crm offer by double clicking on the lookup field on your form
But unfortuanlity, this customisation does not offer a lot of choices. To have hand free, you can implement what ever you want by javascript.
OnLoad: function () { | |
| //Filter source lookup field | |
| FilterSourceField(); | |
| }, | |
| FilterSourceField: function () { | |
| Xrm.Page.getControl("source").addPreSearch(SourceFilter); | |
| }, | |
| SourceFilter: function () { | |
| var Filter = "<filter type='and'><condition attribute='sourceName' operator='like' value='" %john% "' /></filter>"; | |
| Xrm.Page.getControl("source").addCustomFilter(Filter); | |
| } |
0 commentaires:
Enregistrer un commentaire