0
votes

I have a CRM 2011 form with multiple control instances of the same lookup field. Each of these instances is included in a different section. Only one section is visible on form load, depending on a category data field, by applying the setVisible attribute appropriately on the sections in the onLoad javascript function.

In this situation, every time I change the visible lookup field, all the other lookup controls, which have the same control attribute, are also getting updated automatically, even if they are disabled and not visible. And this is causing a long delay when selecting a lookup value in the lookup field.

What I want is to only update the visible lookup control, and not the other 'not visible' lookup controls, in order to avoid the slow performance.

Is there any efficient way to do this?

5
Are the controls actually "not visible" themselves, or are they only hidden because they are in a section which is not visible? This may make a big difference - making the fields / controls themselves not visible as well as the sections may fix the performance issue. But this won't fix the fact that your design sounds unwieldy and unsustainable. - AdamV
The sections and corresponding controls are not visible. Having this will not solve the performance issue. - amartine

5 Answers

1
votes

You can create a "fake" lookup, using html or silverlight webresource, when you setting lookup value, you only set the webresource, and then when you save the record, use plugin or onsave javascript to set the real lookup value; When display the webresource, retrieve the lookup value and display on the webresource base on the section visible or invisible.

My question is, why not put the lookup in another section which is always visible? If some sections don't need that lookup, then you just make the lookup section invisible.

1
votes

If I'm understanding this correctly, you have a 100 different sections on one single entity form? It sounds to me like you're design is wrong. I would revisit the reasoning behind creating a 100 different sections, and instead of fighting CRM, work with it.

1
votes

i had the same issue. I have tried to Control.setVisible(false), with no result. The best solution was to move the lookup field to another section. But i still believe that we can cancel instances onChange of a lookup field that passes along to all sections.

0
votes

I think that in this situation you can create separate lookup field for each section (just set them same label). And with javascript or new plugin fill other fields onSave event.

0
votes

Put that control in a single section, then when another section requires that control make it visible.

Or don't hide and show sections, hide and show controls.

These are a little more involved but it avoids your current problem.