简体   繁体   English

CRM 2011表单上同一查找字段的多个查找控件实例

[英]Multiple lookup control instances of the same lookup field on CRM 2011 Form

I have a CRM 2011 form with multiple control instances of the same lookup field. 我有一个CRM 2011表单,其中包含同一查找字段的多个控件实例。 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. 通过在onLoad javascript函数中的部分上适当地应用setVisible属性,根据类别数据字段,在表单加载时只有一个部分可见。

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? 有什么有效的方法可以做到这一点吗?

If I'm understanding this correctly, you have a 100 different sections on one single entity form? 如果我正确理解这一点,那么您在一个单一实体表单上有100个不同的部分吗? 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. 我将回顾创建100个不同部分的背后原因,并与其抗衡CRM,不如使用它。

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; 您可以使用html或silverlight webresource创建“伪”查询,设置查询值时,仅设置webresource,然后保存记录时,使用插件或onsave javascript设置实际查询值; When display the webresource, retrieve the lookup value and display on the webresource base on the section visible or invisible. 显示Web资源时,检索查找值,并在可见或不可见部分的基础上显示在Web资源上。

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. 如果某些部分不需要该查找,则只需使查找部分不可见。

i had the same issue. 我遇到过同样的问题。 I have tried to Control.setVisible(false), with no result. 我试图Control.setVisible(false),但没有结果。 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. 但是我仍然相信,我们可以取消传递给所有部分的查找字段的onChange实例。

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. 并使用javascript或新插件填充onSave事件的其他字段。

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. 这些涉及更多一点,但是可以避免当前的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM