subpanel on create /edit view

Hi,
I have used following line to display subpanel on editview i am not able to have create/select options in subpanel can you guide me how do i achieve that?

$this->options ['show_subpanels'] = true;

using this line in view.edit.php file i am able to get sub panels on the editview but not the top buttons. Please guide me how to achieve this

I don’t know the answer, but I am wondering if even your entire approach can work…

One thing is to get the subpanels to show, another one is to make them work correctly updating data…

The Edit screen is not designed to have subpanels. If you start doing operations in subpanels you might lose the edits you’re doing in the top part…

Why do you want subpanels in edit views?

just to avoid too much navigation. on the same page contacts and lead should be added thats why want to have on edit view

1 Like

It won’t work without some in-depth customization of the core. If you do changes in subpanels, these will cause requests to the server, and it will mess up any edits currently being done. This is just not the way SuiteCRM is built.

HI
I just saw the topic now and I’m interested in this functionality. i tried adding $this->options ['show_subpanels'] = true; in edit.view and only got it on edit view.
Is it possible to get it on create view too?
I have suitecrm 7.11.15

is everybody knows how to enable $ this->options ['show_subpanels'] = true; in Create view

Just come across this seems to work really well with EditView after some modifications to include/SubPanelTiles.js
I created a function get_form() with this implementation

function get_form() {
  return window.document.forms['DetailView'] || window.document.forms['EditView'];
}

could use a null coalescing operator like

function get_form() {
  return window.document.forms['DetailView'] ?? window.document.forms['EditView'];
}

but unsure on browser support anyway…

and then everywhere where DetailView form is mentioned replace it with a call to get_form like

this

function get_record_id() {
    return window.document.forms['DetailView'].elements['record'].value;
}

becomes

function get_record_id() {
    return (get_form()).elements['record'].value;
}

I can make changes to the primary record of the view and create associated records at the same time

1 Like

I’ve recently had to redo this and I’ve found that it needs to be done slightly differently

it’s best to edit the ./jssource/src_files/include/SubPanel/SubPanelTiles.js file
so that when the js files are rebuilt the edits are not removed as this is the file the javascript file is rebuilt from.

and as explained above, add the additional get_form function and make the changes.

then rebuild js files from the repair menu

1 Like