Displaying a custom object entry by its ID as a URL parameter?

lock
push_pin
done
Besvarat
4

Hi,

I had a chat with a customer yesterday, and the need to open a custom object entry by using its table name + ID in the URL arose. I noticed there are no custom object parameters in the URL when viewing the current custom object dialog.

However, according to the SoProtocol section in the docs, we should be able to open a custom object by using:

default.aspx?customobject?customobject_name=y_car&customobject_id=1520

I can't get this to work though. Is this supposed to work in the current version? Or is it maybe intended for a future update where the screen designer for custom objects is released?

Espen

13. sep. 2024 | 07:28 fm

Allt Svar (4)

Hi Espen,

Not sure in what context you are trying this, but from version 10.3.8 we do support these soprotocols triggered from buttons or links added in screen designer. 

 

13. sep. 2024 | 08:12 fm

Hello Espen, 

I'm not sure which version or tenant you are working on, but this works on my SOD-tenant:

PageUpdate("soprotocol:customobject?customobject_name=y_car&customobject_id=1"); 

You can run this in developer console, in your browser:
1. Log in to SuperOffice
2. Open developer tools (F12)
3. Go to the console and run the command above. 

Let me know if this works for you, or get back to me with which tenant you are working on so i can take a closer look

//Eivind

13. sep. 2024 | 08:36 fm

Thanks for the quick replies. I've tested in 10.3.9.

Using the PageUpdate function in the browser console does work. What I was trying to achieve though, is to open the custom object by entering the URL in the browser.

This does not work:

https://online.superoffice.com/CustXXXXX/default.aspx?customobject?customobject_name=y_tablename&customobject_id=1
13. sep. 2024 | 10:13 fm

Hi again, 

It looks like its unable to resolve that, so unfortunately this is not implemented. E.g. it does not work to input the URI directly in the browser.

Using soprotol does work, though, even if used through 'normal' webpanels and custom screens.

I'm not sure about the usercase, but as a workaround you could also create a short crmscript that shows a dialog, and from that use the soprotocol to open that id.. Example:

#setLanguageLevel 4;

EventData ed = getEventData();
String step1 = ed.getInputValue("custom_button");

if(step1 == "")
{
    Integer default;
    EventDataDialogDefinition dialog;
    dialog.setTitle("Open Custom Objects");
    dialog.setType("okcancel");
    dialog.setIcon("info");
    dialog.setPrefix("custom_");
    dialog.setText("Input rowId you want to open:");
    dialog.addInteger("id", "RowId", default, "", true);
    ed.showDialog(dialog);
    ed.setOutputValue("custom_button", "yes");
}
else {
    ed.setNavigateTo("soprotocol:customobject?customobject_name=y_car&customobject_id=" + ed.getInputValue("custom_id"));
}

Feel free to register this as a wish as well! :)

//Eivind

13. sep. 2024 | 11:05 fm

Lägg till svar