• devel1
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

In my scontrol, initially I use following statement to initialize the scontrol

 

sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_70}",true);

 

Then I will query for different things and everything looks great. At particular point of time, I need switch to different user has having more permission to save record.  So I use following line to login

 

sforceClient.init(null, null, false);

sforceClient.setLoginUrl('{!API_Partner_Server_URL_70}');

var loginResult = sforceClient.login(usernameName, userpwdPwd);  //I used some mechanism to hide the userid and password

 

Login work fine , But when I tried update the record  I get the "Permission Denied" error because of ‘trying to get the data from across domain’ issue. I am trying to save the record in sales forces and I am not trying to access different domain. By enabling 'Access data sources across domains' option in IE, work fine.

 

I tried debug more on this and I think found an answer.

 

The URL from sforeceClient (sforceClient.getUrl()) before sforceClient.login (usernameName, userpwdPwd) = https://tapp0.salesforce.com/services/Soap/u/7.0?nocache=1345677777

 

The URL from sforeceClient (sforceClient.getUrl()) after sforceClient.login (usernameName, userpwdPwd) =

 https://tapp0-api.salesforce.com/services/Soap/u/7.0?nocache=1345677777

 

I don’t know why salesforce is returning different url and I think because of this I am getting permission denied error.

I store the old URL before login and used it later ( sforceClient.setURL(oldURl)), everything worked like a rock.

 

Please let me know, what Iam doing is valid one? Any suggesion is really appreciated.. It took solid half a day to figure out this problem.

 

Thanks

Raj

 

  • August 10, 2006
  • Like
  • 0
I've scoured the sforceclient 3.3 source… I cannot find the javascript equivalent of

// Create assignment rule
AssignmentRuleHeader assignment = new AssignmentRuleHeader();
assignment.useDefaultRule = true;
sf.AssignmentRuleHeaderValue = assignment;

I'm trying to fire off an assignment rule while updating a case record.

-=Bryan