• anuraj123
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
Hi, I am using facebook toolkit provided by salesforce. when i try to connect salesforce with facebook i am getting an error with access token field.

Insert failed. First exception on row 0; first error: STRING_TOO_LONG, AccessToken: data value too large: 4f6y5ZuvyhwlBg9ox8mBUIH4IspRMZkyxifKRLJx6hybq4euehIZCsZ5t99Cv5BUKDUdSHc6aFUsGao7M/RWxyhfx2lAgZy/M1rBrYdvi8oNqoz3rJVmpIJ8RTKkZ1Yk167gnrYIi2/tHkAMA/IiJLBjN9ayxyO26tnyyLNPAePnJvww/Xkf4VVxNxYGukdsZ42OFHEP+Sj4RFyH+7YDvzh3mix3T+QFRVxKXdpDyL8myD+e8eW4spKaN6qoQ/hwOHZLfuzMBARrsNW0Ws= (max length=255): [AccessToken__c]



this error happens when setAccessToken method in FacebookToken class try to inert FacebookSession__c.

insert new FacebookSession__c(AccessToken__c = FacebookCrypto.encrypt(accessToken), SessionId__c = sessionId, Expiry__c = DateTime.now().addSeconds(expires));



can anybody here guide me what is the solution why the size of AccessToken__c is to high. Anything which i am doing wrong.

Thanks
Anu
HI,
I have created a VF page and extensions for VF page a extension. I am using custom object as standardController and create a filed set in the object which i am using in the VF page. On this VF page after entering the values in the fields they can upload file and hit save. This portion is done by the extensions. And add the page as the home page of the site after installing to a env (Managed package). But hit save after entering the values and uploading the file it throws an error - Class is not visible. This same happens if it is accessed by the administrator. So i converted the package as unmanaged and installed it again in the same env. Here this time it works. I have made the same setting for the managed and unmanged package but for managed it dose't works. The fields , object and VF page is visible to the 'User License Guest'. But when i click on edit for 'Enabled Apex Class Access' the class is not found for managed package.

My class and VF page code:

class:
public with sharing class ctrl_Candidate_Site{


public Candidates__c ca_Insert {get; set;} // For inserting Candidates records
public blob Attach {get;set;}  // For attaching Resume to the specific record
public String fileName {get; set;}
public Attachment a {get; set;}
public Id jobID {get; set;}// To get the ID from URL
public Boolean isSaved{get; set;}// To know is saved successfully

public ctrl_Candidate_Site(ApexPages.StandardController stdController){   
    ca_Insert = new Candidates__c();
    ca_Insert = (Candidates__c)stdController.getRecord(); // getting records from VF page
    jobID = ApexPages.currentPage().getParameters().get('jobId'); // Getting the jobId from URL  
    a = new Attachment(); 
}

public PageReference SaveResult(){

    ca_Insert.Name = ca_Insert.First_Name__c + ' ' +ca_Insert.Last_Name__c;
    if(jobID != null ){
        ca_Insert.Position__c = jobID;
    }

    Savepoint sp = Database.setSavepoint();
    Database.SaveResult sr = Database.insert(ca_Insert , false);

    //insert ca_Insert;

     if(sr.isSuccess() ){
        system.debug('Attachment value and inside is Success ' + Attach);
        if(Attach  != null){                   
              a.Body=Attach; 
              a.Name=filename;                
              a.ParentID=sr.id;
             // a.ParentId = ca_Insert.id;
              system.debug('Inside Is Success before attachmant get added ' + a );

              try {
                 if(a != null){
                    insert a;
                    isSaved = true;
                }                
             }     
             catch(System.DMLException e) {
                Database.rollback(sp);
                ca_Insert.clear();
                system.debug('If attachmant save have issues ' + e);
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Not able to attach your Resume. Resume format should be doc, docx, txt, pdf.');
                ApexPages.addMessage(myMsg);            
             }   

        }
        else{
            Database.rollback(sp);
            ca_Insert.clear();
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Please add your resume.');
            ApexPages.addMessage(myMsg);
        }           
    }
   else{
      for(Database.Error err : sr.getErrors()) {
            System.debug('The following error has occurred.');                   
            System.debug('the error ' + err.getStatusCode() + ': ' + err.getMessage());
            System.debug('Account fields that affected this error: ' + err.getFields());

            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'No record get inserted. Please Try again.');
            ApexPages.addMessage(myMsg);
        }
    }


    if(isSaved == true){
        PageReference pr = page.Thank;
        //pr.setRedirect(true);
        system.debug('page url ' + pr);
        return pr;
    }
    else{
        return page.Candidate_Site;
    }
  }



}

VF page:
<apex:page id="Cnd_page1" showHeader="false" title="{!$Label.site.site_login}" standardController="Candidates__c" extensions="ctrl_Candidate_Site">

