September 7, 2017

Dynamic External URLs pt 2

Yesterday we expanded on this week’s example by adding dynamic external URLs to our search result List. Perhaps your external system has more of a RESTful URL pattern. Rather than using URL parameters, your system may use a more path-like structure to access resources.

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/project/12345/

It is common to store the ID of a record from an external system in NetSuite’s externalid field, so we would need to employ the dynamic property of setURL:

list.addColumn({
    id: "recordurl",
    type: ui.FieldType.URL,
    label: "Project Link"
}).setURL({
    url: "recordurl",
    dynamic: true
});

Then we would update our data source to set the recordurl field correctly:

function resultToObject(result) {
    return {
        recordurl: "http://myservice.com/project/" + result.id,
       // ...
    };
}

And that’s it! We’d have another style of 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