• Janardhana Reddy
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 15
    Questions
  • 20
    Replies
HI All,
How to call Paypal Refund transaction() Method from apex class.
am new to paypal.
please help me
Hi All,
I am running test classes in my production Org, for some Classes it showing 0% Coverage for some classes it showing 97%.
The same test class tried run in my sandbox it showing code coverage for all classes.
Can any one tell me how to solve this Issue.
Hi All,
Manage Link on my Communities is not clickable, How to make it as clickable.
Please help me
Hi All,
I was created Custom Link on sidebar(by using site URL), When i was accessing the link getting Limit Exceeded Error.
How to Over come this problem? 
Please help me in this
Hi ,
I was created rest api class below...

@RestResource(urlMapping='/sample controller/*')
global with sharing class RESTController {

  @HttpGet
  global static List<Campaign> getContacts() {
    RestRequest req = RestContext.request;
    RestResponse res = RestContext.response;
    
    String contactId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
    try{
    
    list<Campaign> camp = [SELECT id,parentid,name,program_grade_level__c,council_code__c,account__C FROM campaign WHERE id IN (SELECT campaignid from campaignmember where contactid=: contactId and active__c = true) AND job_code__c = 'DP' and Program_Grade_Level__c IN ('1-Daisy','2-Brownie','3-Junior')];
    return camp;
    }Catch(exception e){
     return null;   
    }
    
  }
}


when i am testing class through postman client getting error Session expired or invalid session.

Can help me how to solve this please.
Hi,
how to implement pagination on datatable.

Please help me
How to get FIles from Document object through apex coding .
Any one help please
Can any one help on how to do integration Sertifi API integration with salesforce
I Created Auth. Provider for Salesforce integrate with facebook. Every thing is fine,but when creating contact i need to get the user age information.
Auth.UserData Method is not getting the age from External user. Is there any way to get the age range from facebook user to salesforce user/contact.
Any one please help me
My requirement is user can login from facebook into the salesforce customer portal.
I followed th instruction given in the URL below.
https://help.salesforce.com/HTViewHelpDoc?id=sso_provider_facebook.htm&language=en_US#sso_provider_facebook
user not created in salesforce.
help me any one please.
I Written Controller for getting campaigns based on login user, am getting the list of values but am unable to view the details in vfpage in customer portal.
Can any one help me please
Displaying Contact related Tasks on Customer Portal Home page.
I am not getting the Tasks on Portal Home page can any one help me
i was written soql query in my batch class
select id,Status,Stage,WhoId from Task where Whoid =: ContactId and Status =: 'Completed'
 the query not getting tasks for contact
please help me
workflow email template sending blank email to the recipient .
Please can anyone  suggest me the way to get out of this problem
public class Contactemail {

    
    public Contact Contact;
    public ID contactId{get;set;}
    public List<Account> accountList;
   
    public Contactemail(){
    }
   
    public Contact getContact() {
   
    if (this.Contact == null && this.contactId != null) {
       this.Contact = [Select Id,Name,FirstName,VolunteerPage1URL__c,Owner.Name,Owner.Title,Owner.Email,Owner.Phone from contact where id = :this.contactId];
    }
   
  
    return this.Contact;
    }
  
