September 6, 2017

Dynamic External URLs

This week’s example looks at how we generate dynamic links in our List of search results. The example showed how to generate the NetSuite URL for a specific record.

This technique can be used just as well for external URLs as well. Perhaps you have an integration built, and you want your search results to show a link directly to the same record in the integrated system. All we have to do is modify our base URL and the URL parameters we’re sending.

For instance, perhaps you have that system located at http://myservice.com, and the typical path to a Project in that system is like http://myservice.com?projectid=12345

It is common to store the ID of a record from an external system in NetSuite’s externalid field, so we would just need to update our URL ListColumn like so:

list.addColumn({
    id: "recordurl",
    type: ui.FieldType.URL,
    label: "Project Link"
}).setURL({
    url: "http://myservice.com"
}).addParamToURL({
    param: "projectid",
    value: "externalid",
    dynamic: true
});

And that’s it! We’d have dynamic links to our external system.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Related posts

March 3, 2021

Does the physical location of a competent employee change the amount of value they can deliver for your organization? If it does, I’d be keen to hear your story. If it does not, why ...

Read More

March 2, 2021

Today a friend and former colleague of mine – who happens to now be in a development leadership role for a NetSuite partner – was lamenting the extreme difficulty of finding and hiring NetSuite ...

Read More

March 1, 2021

Software is never finished; clients are always changing and re-prioritizing. NetSuite is ever a moving target – always updating and evolving. Market forces are always shifting and shoving, forcing new demands on your business. ...

Read More