Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the best way to hide a field visually?
#1
I want to hide some fields, purely visually. So I want users to have the same rights on those fields, I want workflows and other code to be able to have the same rights on the fields as they have now: I only want to have the fields hidden from the regular detailview. Now I can set their 'presence' column to 1, but that doesn't feel like the way to go. I don't want to disable them in the profile, since that might disable access to the fields for that profile, while it can be needed for some background processes.

So: purely visually. What is the best way to do that.
Reply
#2
Field Dependency business map seems to be the right thing to use

Try that and let me know
Joe
TSolucio
Reply
#3
OK, I've done some tests, but without success:
Code:
<map>
    <originmodule>
        <originname>SalesOrder</originname>
    </originmodule>
    <dependencies>
        <dependency>
            <field>subject</field>
            <condition>
            [
                {
                    "groupid":"",
                    "columnname":"vtiger_salesorder:subject:subject:SalesOrder_Subject:V~M",
                    "comparator":"e",
                    "value":"",
                    "columncondition":"or"
                },
                {
                    "groupid":"",
                    "columnname":"vtiger_salesorder:subject:subject:SalesOrder_Subject:V~M",
                    "comparator":"n",
                    "value":"",
                    "columncondition":""
                }
            ]
            </condition>
            <actions>
                <hide>
                    <field>pl_gross_total</field>
                </hide>
            </actions>
        </dependency>
    </dependencies>
</map>
I've also tried emptying the 'condition' and completely removing it, but the 'pl_gross_total' field is still there.
Reply
#4
it just worked for me with no conditions. Maybe you have to update your code?
Joe
TSolucio
Reply
#5
Could be, but I just tried it in the demo, did not work either. The 'Gross Total' field in SalesOrders is still there. Check the attachment to see what I did.
EDIT
It works, you need to completely remove the 'condition'. It doesn't work in my installation, which is a bit older. I have the Field Dependency map, but apparently there have been updates to that.


Attached Files Thumbnail(s)
   
Reply
#6
I don't see it in the detail view:

   
Joe
TSolucio
Reply
#7
(09-08-2022, 09:18 AM)joebordes Wrote: I don't see it in the detail view:

Yeah I edited my question later: removing the condition all together works. In the demo, not in my installation.
Reply
#8
OK, so: this works. But it could use some improvement in my opinion. This just adds a 'visibility: hidden' CSS property to the field, leaving the detailview looking like a child's mouth when changing teeth when you hide a couple of fields. Maybe we can render the hidden fields in a hidden block and move them away from their regular slots. That way, all the JS stuff that needs to access it can still do so, but we'd be left with a decent looking interface.
Reply
#9
The solution to this is to implement LDS GRID instead of tables in DetailView
Joe
TSolucio
Reply
#10
Yes, that would be the ultimate solution for sure
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)