    public List<Account> getAccountList() {
  
    List<contact> zipList = [select mailingpostalcode
                      From Contact
                      where Id =: ContactId
                    Limit 1];
     
       system.debug('zipList ==>'+zipList);
       Set<String>zipId = new Set<String>();
       for(Contact zip:zipList){
        zipId.add(zip.mailingpostalcode);
       }
      
       List<Zip_Code__c> councilList = [select id,Council__c
                       from Zip_Code__c
                       where Name =:zipId
                      Limit 1];
      
       Set<Id>councilId = new Set<Id>();
       for(Zip_Code__c zip:councilList){
        councilId.add(zip.Council__c);
       }
       system.debug('councilList ==>'+councilList);
       accountList = new List<Account>();
       this.accountList = [
            Select Id                
                 , Council_Header__c
                 , Council_Header_Url__c
                 , Council_Email__c
                 , Phone
                 , Name
              From Account
             where Id = :councilId
             limit 1
        ];
     return this.accountList;
   }

}
My requirement is user can login from facebook into the salesforce customer portal.
I followed th instruction given in the URL below.
https://help.salesforce.com/HTViewHelpDoc?id=sso_provider_facebook.htm&language=en_US#sso_provider_facebook
user not created in salesforce.
help me any one please.
HI All,
How to call Paypal Refund transaction() Method from apex class.
am new to paypal.
please help me
Hi All,
I am running test classes in my production Org, for some Classes it showing 0% Coverage for some classes it showing 97%.
The same test class tried run in my sandbox it showing code coverage for all classes.
Can any one tell me how to solve this Issue.
Hi All,
I was created Custom Link on sidebar(by using site URL), When i was accessing the link getting Limit Exceeded Error.
How to Over come this problem? 
Please help me in this
Can any one help on how to do integration Sertifi API integration with salesforce
My requirement is user can login from facebook into the salesforce customer portal.
I followed th instruction given in the URL below.
https://help.salesforce.com/HTViewHelpDoc?id=sso_provider_facebook.htm&language=en_US#sso_provider_facebook
user not created in salesforce.
help me any one please.
I Written Controller for getting campaigns based on login user, am getting the list of values but am unable to view the details in vfpage in customer portal.
Can any one help me please
Displaying Contact related Tasks on Customer Portal Home page.
I am not getting the Tasks on Portal Home page can any one help me
i was written soql query in my batch class
select id,Status,Stage,WhoId from Task where Whoid =: ContactId and Status =: 'Completed'
 the query not getting tasks for contact
please help me
public class Contactemail {

    
    public Contact Contact;
    public ID contactId{get;set;}
    public List<Account> accountList;
   
    public Contactemail(){
    }
   
    public Contact getContact() {
   
    if (this.Contact == null && this.contactId != null) {
       this.Contact = [Select Id,Name,FirstName,VolunteerPage1URL__c,Owner.Name,Owner.Title,Owner.Email,Owner.Phone from contact where id = :this.contactId];
    }
   
  
    return this.Contact;
    }
  
    public List<Account> getAccountList() {
  
    List<contact> zipList = [select mailingpostalcode
                      From Contact
                      where Id =: ContactId
                    Limit 1];
     
       system.debug('zipList ==>'+zipList);
       Set<String>zipId = new Set<String>();
       for(Contact zip:zipList){
        zipId.add(zip.mailingpostalcode);
       }
      
       List<Zip_Code__c> councilList = [select id,Council__c
                       from Zip_Code__c
                       where Name =:zipId
                      Limit 1];
      
       Set<Id>councilId = new Set<Id>();
       for(Zip_Code__c zip:councilList){
        councilId.add(zip.Council__c);
       }
       system.debug('councilList ==>'+councilList);
       accountList = new List<Account>();
       this.accountList = [
            Select Id                
                 , Council_Header__c
                 , Council_Header_Url__c
                 , Council_Email__c
                 , Phone
                 , Name
              From Account
             where Id = :councilId
             limit 1
        ];
     return this.accountList;
   }

}
The documentation at http://developer.chatter7bk.com/docs/atlas.en-us.salesforce1api.meta/salesforce1api/live_agent_creating_records_prechat_API_doCreate.htm gives the example of a contact and http://peterknolle.com/live-agent-pre-chat-api/ gives some really good code examples (again for contacts) but my org is using person accounts almost exclusively. Does it work with person accounts and does anybody know the syntax?

