ONLY external database in custom subpanel

Hello guys, it’s been so long since I post or reply here, been busy with other projects but always using suitecrm. I’m stuck in a task and I would like your help, sadly my friend @pgr left the community, maybe he know what I need.

I would like to show in a subpanel under Accounts module that particular account balance getting that info from our ERP, I´ve tried to manipulate the custom subpanel but it seems that it always requires an internal relationship. Tried to replicate the “purchased products” subpanel

I don’t think a hook can work this time because there’s no data to retrieve internally, only externally.

What I’m doing currently is an iframe that shows the data from another website but is not what I want.

I’m using Suitecrm 7.11

you can use in subpanel array ‘get_subpanel_data’= “function:function_name”
and in this function macke data.

Mike, I tried a iframe for my situation, but it couldn’t load the page presumably because you need to be a logged-in user to view the page. Couldn’t figure out how to format the url to pass the credentials… grr. I will keep watching this thread for inspiration =)

I did try this, using the Purchased Products as an example and also using this guide https://www.urdhva-tech.com/blogs/add-custom-subpanel-in-accounts-module but in both cases they are consuming local data, not external data.

do you manage the external web page? if you do, you can configure your parameters to pass some hash as login (not a great thing to do). in my example I pass the Account number as a parameter to get the external data shown in SuiteCRM as an iframe, but I want as a subpanel with the format of suitecrm.

Hi @mikebeck ! Good to see you again!

Me, left the Community?


Nah, still just barely hangin’ on…

I’d say you have to separate problems to solve here:

1. Getting the data from the external system

This will be a classical “write PHP to grab data from an API” problem. If your system provides a good API, you get clean data (JSON for example). If it doesn’t, then you will need to get HTML and parse it to get the data.

2. Showing it in a subpanel

It should be possible, although I’ve never done it. If you can’t find a way to inject an array directly into the subpanel (which should be possible somehow), you can still try writing your data to a temporary table in the database, so you could then tell the subpanel (through the get_subpanel_data function) the SQL it could use to retrieve it.