Adding formulas/field calculations when creating custom fields via the manifest file.

Hey guys, 

I hope you are all well. I am currently work on a package to update our customer onboarding process. It would be preferred to install a single package in production and the configuration is complete except for adding the fields to the record layout.

In this process, I have check boxes on the Cases module an agent would check to create a related support setup ticket. Once this field is checked, there are other dependencies which become required, a text box should appear and be required. Normally I would just add the dependent formula in studio when creating the field, but when creating the fields with my manifest file, it is not clear how to add a dependent formula to a field.

Can anyone point me in the right direction? 

Parents
  • Hi ,

    If you are trying to add a formula for a calculated field from your manifest.php file, you only have to indicate the path corresponding to the vardef of your module:
    <sugar_path> \ custom \ Extension \ modules \ <your_custom_module> \ Ext \ Vardefs
    And in your file: sugarfield_name_of_your_field_file_c.php
    you must write this instruction:
    $ dictionary ['<your_custom_module>'] ['fields'] ['<your_field_name>_c'] ['formula'] = '<here is your sugar logic formula>';
    And you can also add a dependency of another field:
    $ dictionary ['<your_custom_module_name>'] ['fields'] ['<your_field_name>'] ['dependency'] = 'equal ($<field to validate>, "<value of field to validate>")';

    For example: equal ($status, "Active").

    I hope it helps.
    Regards.

Reply
  • Hi ,

    If you are trying to add a formula for a calculated field from your manifest.php file, you only have to indicate the path corresponding to the vardef of your module:
    <sugar_path> \ custom \ Extension \ modules \ <your_custom_module> \ Ext \ Vardefs
    And in your file: sugarfield_name_of_your_field_file_c.php
    you must write this instruction:
    $ dictionary ['<your_custom_module>'] ['fields'] ['<your_field_name>_c'] ['formula'] = '<here is your sugar logic formula>';
    And you can also add a dependency of another field:
    $ dictionary ['<your_custom_module_name>'] ['fields'] ['<your_field_name>'] ['dependency'] = 'equal ($<field to validate>, "<value of field to validate>")';

    For example: equal ($status, "Active").

    I hope it helps.
    Regards.

Children
No Data