I am trying to setup SSO for Salesforce Communities where the Auth Provider is Salesforce.  So, Salesforce users from other org will be signing on to my Communities pages.  I have followed mostly the steps described in this article (http://wiki.developerforce.com/page/Salesforce_as_an_Identity_Provider_for_Customer_Portal).

 

I have a Connected App to get the Consumer Key, Secret, and Callback URL.  I then setup an Auth Provider as Salesforce and for the RegistrationHandler, I clicked the option to "Automatically create a registration handler template".  The resulting Class was created.  I'm not fluent in APEX, so I don't know if this code alone should work or if it requires modification.  Note in all cases for my SSO, the person logging into my Community will already have been given Community access and Community User will exist, so I don't need the Handler to create a user; just find one.

 

The error I'm getting when the person tries to connect is...

 

 
I thought perhaps I didn't need the Handler, but when I take it out the error is...
 

 

 

//TODO:This autogenerated class includes the basics for a Registration
//Handler class. You will need to customize it to ensure it meets your needs and
//the data provided by the third party.

global class AutocreatedRegHandler1384140305788 implements Auth.RegistrationHandler{
global boolean canCreateUser(Auth.UserData data) {
  //TODO: Check whether we want to allow creation of a user with this data
  //Set<String> s = new Set<String>{'usernamea', 'usernameb', 'usernamec'};
  //if(s.contains(data.username)) {
    //return true;
  //}
  return false;
}

global User createUser(Id portalId, Auth.UserData data){
  if(!canCreateUser(data)) {
    //Returning null or throwing an exception fails the SSO flow
    return null;
  }
  if(data.attributeMap.containsKey('sfdc_networkid')) {
    //We have a community id, so create a user with community access
    //TODO: Get an actual account
    Account a = [SELECT Id FROM account WHERE name='Acme'];
    Contact c = new Contact();
    c.accountId = a.Id;
    c.email = data.email;
    c.firstName = data.firstName;
    c.lastName = data.lastName;
    insert(c);

    //TODO: Customize the username and profile. Also check that the username doesn't already exist and
    //possibly ensure there are enough org licenses to create a user. Must be 80 characters or less.
    User u = new User();
    Profile p = [SELECT Id FROM profile WHERE name='Customer Portal User'];
    u.username = data.username + '@acmecorp.com';
    u.email = data.email;
    u.lastName = data.lastName;
    u.firstName = data.firstName;
    String alias = data.username;
    //Alias must be 8 characters or less
    if(alias.length() > 8) {
      alias = alias.substring(0, 8);
    }
    u.alias = alias;
    u.languagelocalekey = UserInfo.getLocale();
    u.localesidkey = UserInfo.getLocale();
    u.emailEncodingKey = 'UTF-8';
    u.timeZoneSidKey = 'America/Los_Angeles';
    u.profileId = p.Id;
    u.contactId = c.Id;
    return u;
  } else {
    //This is not a community, so create a regular standard user
    User u = new User();
    Profile p = [SELECT Id FROM profile WHERE name='Standard User'];
    //TODO: Customize the username. Also check that the username doesn't already exist and
    //possibly ensure there are enough org licenses to create a user. Must be 80 characters
    //or less.
    u.username = data.username + '@myorg.com';
    u.email = data.email;
    u.lastName = data.lastName;
    u.firstName = data.firstName;
    String alias = data.username;
    //Alias must be 8 characters or less
    if(alias.length() > 8) {
      alias = alias.substring(0, 8);
    }
    u.alias = alias;
    u.languagelocalekey = UserInfo.getLocale();
    u.localesidkey = UserInfo.getLocale();
    u.emailEncodingKey = 'UTF-8';
    u.timeZoneSidKey = 'America/Los_Angeles';
    u.profileId = p.Id;
    return u;
  }
}

global void updateUser(Id userId, Id portalId, Auth.UserData data){
  User u = new User(id=userId);
  //TODO: Customize the username. Must be 80 characters or less.
  //u.username = data.username + '@myorg.com';
  u.email = data.email;
  u.lastName = data.lastName;
  u.firstName = data.firstName;
  //String alias = data.username;
  //Alias must be 8 characters or less
  //if(alias.length() > 8) {
    //alias = alias.substring(0, 8);
  //}
  //u.alias = alias;
  update(u);
}
}