...
Code Block |
---|
<html><head><title>ExternalAppExample</title><script type="text/javascript"> var externalAppUrl; function openExternalApp(rows){ externalAppUrl = "testsales://spots/"; if(rows.length > 0){ externalAppUrl += "Call Id=" + rows[0]._6.uid + "&Contact=" + rows[0]._6.CALREF1 + "&DUE DATE=" + rows[0]._6.CALTXT01 + "&START TIME=" + rows[0]._6.CALSTARTDATE + "&STATUS=" + rows[0]._6.CALTXT07 + "&SUBJECT=" + rows[0]._6.CALDESCRIPTION; } return "[ {\"action\":\"goToURL\", \"url\":\"" + externalAppUrl + "\"}]"; } </script></head><body></body></html> |
...
Code Block |
---|
<html><head><title>ExternalAppExample</title><script type="text/javascript"> var externalAppUrl; function openExternalApp(rows){ externalAppUrl = "testsales://spots/"; if(rows.length > 0){ externalAppUrl += "Call Id=" + rows[0]._6.uid + "&STATUS=" + rows[0]._6.CALTXT07 + "&SUBJECT=" + rows[0]._6.CALDESCRIPTION; var st = new Date(1000 * rows[0]._6.CALSTARTDATE); var sts = st.toLocaleString(); externalAppUrl += "&START TIME=" + sts; var dt = new Date(1000 * rows[0]._6.CALTXT01); var dts = dt.toDateString(); externalAppUrl += "&DUE DATE=" + dts; var contactid = rows[0]._6.CALREF1; var options = []; var option = {}; option.action = "select"; option.invoke = "openURL"; option.parameters = []; option.parameters[0] = { modulefields : [{ module : "2", fields : "CONTFIRSTNAME,CONTLASTNAME" }], filter : "2.uid="+contactid }; options.push(option); return JSON.stringify(options); }else{ return "[ {\"action\":\"goToURL\", \"url\":\"" + externalAppUrl + "\"}]"; } } function openURL(contacts){ if(contacts.length > 0){ externalAppUrl = "&Contact=" + contacts[0]._2.CONTFIRSTNAME " " + contacts[0]._2.CONTLASTNAME; } return "[ {\"action\":\"goToURL\", \"url\":\"" + externalAppUrl + "\"}]"; } </script></head><body></body></html> |