<apex:pageMessages ></apex:pageMessages>

<style>
    h1{
        font-size:16px;
        padding-left:50px;
        font-family:'trebuchet ms', helvetica, sans-serif;
        color:#3366FF;
        line-height:20px;
    }
    .tableStyle{
        padding-left:50px;
        font-size:14px;
        font-family:'trebuchet ms', helvetica, sans-serif;
        color:#343434;
    }
    .cm_formCss{
         height:100%;
         margin:auto;
         width:960px;


    }
    .tdStyleFirst{
        height:25px;
        margin-bottom:13px;
        margin-left:2px;
        width:50%;
    }
    .tdStyleSecond{
        height:25px;

    }

  </style>
  <script>

    function onComplete() {

        var url = '/apex/Thank';
        window.open(url);
    }
  </script>


  <apex:composition template="{!$Site.Template}" >
  <apex:define name="body" >
    <apex:form id="Cnd_form" >
        <h1>Candidate</h1>
          <table class="tableStyle">             
          <apex:repeat value="{!$ObjectType.Candidates__c.FieldSets.Candidate}" var="f">

                <tr>

                   <td class="tdStyleFirst">
                        <apex:outputText value="{!f.Label}"  />                         
                        <apex:outputText value="*" style="color:red;" rendered="{!OR(f.DBRequired, f.required)}" /></td>
                   <td><apex:inputField value="{!Candidates__c[f]}" required="{!OR(f.DBRequired, f.required)}" />  </td>

                </tr>       

          </apex:repeat>
                  <tr>
                      <td>Attach Resumes</td>
                      <td><apex:inputFile value="{!Attach}" accept="doc, docx, txt, pdf" filesize="1000" filename="{!fileName}"></apex:inputFile> </td>
                  </tr>
                  <tr>
                      <td></td>                         
                      <td> <apex:commandButton action="{!SaveResult}" value="Submit"/>
                           <apex:commandButton action="{!cancel}" value="Reset"/> </td>
                  </tr>

          </table>
    </apex:form>
</apex:define>

I am not able to understand why this dose't work with managed but works with unmanaged. Even admin cannot access the class for managed package. Please guide me to get the solution for this issue.
Thanks
Anu
I am trying to post into multiple groups of linkedin using linkedinAPI

http://api.linkedin.com/v1/groups/{group-id}/posts
This works fine with a single group. I cant find any documentation on posting to multiple groups. I tried using a comma between two group ids but its returning a 400 error.

I wanted to be sure if this can be done or not ?

Linkedin Group API's can be found here https://developer.linkedin.com/documents/groups-api

I do see some third party tools like hootsuite are able to do it. Is it something special that linkedin has provided them or do they also use the same API

This question doesnt seem to be related to salesforce, but my second part of the question is

Assuming that we cant make posts on multiple groups at one instance, I might have to make multiple callouts to make it post on to groups which could very quickly hit the limits of 10 callouts per transaction. There could be a max of 50 groups which i might need to simultaneously post.

What would be the best approach to deal with this scenario? 1. Batch Process ?
Hi,
I have created a site.com and in the site I have added some fields from my custom object to get display on the site.com. In the preview it is working fine but after i publish the site.com i am not able to view the records i am getting an error.

Error We're unable to retrieve your data due to an error.
Please guide me what is the issue.
Thanks

Hi

Can any body please explain me, what is dashboard  in salesforce? And how to use it. If possible please also provide any link available.

 

Thanks

Anu

HI,
I have created a VF page and extensions for VF page a extension. I am using custom object as standardController and create a filed set in the object which i am using in the VF page. On this VF page after entering the values in the fields they can upload file and hit save. This portion is done by the extensions. And add the page as the home page of the site after installing to a env (Managed package). But hit save after entering the values and uploading the file it throws an error - Class is not visible. This same happens if it is accessed by the administrator. So i converted the package as unmanaged and installed it again in the same env. Here this time it works. I have made the same setting for the managed and unmanged package but for managed it dose't works. The fields , object and VF page is visible to the 'User License Guest'. But when i click on edit for 'Enabled Apex Class Access' the class is not found for managed package.

My class and VF page code:

class:
public with sharing class ctrl_Candidate_Site{


public Candidates__c ca_Insert {get; set;} // For inserting Candidates records
public blob Attach {get;set;}  // For attaching Resume to the specific record
public String fileName {get; set;}
public Attachment a {get; set;}
public Id jobID {get; set;}// To get the ID from URL
public Boolean isSaved{get; set;}// To know is saved successfully

public ctrl_Candidate_Site(ApexPages.StandardController stdController){   
    ca_Insert = new Candidates__c();
    ca_Insert = (Candidates__c)stdController.getRecord(); // getting records from VF page
    jobID = ApexPages.currentPage().getParameters().get('jobId'); // Getting the jobId from URL  
    a = new Attachment(); 
}

public PageReference SaveResult(){

    ca_Insert.Name = ca_Insert.First_Name__c + ' ' +ca_Insert.Last_Name__c;
    if(jobID != null ){
        ca_Insert.Position__c = jobID;
    }

    Savepoint sp = Database.setSavepoint();
    Database.SaveResult sr = Database.insert(ca_Insert , false);

    //insert ca_Insert;

     if(sr.isSuccess() ){
        system.debug('Attachment value and inside is Success ' + Attach);
        if(Attach  != null){                   
              a.Body=Attach; 
              a.Name=filename;                
              a.ParentID=sr.id;
             // a.ParentId = ca_Insert.id;
              system.debug('Inside Is Success before attachmant get added ' + a );

              try {
                 if(a != null){
                    insert a;
                    isSaved = true;
                }                
             }     
             catch(System.DMLException e) {
                Database.rollback(sp);
                ca_Insert.clear();
                system.debug('If attachmant save have issues ' + e);
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Not able to attach your Resume. Resume format should be doc, docx, txt, pdf.');
                ApexPages.addMessage(myMsg);            
             }   

        }
        else{
            Database.rollback(sp);
            ca_Insert.clear();
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Please add your resume.');
            ApexPages.addMessage(myMsg);
        }           
    }
   else{
      for(Database.Error err : sr.getErrors()) {
            System.debug('The following error has occurred.');                   
            System.debug('the error ' + err.getStatusCode() + ': ' + err.getMessage());
            System.debug('Account fields that affected this error: ' + err.getFields());

            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'No record get inserted. Please Try again.');
            ApexPages.addMessage(myMsg);
        }
    }


    if(isSaved == true){
        PageReference pr = page.Thank;
        //pr.setRedirect(true);
        system.debug('page url ' + pr);
        return pr;
    }
    else{
        return page.Candidate_Site;
    }
  }



}

VF page:
<apex:page id="Cnd_page1" showHeader="false" title="{!$Label.site.site_login}" standardController="Candidates__c" extensions="ctrl_Candidate_Site">

<apex:pageMessages ></apex:pageMessages>

<style>
    h1{
        font-size:16px;
        padding-left:50px;
        font-family:'trebuchet ms', helvetica, sans-serif;
        color:#3366FF;
        line-height:20px;
    }
    .tableStyle{
        padding-left:50px;
        font-size:14px;
        font-family:'trebuchet ms', helvetica, sans-serif;
        color:#343434;
    }
    .cm_formCss{
         height:100%;
         margin:auto;
         width:960px;


    }
    .tdStyleFirst{
        height:25px;
        margin-bottom:13px;
        margin-left:2px;
        width:50%;
    }
    .tdStyleSecond{
        height:25px;

    }

  </style>
  <script>

    function onComplete() {

        var url = '/apex/Thank';
        window.open(url);
    }
  </script>


  <apex:composition template="{!$Site.Template}" >
  <apex:define name="body" >
    <apex:form id="Cnd_form" >
        <h1>Candidate</h1>
          <table class="tableStyle">             
          <apex:repeat value="{!$ObjectType.Candidates__c.FieldSets.Candidate}" var="f">

                <tr>

                   <td class="tdStyleFirst">
                        <apex:outputText value="{!f.Label}"  />                         
                        <apex:outputText value="*" style="color:red;" rendered="{!OR(f.DBRequired, f.required)}" /></td>
                   <td><apex:inputField value="{!Candidates__c[f]}" required="{!OR(f.DBRequired, f.required)}" />  </td>

                </tr>       

          </apex:repeat>
                  <tr>
                      <td>Attach Resumes</td>
                      <td><apex:inputFile value="{!Attach}" accept="doc, docx, txt, pdf" filesize="1000" filename="{!fileName}"></apex:inputFile> </td>
                  </tr>
                  <tr>
                      <td></td>                         
                      <td> <apex:commandButton action="{!SaveResult}" value="Submit"/>
                           <apex:commandButton action="{!cancel}" value="Reset"/> </td>
                  </tr>

          </table>
    </apex:form>
</apex:define>

I am not able to understand why this dose't work with managed but works with unmanaged. Even admin cannot access the class for managed package. Please guide me to get the solution for this issue.
Thanks
Anu
Hi,
I have created a site.com and in the site I have added some fields from my custom object to get display on the site.com. In the preview it is working fine but after i publish the site.com i am not able to view the records i am getting an error.

Error We're unable to retrieve your data due to an error.
Please guide me what is the issue.
Thanks
Hi, I am using facebook toolkit provided by salesforce. when i try to connect salesforce with facebook i am getting an error with access token field.

