Pass a property into a window.open() command

This seems simple, but I'm struggling with it.

I've got a button added to a toolbar that I want to open an external URL with.  The URL is saved as a property against the item.

Have tied a method to the button and it's a Client-side javascript.  Problem I'm getting is that the command window.open doesn't recognize the variable or const.  I've tried various forms of this including nesting the getProperty into the window.open, but nothing seems to work.  I have some HTML that works on the form, but I'd really like this as a button in the toolbar instead.

Here's the working code in the HTML form:

<a id="newlink2" href="#" onclick="return showURL2();" target="_blank" style="color: #3668B1;text-decoration: underline">Open 3D Model</a>

<script>

function showURL2() {
    debugger;
    var description2 = document.thisItem.getProperty("_forgemodelurl");
    
    if (description2) {
        document.getElementById("newlink2").href = description2 ;
    } else {
        top.aras.AlertError("Please Enter the Forge 3D Link with value.");
    return false;
    }
};

</script>

  • Hi

    I'm able use a button in the toolbar and access the external link using below code

    var description2 = parent.thisItem.getProperty("_forgemodelurl");
    window.open(description2, '_blank');