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?

  • 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.


    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.


    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.

  • Hello 

    Actually, you can configure all the stuff instead of spending time on Sugar development - external API calls and population data in Sugar - with the no-code tool Logic Builder.

    I have an example that corresponds to the task.

    There is Example1 sugar instance with Cases module, each Case records has ExternalCaseNumber and DropdownA fields.
    There is also  external system - Example2 , another sugar instance with extra Cases info (that could be any other system with rest API)
    I configured the following:  on Case record saved in Example1, to read the Case Status from Example2 with external call and depending on the value retrieved, decide to populate the DropdownA field  with value "Open" or "Closed"

    Here is the video:

    And here is the flowchart that configures Sugar instance Example1 to make this represented in the video.
    You can easily read the logic by following the white line (pls zoom in the picture to read):

    I suppose this flowchart could be easily adjusted - to adjust the start criterion, to deal with your Sugar custom data model and to retrieve from your external system with rest API available.

    Let me know if any questions about Sugar configuring.

    Best Regards,
    Dmytro Chupylka

    We make work in Sugar CRM system faster, more convenient and efficient