cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically hide attributes in the configuration

Former Member
0 Kudos

Hi Experts,

Problem : I need to display or hide an attribute depending on some logic. The attribute is present in the configuration.

We have CRM 7.0 system with enhancement pack installed. The catch here is that I must not use "DO_CONFIG_DETERMINATION" method. Doing that requires 64 sub-object types to be maintained in the configuration.

Thanks in advance for your replies.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this:

In the html page of your form view, add the following code at the beginning of the page right after all those <%@extension> tags


<%
 data: lv_xml    type string.

 lv_xml    = controller->CONFIGURATION_DESCR->GET_CONFIG_DATA( ).

replace all occurrences of '//SOLDTO/STRUCT.PARTNER' in lv_xml with ''.

%>

The "//SOLDTO/STRUCT.PARTNER" will be the technical name of your field.

Then find the following tag in the html page.


<chtmlb:config
/>

Add the parameters in the tag if it is not there


xml     = "<%= lv_xml %>"

The final will looks like this


<chtmlb:config xml     = "<%= lv_xml %>"
               mode    = "RUNTIME"  />

The field should disappear.

Former Member
0 Kudos

Thanks a lot peng. The issue is resolved.

Former Member
0 Kudos

problem solved

Edited by: Anna_von_Landsberg on Oct 16, 2011 1:10 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vignesh,

Is your view sitting in a view set?

If it does, what I have done is to create a copy of the view with a separate configuration that I wanted. Then in the Viewset controller, DO_REPLACE_INITIAL_VIEW method, I replace the entire view.

It worked for me very well because and worth the effort as the configuration of both screen is very different. If you are talking about doing it for very minimal difference, this could be overkill but it is one way of doing it.

Hope this helps.

Former Member
0 Kudos

Hi Peng,

Thanks for the reply. My view is in an overview page.

Copy configuration is not an ideal option for me because there are close to 40 different configurations.

Thanks for the reply once again.

former_member189678
Active Contributor
0 Kudos

Please check if this helps in anyway.

http://wiki.sdn.sap.com/wiki/display/CRM/Dynamcallyhidinganassignmentblock

Rg,

Harshit Kumar

former_member191572
Contributor
0 Kudos

Hi,

u can do that by changing the code in the method prepare_xml

Former Member
0 Kudos

Hi Gobi,

Could you please elaborate . As in, is that a method ? Or a XML page?.

If it is a method can you please tell the loaction of that?.

Do you have any sample approach to it ?

Thanks,

Vignesh.