• IMDEV
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am using a SControl(this scontrol calls a APEX class which creates a XML ,sends it as an request to an external application,recieves the response in XML format,Parses the XML and returns the desired result to the SControl) from a Custom button and its working fine.
But when i try to use the same scontrol from a HYPERLINK(this hyperlink calls the SControl) then its showing 'Invalid session id found in sessionHeader:Illegal Session' error.

Scontrol code:

<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/12.0/connection.js"></script>
<script src="/soap/ajax/12.0/apex.js"></script>
<script>
try
{
var ccno1 = "{!Credit_Card_Payment__c.Credit_Card_Payment__c}";
var amt1 = "{!Credit_Card_Payment__c.Amount__c}";
var stdate1 = "{!Credit_Card_Payment__c.Start_Date__c}";
var expdate1 = "{!Credit_Card_Payment__c.Expiry_Date__c}";
var srtadd11 = "{!Credit_Card_Payment__c.Street_Adress_1__c}";
var stradd21 = "{!Credit_Card_Payment__c.Street_Adress_2__c}";
var pcode1 = "{!Credit_Card_Payment__c.Post_Code__c}";
var mrRef1 = "{!Credit_Card_Payment__c.Merchant_Referance__c}";
var curr1 = "{!Credit_Card_Payment__c.Currency__c}";
//calling a APEX Class which takes all these parameters ,Creates an XML in a specific format, sends the request to a external server and returns a XML response)

var result1 = sforce.apex.execute('HTTPReqRes' , 'HTTPrr',{ccno:ccno1,amt:amt1,expdate:expdate1,stdate:stdate1,srtadd1:srtadd11,stradd2:stradd21,pcode:pcode1,mrRef:mrRef1,curr:curr1});


window.parent.location.href="{!URLFOR( $Action.Credit_Card_Payment__c.View,Credit_Card_Payment__c.Id,null, true)}";
}
catch(err)
{
alert(err);
}
</script>

HYPERLINK code:
//this hyperlink is calling the above shown scontrol and is thorowing an error on the line where the scontrol is calling the APEX class.
HYPERLINK("/servlet/servlet.Integration?lid=01N80000000F4B9&eid="&Id,IMAGE("/servlet/servlet.FileDownload?file=01580000000UHBZ","Submit"))

Any help regarding this would be highly appreciated.

Thanks
  • November 24, 2008
  • Like
  • 0
I am getting error
 
"syntax error on token "enum", class expected. and "org.apache.axis cannot be resolved to a type"
 
using JDK 6 then i changed it to 1.4 - but switched the error to
 

Syntax error, 'for each' statements are only available if source level is 5.0

 
Any help please!