Populate Cases Module dropdown with API call

Dear All,

I am a developer totally new to sugar crm, so apologies if this doesn't make sense.

I have a cases module with dropdown fields added to a panel. I want to fill these fields by reading from an external rest api get endpoint during data entry, say if /search/id responds with {name: "client"}, I would like to update the name field to client as the data entry proceeds. My questions are:

- Can this be done from the module builder or the studio of the crm instance?

- If not, should this be done from the code of the deployed instance?

- Could someone kindly point me to the documentation I would follow to develop this?

Parents
  • Welcome to Sugar Community, !

    In order to populate Case's fields from an external API you need to create custom code. The strategy on implementing such a feature depends on where exactly you want to populate those fields.

    If you want to populate in the layout (create/record view) then you need to create a custom endpoint for Cases which will fetch data from that external API.

    If you want to populate on saving the Case record then you need to create a LogicHook before_save.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Thank you @Andre Lopes, for the instance of sugar crm I am working with, I have admin credentials and I am able to play around with things in the admin section. Do you know if there a way to access the /custom directory from the admin interface?

  • I suppose that your instance is hosted at SugarOndemand, right? If so then you have no access to filesystem. Instead you need to request, via Customer Portal, backup of production instance in order to configure a dev env.

    You will be able to implement at your dev instance, to build an installable package and then install it in production instance.

    Cheers

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Thanks again @Andre Lopes, actually we have our own instance deployed on our servers but I guess the same case applies. Thank you so much.

Reply Children
No Data