• Nike
  • NEWBIE
  • 0 Points
  • Member since 2009

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

How to get the cookies of the iframe inside my vf page. as now am getting the salsforce session/client etc.

 

vf Code:

 

<apex:form >
<apex:iframe src="my third party url">
 <script type="text/javascript" id="refreshArea">
var getCookies = function(){
  var pairs = document.cookie.split(";");
  alert(pairs);
  var cookies = {};
  for (var i=0; i<pairs.length; i++){
    var pair = pairs[i].split("=");
    cookies[pair[0]] = unescape(pair[1]);
  }
  return cookies;
}
var myCookies = getCookies();
</script>
<apex:actionFunction name="refreshArea" oncomplete="getCookies();"/>
</apex:iframe>
</apex:form>

  • December 04, 2012
  • Like
  • 0

Am getting the following error in POST http method.

 

Error: CSRF token validation failed and System.HttpResponse[Status=Forbidden, StatusCode=403]"|0x43de18c1

 

I have two http request, 1. GET and 2. POST. Please review my code below and let me know where am missing.

 

GET:

    Http h = new Http();
    // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
    HttpRequest req = new HttpRequest();
    req.setHeader('Content-Type', 'application/atom+xml');    
    req.setHeader('x-csrf-token', 'fetch');
    req.setHeader('Authorization', 'BASIC ' + EncodingUtil.base64Encode(Blob.valueOf('username:pasword')));
    req.setMethod('GET');
    req.setEndpoint(url1);
    HttpResponse res = h.send(req);


POST: Using the above response and passing the CSRF token to my POST method,


        req.setHeader('Content-Type', 'application/atom+xml');
        req.setHeader('X-CSRF-Token',maptoken.get('x-csrf-token'));   
        req.setHeader('Authorization', 'BASIC ' + EncodingUtil.base64Encode(Blob.valueOf('username:pasword')));
        req.setMethod('POST');
        req.setEndpoint(url2);     
        req.setBody('xml hard coded');
        HttpResponse ires = h.send(req);

  • November 27, 2012
  • Like
  • 0

Is there any way to show/hide fields depends on another field value without using any visualforce page or recordtype with another pagelayout.

 

I am not sure , we can do this by home page components and javascripts?

 

let me know your thoughts!

 

 

Thanks

  • July 13, 2011
  • Like
  • 0
Hello,

Here, Iam copying the campaign members to its parent campaign but its fail on bulk insert.

below are the Code:

Awaiting for your suggestions.

trigger RollupParentCampaign on CampaignMember (After insert, After update) {
    
    List<CampaignMember> lstcampmembercreate = new List<CampaignMember>();    
    List<CampaignMember> lstchildcamp = new List<CampaignMember>();
    Set<Id> setCampaignId = new Set<Id>();  
    
    for(CampaignMember irow: Trigger.new)
    {   
        if(irow.ParentCampaignId__c != null && irow.ReollupCampaignMember__c == 'True')
        {
            setCampaignId.add(irow.CampaignId);    
        }
    }    
    
    if(setCampaignId != null)
    {
        lstchildcamp = [Select Id,ParentCampaignId__c,CampaignId,ContactId,LeadId,Status
            from CampaignMember where CampaignId IN:setCampaignId];       
    }
                        
    for(CampaignMember childcamp : lstchildcamp)    // Retrieve the list of childcampaign members     
    {        
        CampaignMember newcampmemb = new CampaignMember();        
        newcampmemb.CampaignId = childcamp.ParentCampaignId__c;
        newcampmemb.Status = childcamp.Status;
    
        if(childcamp.LeadId != null)
        {
            newcampmemb.LeadId = childcamp.LeadId;
        }
    
        else if(childcamp.ContactId != null)
        {
            newcampmemb.ContactId = childcamp.ContactId;
        }        
    
        lstcampmembercreate.add(newcampmemb);    
    }

    if(lstcampmembercreate.size() > 0)
    {
        try {
        
        database.insert(lstcampmembercreate,false);    // move childcampaignmembers to parantcampaign members
        
        }
        catch (Exception e)
        {
            System.assertEquals('Error: ', e.getMessage());
        }
    }         
}

Thanks
  • July 11, 2011
  • Like
  • 0

Dear All,

 

We would like to integrate our VOIP service (for call recording and storing). The list of softphones software - XLITE & EYE BEAM. We would like to integrate the same with SalesForce. VOIP providers are Pulse, WorldSmart.

 

Please help me on this.

 

Regards,

Ganu

  • June 29, 2010
  • Like
  • 0

While performing the standard button 'Find duplicates' in the lead page. I want to know/update a field when a record gets merged.

 

Thanks,

Ganu

  • August 06, 2009
  • Like
  • 0


I have created visual force page using standard controller, In that I have a multipicklist and this should reflect the value based upon the recordtype in contact sobject. I know there are no such options in Vforce page. so i tried hardcoding the value using javascript but Iam not able to call the multiselect picklist in the script function.

Please give your suggestion.

 

