I am trying to achieve to call webservice from force.com sites to salesforce providing sessionid such that i will be able to do that logic using that user see below web service

global class Webupdateopportunity {

    webService static Id QTC(String opid) {

    system.debug('opp id here'+opid);
    opportunity p = [select id,Create_Order__c From opportunity Where id=:opid];

    update p;
    return p.id;


can any one please suggest me the sample class to call this service from apex class providing session id

  • can any one please reply #apexclass – Kumar Gone Apr 9 '16 at 16:52

Sites users don't have ability to update standard objects. I believe the reason for this is to prevent solutions that avoid purchasing Sales Cloud or Service Cloud licenses.

There are some workarounds proposed by others:

  1. Update a custom object that behind-the-scenes, mirrors to a standard object or, a more complete answer from SFSE relying on without sharing.

  2. Call a REST service using some predefined user/pw

I imagine that #2 could be adapted by using invoking a SOAP service in a similar way

  • i appreciate your response thankyou so much do we a sample class for the #2 that helps me. – Kumar Gone Apr 11 '16 at 0:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.