Insert failed. First exception on row 0; first error: STRING_TOO_LONG, AccessToken: data value too large: 4f6y5ZuvyhwlBg9ox8mBUIH4IspRMZkyxifKRLJx6hybq4euehIZCsZ5t99Cv5BUKDUdSHc6aFUsGao7M/RWxyhfx2lAgZy/M1rBrYdvi8oNqoz3rJVmpIJ8RTKkZ1Yk167gnrYIi2/tHkAMA/IiJLBjN9ayxyO26tnyyLNPAePnJvww/Xkf4VVxNxYGukdsZ42OFHEP+Sj4RFyH+7YDvzh3mix3T+QFRVxKXdpDyL8myD+e8eW4spKaN6qoQ/hwOHZLfuzMBARrsNW0Ws= (max length=255): [AccessToken__c]



this error happens when setAccessToken method in FacebookToken class try to inert FacebookSession__c.

insert new FacebookSession__c(AccessToken__c = FacebookCrypto.encrypt(accessToken), SessionId__c = sessionId, Expiry__c = DateTime.now().addSeconds(expires));



can anybody here guide me what is the solution why the size of AccessToken__c is to high. Anything which i am doing wrong.

Thanks
Anu
I am trying to post into multiple groups of linkedin using linkedinAPI

http://api.linkedin.com/v1/groups/{group-id}/posts
This works fine with a single group. I cant find any documentation on posting to multiple groups. I tried using a comma between two group ids but its returning a 400 error.

I wanted to be sure if this can be done or not ?

Linkedin Group API's can be found here https://developer.linkedin.com/documents/groups-api

I do see some third party tools like hootsuite are able to do it. Is it something special that linkedin has provided them or do they also use the same API

This question doesnt seem to be related to salesforce, but my second part of the question is

Assuming that we cant make posts on multiple groups at one instance, I might have to make multiple callouts to make it post on to groups which could very quickly hit the limits of 10 callouts per transaction. There could be a max of 50 groups which i might need to simultaneously post.

What would be the best approach to deal with this scenario? 1. Batch Process ?

I am setting Case owner Id as Queue(Group) Id and sending email to all group members belong to same queue set as case owner. To achive this I have created an email alert Workflow using visualforce template and sending the email to all group members but I am unable to customize the SenderDisplayName in visual force template. I want to the above mentioned functionality will work under Customer Portal.

 

Thanks in Advance.

Hi,

I am using a picklist value in the input field based on its values some fields are hidden .

The code is working fine.But the problem is with the design.

The Code is:

Output Label = Incident Type

filed name(picklist)=Incident_Type__c

object name=Incident_Record__c

 

<apex:outputLabel value="Incident Type" for="incident"  />
<apex:actionRegion >
<apex:inputField value="{!Incident_Record__c.Incident_Type__c}" style=""  required="true" id="incident" >
<apex:actionsupport event="onchange" rerender="sec1"/>
</apex:inputfield>
</apex:actionRegion>

 

the output is like:

 

Here Between the label and picklist there is a huge space.How to remove these space?

 

 

On deploy the trigger i am not getting 75% coverge.

 

My triggers looks like

 

trigger MileageCostTrigger on GP_Calc__c (before insert,before update) {
for (GP_Calc__c gp: trigger.new)
{

Milage__c mc = Milage__c.getValues(gp.Program__c);

if(mc != null)
{
gp.Mileage_Costs__c = mc.Miles__c * gp.Mileage__c ;
}


}
}

 

and class looks like

 

@isTest
private class MileageCostTestCase {

static testMethod void myUnitTest() {
Opportunity oppNew = new Opportunity();
oppNew.Name = 'Test Opp';
oppNew.StageName = 'Ticketing';
oppNew.CloseDate = System.now().date();
insert oppNew;


GP_Calc__c gp = new GP_Calc__c();
gp.Program__c = 'AA';
gp.From__c = '1';
gp.To__c= '2';
gp.Tax__c =23;
gp.Mileage__c = 23;
gp.Mileage_Costs__c = 0.0210;
gp.Opportunity__c = oppNew.Id;
insert gp;


Milage__c mc = new Milage__c();
mc.Name ='Anil';
mc.Miles__c = 0.0210;
insert mc;

List<GP_Calc__c> listGp = new List<GP_Calc__c>();
GP_Calc__c gpNew = [SELECT Id, Mileage_Costs__c, Mileage_Cost__c FROM GP_Calc__c WHERE Id =:gp.id];
gpNew.Mileage_Costs__c = mc.Miles__c;
listGp.add(gpNew);

if (listGp != null && !listGp .isEmpty())
{
Database.update(listGp);
}
}
}

   

note: insert oppNew; this line is not coverd 

 

 

Please please help - I have been trying to get my head around this all day 

 

Any help - much apprecaited 

 

Regards