Vforce Page: <apex:page standardController="Contact"> <apex:form > <apex:pageBlock title="Try" mode="Edit"> <apex:pageBlockSection title="Try It Again "> <apex:pageBlockSectionItem id="sec_Rank"> <apex:outputLabel >Rank</apex:outputLabel> <apex:inputField value="{!Contact.Rank__c}" id="Rank" onchange="javascript&colon;change()"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> <script language='JavaScript'> change(); function change() { try{ alert('{!$Component.Rank}'); }catch(e);{alert(e);} } </script> </apex:page>

 Thanks

 

  • July 22, 2009
  • Like
  • 0

Am getting the following error in POST http method.

 

Error: CSRF token validation failed and System.HttpResponse[Status=Forbidden, StatusCode=403]"|0x43de18c1

 

I have two http request, 1. GET and 2. POST. Please review my code below and let me know where am missing.

 

GET:

    Http h = new Http();
    // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
    HttpRequest req = new HttpRequest();
    req.setHeader('Content-Type', 'application/atom+xml');    
    req.setHeader('x-csrf-token', 'fetch');
    req.setHeader('Authorization', 'BASIC ' + EncodingUtil.base64Encode(Blob.valueOf('username:pasword')));
    req.setMethod('GET');
    req.setEndpoint(url1);
    HttpResponse res = h.send(req);


POST: Using the above response and passing the CSRF token to my POST method,


        req.setHeader('Content-Type', 'application/atom+xml');
        req.setHeader('X-CSRF-Token',maptoken.get('x-csrf-token'));   
        req.setHeader('Authorization', 'BASIC ' + EncodingUtil.base64Encode(Blob.valueOf('username:pasword')));
        req.setMethod('POST');
        req.setEndpoint(url2);     
        req.setBody('xml hard coded');
        HttpResponse ires = h.send(req);

  • November 27, 2012
  • Like
  • 0

Is there any way to show/hide fields depends on another field value without using any visualforce page or recordtype with another pagelayout.

 

I am not sure , we can do this by home page components and javascripts?

 

let me know your thoughts!

 

 

Thanks

  • July 13, 2011
  • Like
  • 0
Hello,

Here, Iam copying the campaign members to its parent campaign but its fail on bulk insert.

below are the Code:

Awaiting for your suggestions.

trigger RollupParentCampaign on CampaignMember (After insert, After update) {
    
    List<CampaignMember> lstcampmembercreate = new List<CampaignMember>();    
    List<CampaignMember> lstchildcamp = new List<CampaignMember>();
    Set<Id> setCampaignId = new Set<Id>();  
    
    for(CampaignMember irow: Trigger.new)
    {   
        if(irow.ParentCampaignId__c != null && irow.ReollupCampaignMember__c == 'True')
        {
            setCampaignId.add(irow.CampaignId);    
        }
    }    
    
    if(setCampaignId != null)
    {
        lstchildcamp = [Select Id,ParentCampaignId__c,CampaignId,ContactId,LeadId,Status
            from CampaignMember where CampaignId IN:setCampaignId];       
    }
                        
    for(CampaignMember childcamp : lstchildcamp)    // Retrieve the list of childcampaign members     
    {        
        CampaignMember newcampmemb = new CampaignMember();        
        newcampmemb.CampaignId = childcamp.ParentCampaignId__c;
        newcampmemb.Status = childcamp.Status;
    
        if(childcamp.LeadId != null)
        {
            newcampmemb.LeadId = childcamp.LeadId;
        }
    
        else if(childcamp.ContactId != null)
        {
            newcampmemb.ContactId = childcamp.ContactId;
        }        
    
        lstcampmembercreate.add(newcampmemb);    
    }

    if(lstcampmembercreate.size() > 0)
    {
        try {
        
        database.insert(lstcampmembercreate,false);    // move childcampaignmembers to parantcampaign members
        
        }
        catch (Exception e)
        {
            System.assertEquals('Error: ', e.getMessage());
        }
    }         
}

Thanks
  • July 11, 2011
  • Like
  • 0

 

 

I have to use the CTI demo adapter to customize the Siemens CTI System (ProCenter). According to install the CTI toolkit 3.0, It provides the Cisco CTI adapter Code as well. 

 

As mentioned above, Could i use the Cisco CTI apater code as the source to customize for using in the ProCenter CTI?How much effort to cusomize the code? It would be better than using the CTI demo adapter code provided by salesforce... right?

 

please any one give me some suggestion.

 

Best Regards,

Louis


I have created visual force page using standard controller, In that I have a multipicklist and this should reflect the value based upon the recordtype in contact sobject. I know there are no such options in Vforce page. so i tried hardcoding the value using javascript but Iam not able to call the multiselect picklist in the script function.

Please give your suggestion.

 

Vforce Page: <apex:page standardController="Contact"> <apex:form > <apex:pageBlock title="Try" mode="Edit"> <apex:pageBlockSection title="Try It Again "> <apex:pageBlockSectionItem id="sec_Rank"> <apex:outputLabel >Rank</apex:outputLabel> <apex:inputField value="{!Contact.Rank__c}" id="Rank" onchange="javascript&colon;change()"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> <script language='JavaScript'> change(); function change() { try{ alert('{!$Component.Rank}'); }catch(e);{alert(e);} } </script> </apex:page>

 Thanks

 

  • July 22, 2009
  • Like
  • 0