简体   繁体   English

CRM Web UI中组件配置的动态选择

[英]Dynamic selection of component configuration in CRM Web UI

I did the following:我做了以下事情:

  • Created two configurations C1 and C2.创建了两个配置 C1 和 C2。
  • Enhanced the View and Classes of a standard Web UI component, added a ComboBox field.增强了标准 Web UI 组件的视图和类,添加了一个 ComboBox 字段。

What should I do to select dynamically the configuration?我该怎么做才能动态选择配置? - Example: - 例子:

  • If the user chooses "A" in ComboBox then C1 should be shown.如果用户在 ComboBox 中选择“A”,则应显示 C1。
  • If the user chooses "B" in ComboBox then C2 should be shown.如果用户在 ComboBox 中选择“B”,则应显示 C2。

我的 ZLOY BRole 配置

Use DO_CONFIG_DETERMINATION event of your view, and place something like this:使用视图的DO_CONFIG_DETERMINATION事件,并放置如下内容:

    IF <ComboBox.Value> EQ "A".
      CALL METHOD me->set_config_keys
        EXPORTING
          iv_object_type          = 'your_object_type'
          iv_object_sub_type      = 'your_sub_obj_type'
          iv_propagate_2_children = abap_false.
    ELSE.
      ...config B
    ENDIF.

Here object and subobject types are the ones you were prompted while creating custom configuration.这里的对象和子对象类型是您在创建自定义配置时被提示的类型。

The sample implementation of this method one can find in BP_HEAD/AccountDetails standard WebUI component.该方法的示例实现可以在BP_HEAD/AccountDetails标准 WebUI 组件中找到。

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

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