function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Russell LesterRussell Lester 

Question about JavaScript in custom button.

I am trying to get a custom button to work in Console mode for DocuSign. I was given a link to this page:
https://support.docusign.com/en/guides/dfs-admin-guide-custom-buttons-console

I then attempted to compile the code as shown below. When I click the button, I get an error of "unexpected identifer" Please advise.

function inIframe () {
  try {
    return window.self !== window.top;
  } catch (e) {
    return true;
  }
}

if(inIframe())
{window.open("{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}

var sourceId =DSGetPageIDFromHref();var RQD=DSGetPageIDFromHref();
window.open() = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID="+sourceId+"&RQD="+RQD"+, "Popup", "location=1, status=1, scrollbars=1, resizable=1, directories=1, toolbar=1, titlebar=1, width=1200");
} else 
{window.location.href = "{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}

var sourceId =DSGetPageIDFromHref();var RQD=DSGetPageIDFromHref();
window.location.href = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID="+sourceId+"&RQD="+RQD"+location=1, status=1, scrollbars=1, resizable=1, directories=1, toolbar=1, titlebar=1, width=1200;
}
Russell LesterRussell Lester
Ended up answering this on my own. Code fired properly when syntax was:

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}

  var sourceId = DSGetPageIDFromHref();
  var RQD = DSGetPageIDFromHref();
  {window.open("/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID=" + sourceId + "&RQD=" + RQD, "Popup", "location=1, status=1, scrollbars=1, resizable=1, directories=1, toolbar=1, titlebar=1, width=1200");}