Can SugarBean access custom fields without using the "_c" ending?

I have an after_save logic hook in a custom module where I'm setting the value of a field called rate_actual equal to the value of a custom field called engineer_rate_c. But, there is a typo in the code where I forgot the "_c" ending, like this:

$bean->rate_actual = $bean->engineer_rate;

Despite this error, the value gets set correctly. Does SugarBean have the ability to access custom fields without including "_c" in the name?

  • Hi Yury Voloshin,

    What version of sugar you are on? I haven't seen this working in upto version 8.x.

    Also, are you sure you got this working as in after_save hook, you also need to use $bean->save() at the end.

    Also, verify the custom field name from cache/<module_name>/<module_name>vardefs.php

    Regards.

  • No, it is not possible , something else is going on! fields names must be exact name match as per I know.

  • I'm on 9.0.1. I was actually wrong about the hook. Its a before_save hook, not after_save. I checked the vardefs in cache and they all have "_c" at the end of field names.

    Thank you!