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
Scott M - SFDC FanScott M - SFDC Fan 

Javascript in a VisualForce Page. I'm lost

Hi, Why would this simple JavaScript work in an S-Control and not in a VisualForce page? <script type="text/javascript" language="JScript"> var meldung = {!Case.SAP_Service_Notification__c} ; var command = '"*iw52 RIWO00-QMNUM=' + meldung + '"'; var sapuser ="{!$User.SAP_User_Name__c}"; var sprache="{!$User.SAP_Login_Language_New__c}"; var program = 'sapshcut.exe -sid=TDZ -clt=201 -user=' + sapuser + ' -command=' +command+ ' -language='+sprache+ ' -type=Transaction' ; function starte(program) { var WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run(program); } </script> {!Case.SAP_Service_Notification__c} I get the following error: Details zum Fehler auf der Webseite Benutzer-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET4.0C; .NET4.0E; MS-RTC LM 8) Zeitstempel: Mon, 30 May 2011 10:58:31 UTC Meldung: Automation server can't create object Zeile: 21 Zeichen: 3 Code: 0 URI: https://c.cs4.visual.force.com/servlet/servlet.Integration?lid=066P00000000BzW&ic=1 Meldung: Automation server can't create object Zeile: 21 Zeichen: 3 Code: 0 URI: https://c.cs4.visual.force.com/servlet/servlet.Integration?lid=066P00000000BzW&ic=1 Scott
Scott M - SFDC FanScott M - SFDC Fan
Again, just a point. As an S-Control, this works fantastically. But in an VisualForce page I am getting the error. I've also tried loading the script as a resource. Still no go.
Ankit AroraAnkit Arora

Can you please rearrange the code as it is next to impossible for me to understand it :)

 

 

Thanks
Ankit Arora

 

Imran MohammedImran Mohammed

Why dont you add alert statements in between the javascript statements.

It will atleast help in knowing where actually its failing.

Scott M - SFDC FanScott M - SFDC Fan
I wish I could properly format the code. I have an issue using these forums, as everything is screwed up. I only see everything centered. It is really crap. Not sure what is wrong. I have actually added alerts into the code to find the problem. But it doesn't help, when IE doesn't create an object. I've actually found the solution in another forum post. It has to do with the iframe for the visual page being called from force.com server and not from the sandbox server. So I added *.force.com to my trusted sites and now it works. This is something SF should think about. Scott
yvk431yvk431

Hi scamo, any updates on this, me too stuck with the same issue while converting an S-Control to visual force.

 

 

--yvk