I want to discuss an excellent use of BC user property which lent me a hand to achieve a tricky requirement. The business requirement was to use one applet in two different views. In first view that applet should appear editable while in other it should be Read only. Business did not want to go for cloning the applet as it turns out in making same changes in two different applets and might end up in missing out some changes in either applet. Also the number of fields on the applet was large hence we did not give it a thought of using FieldReadOnly user property in some way.
Finally what came to our rescue was the "Aspect BC ReadOnly" BC user property.
This User Property works with CSSBCBase class.
Steps to configure the requirement:
1. Create a Calculated field lets say “Calculated Read Only” in the respective BC (BC on which the applet is based).The calculated field expression should be such that it always returns value as "Y", like one can create an expression as IIf ([Id] IS NULL,"N","Y"), so that it returns Y for every record available.
2. Create a new record in the Business Component User properties with
Name — Aspect BC ReadOnly: ReadOnly
Value — Calculated Read Only [Name of the calculated field created above]
3. Create a New record in the Applet User Properties of the respective Applet
Name — View Aspect: Account Detail – Orders View [Name of the view in which this applet should appear Read Only]
Value — ReadOnly [This refers to the variable given against the Name of the BC User Property above marked in Bold]
4. Now login to the application and see that in the view mentioned the applet appears to be read only while in other view it is well editable As can be seen here, in the Account Detail – Contacts View the Applet SIS Account Entry Applet appears editable.
While the same applet SIS Account Entry Applet is entirely Read only in the Account detail – Orders View 🙂
If you have any better ideas to achieve this, suggestions are most welcome 🙂