Checkbox "Copy billing address to shipping address" not ticked when creating a record through API

This checkbox is always ticked by default when creating a new account record manually in SugarCRM, but never when creating a record through the REST API.

I've searched around and experimented and it seems like it is not even a Sugar field, even though its "field name" appears to be simply "copy".

Sending this in the record creation request does not tick it:

"copy": "true"

Is there a way to tick this checkbox through API only?

Or is the only way really to create an entire customisation with JavaScript code that would tick this checkbox based on a handful of conditions?

Parents
  • Hi Artis,

    This checkbox is a User Interface only field. It is checked by default on new records, and it will show as checked, when the field values match. Essentially to have it checked by default when submitting records via the API, you simply need to duplicate the values to both sets of Address fields when submitting the record.

    Another work around, would be to make a custom non-db field, that could be evaluated via a LogicHook to copy the values on submission from the API, or simply override the API endpoint for the module to do the copy when passed a particular value.

    Regards,
    Michael Russell
    Senior Developer Support Engineer

    Learning Resources: http://support.sugarcrm.com | http://university.sugarcrm.com | http://community.sugarcrm.com

Reply
  • Hi Artis,

    This checkbox is a User Interface only field. It is checked by default on new records, and it will show as checked, when the field values match. Essentially to have it checked by default when submitting records via the API, you simply need to duplicate the values to both sets of Address fields when submitting the record.

    Another work around, would be to make a custom non-db field, that could be evaluated via a LogicHook to copy the values on submission from the API, or simply override the API endpoint for the module to do the copy when passed a particular value.

    Regards,
    Michael Russell
    Senior Developer Support Engineer

    Learning Resources: http://support.sugarcrm.com | http://university.sugarcrm.com | http://community.sugarcrm.com

Children
  • Thank you for your reply. I've tested whether the checkbox appears ticked when both addresses match. It definitely does not become ticked in that case.

    Is there no way to make it ticked through the API so that when a user unticks it the shipping address is emptied like with the normal behaviour of the checkbox?