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
gudduguddu 

Getting error when i run custom link having s-control

hello,
i am using sforce API 6.0 and asp.net using c#.
I have added one custom link to account page .This custom link is created using
s-control. when i click on this custom link i got error like - object doesn't support this property or method. i have written html body i.e. java script when i created scontrol.
in this html body i have called webservices of my project.
when i write same java script in outside explorer page it works finely.
can anyone tell me solution on this .


thanx.
DevAngelDevAngel
Hi guddu,

More information is needed. Can you post the contents of your sControl?

HINT: and a textarea tag to your post using the HTML Editor mode. Switch to Graphical Editor mode and resize your textarea and paste the contents of your scontrol into the textarea.
gudduguddu
hello ,
thanx for the reply.
actually i have called my webservice in javascript.for that webservice.htc file is required. i can not put this webservice.htc file in the html body of the s-control.
thats why i am getting error , i think.
what i have to do , i have to call sforce API in the jaascript of html body in scontrol.

here is my code in the html body of scontrol. plz suggest me the solution















gudduguddu

<html>

 <head>
 <script language="JavaScript">
 var iCallID = 0;

function init()
  {
 //alert("hi");

 service.useService("http://localhost/SalesProject/Service1.asmx?WSDL","MyMath");
                     // alert("hi");
   iCallID = service.MyMath.callService(mathResults,"QuerySample");
 
                    
   }

 


function mathResults(result) {
  if(result.error) {
    var xfaultcode   = result.errorDetail.code;
    var xfaultstring = result.errorDetail.string;
    var xfaultsoap   = result.errorDetail.raw;
    alert(xfaultstring);
  } else{
 alert(result.value);
      if(result.value=="A103"){
   window.open ("http://localhost/SalesProject/Login.aspx",
"mywindow","menubar=1,resizable=1,width=1000,height=650");
}

 else
 {


   window.open ("http://localhost/SalesProject/Welcome.aspx",
  "mywindow","menubar=1,resizable=1,width=1000,height=650");

 
}

 


     
    }

 
}
 


</script>

</head>

<body onload="init()">

<DIV ID="service" style="behavior:url(webservice.htc)" >
</DIV>

</body>

</html>

DevAngelDevAngel
If you are making your call from javascript, why not use the AJAX toolkit? http://blog.sforce.com/sforce/2005/07/ajax_toolkit.html

Message Edited by DevAngel on 11-10-2005 08:39 AM