CoreBOSBB

Full Version: What is the best way to hide a field visually?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Field Dependency business map seems to be the right thing to use

Try that and let me know
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.
it just worked for me with no conditions. Maybe you have to update your code?
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.
I don't see it in the detail view:

[attachment=1183]
(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.
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.
The solution to this is to implement LDS GRID instead of tables in DetailView
Yes, that would be the ultimate solution for sure