Ensuring data integrity in Inline Edit

We have made good use of Dependency files to enforce business data requirements, in addition to the blanket 'Required' in Studio. This works well.

However, it turns out that these 'rules' are bypassed when editing data 'in line' in module List View or sub panel List View if the fields in question are not visible on the List View.

Given that users have the option to shape their ListViews via the Cog icon, these 2 circumstances have significant impact on any data integrity rules in force:

a) it introduces an additional layer of system admin to consider/remember. For example, I add a piece of requirement logic to the Dependency files, I then need to remember to add that to any module Listview or subpanel listview. Potentially a lot of work and error prone

b) users can easily break this by disabling fields in their module ListViews

I would expect that the Dependency or Studio 'required' properties should be consistently applied across the various UIs (this is partially achieved, for example, by the option to set a field in Studio to 'required' for import)

I logged this with Sugar and it has been a known issue since 2015 which does not give me any optimism for a fix anytime soon (I would have thought this was a significant deficiency)

Is there a way to close this loophole in ListViews so that it applies both the Dependency or Studio required logic ?

Failing this, I'm thinking a workaround would be to 'lock' a field on ListView so it could not be edited (for example Sales Stage on Opportunities). This would then force the user to go into the Record View or Preview Edit to update this field, where the full logic is applied. Can someone advise how to 'lock' a field in List View / Subpanel through code customisation ?



  • Replying to myself....

    Looking at plan B to make key field(s) read-only in List View and Sub Panel(s) to force users into Record View to change key fields that drive other required fields (as using this method for Studio Required fields, although feasible, is high maintenance)

    On reflection, the Studio based 'Required' fields should be less of a problem as a record can only be created through Record View (other than import) so a Required field should contain a value before it ever gets to inline Edit. If it is hidden on inline Edit, it will still contain its value and cannot be edited if not visible - if visible it is validated. One exception would be a dependent required field which may not be filled during Record View editing because dependent condition means it is not visible and then during inline Edit the dependent field is changed but the related Required field is not visible and therefore is not validated when it should be.

    a) List View

    Using Opportunities as an example and Sales Stage being the key field (as the majority of my dependency rules are based on that)

    In ...\custom\modules\Opportunities\clients\base\views\list\list.php

    I add read only to the sales_stage field

       array (
       'name' => 'sales_stage',
       'label' => 'LBL_LIST_SALES_STAGE',
       'enabled' => true,
       'default' => false,
       'readonly' => true,

    Then QRR. Now in Opportunities List View that field cannot be edited, forcing the user into the Record View

    One gotcha is that if you should make the field 'unavailable' in Studio layout and then reintroduce it as Default or Available, this read-only property gets lost and needs to be added back.

    As the List View user cog only allows a user to change this field from visible to available, this does not unset the read only property.

    One question - is that file the correct place for this customisation ? I see no equivalent file in ...\custom\Extension\modules\Opportunities\Ext\clients\base\views\List.....

    b) Sub Panels

    Similar approach here.

    For example, Opportunities sub panel under Accounts


    Add the read-only = true

       array (
       'name' => 'sales_stage',
       'label' => 'LBL_SALES_STAGE',
       'enabled' => true,
       'default' => true,
       'readonly' => true,


    As with ListView, if you make the field 'Hidden' in Studio and then re-introduce it, you need to reapply the read only, followed by QRR

    Would welcome any input. Thanks