cancel
Showing results for 
Search instead for 
Did you mean: 

(RAP Application) - Using incoming value how to hide the entities (section) dynamically

UdhayakumarV
Newcomer
0 Kudos
159

Hi Developers,  

    My requirement is to conditionally hide sections based on a received value, but unfortunately. The solutions I have found so far are not adequate for my specific needs, and I'm continuing to search for a better solution.   

Help me out to overcome my issue   

Given the situation:
The system should dynamically manage the visibility of the partner entity during sales order creation, such that when the sales order type is one of 'MAKO', 'RTTC', or 'RTTR', the partner entity will be hidden from Application; conversely, for any other sales order type, the partner entity field must be shown to the user.

Found solutions:   

  1. Using Virtual Element in projection view  

         Some of the drawbacks include: 
            The entity (sections) cannot be hidden based on the incoming values. 
            Virtual element implementation will call only read the entity data not for modification face.  

     2. Control Fields with UI.Hidden Annotation  

  • Define Control Fields: Create control fields in your CDS view entity that determine the visibility of entities or sections.  
  • Bind to UI.Hidden: Use the UI.Hidden annotation and bind it to the control fields. This allows you to dynamically control visibility based on the values of these fields.  
  • Set Values Dynamically: Implement determination logic in your behavior definition to set the control field values based on incoming data.  

Some of the drawbacks include: 

  1. Unnecessarily create a field in CDS views. 
  2. Real-time customers won’t accept the dummy fields.  

       To illustrate:   

  1. Within my application, there are 10 sections, and in each section, I encounter difficulty in creating a field within my CDS view entity. Even though I managed to create 10 fields currently and they function as intended, there is a concern that future issues may arise once the application is handed over to the customer.  
  2. Because the customer wants to add another entity (Section) via the RAP Extension and simultaneously conceal a section contingent on a specific field's value, I cannot compel them to introduce an unnecessary placeholder field within their CDS view.   

 

Regards, 

Udhaya

 

Accepted Solutions (0)

Answers (0)