Read Only not enforced

I have a 1:M relationship from module PGOpp to Billing Ledger.

PGOpp has an Amount field which should be read only once Ledgers start being related to it

I changed the Amount field to have Read only if, with the formula:

greaterThan(count($pgopp_partnershipopportunities_apib_apibillingledger_1),0)

But it's not enforced.

I tried changing the formula to:

not(equal(count($pgopp_partnershipopportunities_apib_apibillingledger_1),0))

Still not enforced.

Any thoughts on why it would ignore the formula?

Thanks,

Francesca

Parents
  • Hi  ,

    Do you have 'disable_related_calc_fields' enabled in your config / config_override.php? At first I could not reproduce this issue, but once I added that configuration, I am now seeing the same issue. This seems to be a bug because the condition never properly validates from what I can tell. 

    You should be able to workaround this issue by creating an integer field that performs the related record count and then your greaterThan formula would reference that integer field instead of the direct relationship. However, if you have disable_related_calc_fields enabled, then it is possible there is a scenario where someone adds a related record and can still edit the currency field. The reason is that your parent module record will still not reflect that newly added relationship in the count value until it is explicitly resaved to trigger the calculation.

    Using disable_related_calc_fields has significant performance benefits when using a lot of SugarLogic relationship calculations. Our Upsert Calculated Fields plugin handles routine SugarLogic updates of records so things like KPI measurements and related record counts are kept up-to-date to avoid performance bottlenecks and users having to manually save records to trigger recalculations.

    Chris

Reply
  • Hi  ,

    Do you have 'disable_related_calc_fields' enabled in your config / config_override.php? At first I could not reproduce this issue, but once I added that configuration, I am now seeing the same issue. This seems to be a bug because the condition never properly validates from what I can tell. 

    You should be able to workaround this issue by creating an integer field that performs the related record count and then your greaterThan formula would reference that integer field instead of the direct relationship. However, if you have disable_related_calc_fields enabled, then it is possible there is a scenario where someone adds a related record and can still edit the currency field. The reason is that your parent module record will still not reflect that newly added relationship in the count value until it is explicitly resaved to trigger the calculation.

    Using disable_related_calc_fields has significant performance benefits when using a lot of SugarLogic relationship calculations. Our Upsert Calculated Fields plugin handles routine SugarLogic updates of records so things like KPI measurements and related record counts are kept up-to-date to avoid performance bottlenecks and users having to manually save records to trigger recalculations.

    Chris

Children