• Rajnisf
  • NEWBIE
  • 59 Points
  • Member since 2013
  • Senior Salesforce developer
  • Intelegencia analytics

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 48
    Questions
  • 96
    Replies
Hi Guys,
I am trying to call standard create new group (CollaborationGroup) action in lightning component for experience builder (Community)
In standard new button once we put group name, access type etc it ask for "Save and Next" button and next page ask to upload group image whereas when i use e.force:createRecord in lightning it display only one screen group name etc and just save button does not show next page to upload group image.

 NewGroup : function (component, event, helper) {
    var createRecordEvent = $A.get("e.force:createRecord");
    createRecordEvent.setParams({
        "entityApiName": "CollaborationGroup"
    });
    createRecordEvent.fire();



Thanks
Hi Guys,

If anyone of you have worked on connectApis please help me to provide the sample code how we can access apex connectApi method in lightning.

I found example code for apex
https://gist.github.com/martyychang/9175b4e9c64cf7a14cd3b1571bf645d4

how can i use this in lightning component?


Thanks
Hi All,

We are facing issue with community selfregister page. Users are facing error upon clicking "Sign up" button
"List has no rows for assignment to SObject"

Sharing rules have been created for Account to be Read only for Guest user profile.

Any insight on this will be helpful.

Thanks
Hi Guys,

Need an urgent help.

<div class="card__categories"> {!item.Categories__c}</div>

In aura iteration i want to display Categories (multi picklist field). Can someone let me know how to replace semi colons with comma in lightning component.

for example :  something like this.. but substitute does not work here...
<div class="card__categories">{!substitute(item.Categories__c, ';', ',')}</div>


Thanks,
Rajni
Hi,
I have created datatable (lightning:datatable) with all users (filter on profile name). now i would like to add
1. Follow button (chatter follow) or link in the same table. is there any way to show in lightning componet.
2. Photourl (i think not possible in datatable)

Thanks!
 
Hi,

My requirement is to gather contact information with files upload on public site (using guest user).

1. My question is can we pre fill the form for guest users if data already exists in salesforce for example if user's first name, last name and email matches with existing data form pre fill rest of the foelds in form (lightning component)
2. File upload -- Lightning:Fileupload doesnot work if we don't have parent id (contact id). any insight on this? or i am thinking of using two pages on first create record and then get the contact id of just created record and pass it as a parent it to files on next page.

Hope i am able to explain.
 
Hi guys,

I have no idea wheter this is possible or not.

I would like to create hybrid app for salesforce communities (community is already build and live). instead of purchasing Mobile publisher we would like to develop this.

i am a salesforce developer and have no idea about mobile apps development.
From trailhead i have downloaded components to start with. can someone please guide me how to start with this. is this doable by sf developer or not?

Thanks
Hi,

I have implemented image slider using https://www.lightningdesignsystem.com/components/carousel/

when i put video in static resource it does not work.. 

any suggestion?

Thanks


 
Hi Guys,

My req is: I would like to create a component where standard object is updating field on contact with matching emails on contact.
They dont have any relationship.

Custom object: ABC
Fields:
Email
URL (more than 1 values)
Standard Object:  Contact
Email:
URL (more than 1 values)

any help. thanks a lot.
Hi
i am using the following code for opportunity link in visualforce email template:
Link to Opportunity: &nbsp; <apex:outputlink value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+relatedTo.Id}"><apex:outputtext value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+relatedTo.Id}"/></apex:outputlink> 
in test email it works fine but in actual email it does not displacy {!ralatedTo.Account.Name} and link is also converting to secure.force.com
 https://abc.secure.force.com/0061K00000bNllxQAC

any help is much appreciated.

Thanks
Hey Guys,

I need help to sync google documents from drive to Salesforce Accounts files.

Thanks,
 
Hi
We are working on integrating salesforce with customized (in dot net/php) third party system which is KPI(key performance indicators) based.
We have to develop third party system.
We need to fetch the user details like how many opportunities he has created,no of calls,no of closed won, no of leads converted etc.
what should be the steps:
Should salesforce dev to give wsdl to the dot net developer? or some other steps also involved. like which apis? or only WSDL file is sufficient.

Thanks in advance for the help!!
 
m trying to callout thru schedulable and batch class...m stuck in  Too many callouts: 101 ...plz help
public class SchedulerForPostApex implements Schedulable{
    public void execute(SchedulableContext sc){
        system.debug('*******Going to call future method ');
        Postbatchclass  batchapex = new Postbatchclass();
        id batchprocessid = Database.executebatch(batchapex,1);
system.debug('Process ID: ' + batchprocessid);
  
        
    }
}

----------------------------------------------------------------------

global class Postbatchclass implements Database.Batchable<sObject>,Database.AllowsCallouts {

Public String query;
    
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        query = 'select id, Name, SOCi_Id__c FROM Account where SOCi_Id__c != null'; //need to define query
        return Database.getQueryLocator(query);

  
    }
     global void execute(Database.BatchableContext BC, List<Account> scope) {
     
         FOR(Account sr : scope){
           PostsRequest.getpostsCalloutResponseContents(sr);
       }
         
      }
      global void finish(Database.BatchableContext BC){
      }
}

-------------------------------------------------------------------------------------------------------------------------

public class PostsRequest { 
    
    private static final String API_KEY = 'apikeyy';     
    
    //@future(callout=true)
    public static void getpostsCalloutResponseContents(Account ac) {  
    Http h;
    HttpRequest req;
    HttpResponse res;

    //String finalResult = '';
    Map<String, List<PostClass>> WrapperPostMap = new Map<String, List<PostClass>>();
    List<Account> alist = [select id, Name, SOCi_Id__c FROM Account where SOCi_Id__c != null];  
    List<PostClass> WrapperPostList = new List<PostClass>(); 
    for (Account a : alist) {
        String result = null;                        
        h=new Http();
        req=new HttpRequest();
        req.setEndpoint('endpoint' + a.SOCi_Id__c + '/get?since=2011-01-01&api_key=' + API_KEY);
        req.setMethod('GET');
        res = h.send(req);
        if(res.getStatusCode() == 200){
            result = res.getBody();
          }        
      
            
        List<Object> resultList = (List<Object>) JSON.deserializeUntyped(res.getBody());              
      
        if(resultList != null){
          for (Object entry : resultList) {
                 WrapperPostList.add((PostClass)(JSON.deserialize(JSON.serialize(entry),PostClass.class)));
            }
          }
                WrapperPostMap.put(a.id, WrapperPostList);
          
                System.debug('The WrapperPostListid List value size is: ' + WrapperPostList.size()); 
      h=null;
        req=null;
        res=null;    
    
      } 
        
         System.debug('The WrapperPostListid List value is: ' + WrapperPostList);
         System.debug('The WrapperPostListid List value size is: ' + WrapperPostList.size());
        
        for (Account a : alist) {                
              makeCallout(WrapperPostMap.get(a.Id), a.id);
          }
        
    }    
  
    public static void makeCallout(List<PostClass> WrapperPostList, String aid) {
        String result = null;       
                  
       
      
             System.debug('The WrapperPostList list is: ' + WrapperPostList); 
        Set<String> postIds = new Set<String>();
        for (PostClass f : WrapperPostList) {
            postIds.add(f.id);
        }

        Map<String, Post__c> posts = new Map<String, Post__c>();
        Map<String, Post__c> newposts = new Map<String, Post__c>();
        for (Post__c p : [
                select Id, Name, SOCi_Post_Id__c
                from Post__c
                where SOCi_Post_Id__c in :postIds
                ]) {
            posts.put(p.SOCi_Post_Id__c, p);
        }


        for (PostClass f : WrapperPostList) {
            Post__c p;
            if (posts.containsKey(f.id)) {
             
            } else {
                
                p = new Post__c(SOCi_Post_Id__c = f.id, Account__c = aid);
                p.Name = f.network +' '+ 'Post';
                p.Date_Scheduled__c = Date.valueOf(f.created_at);
                p.Created_By__c = f.created_by_name;
                p.Post_Date__c = Date.valueOf(f.schedule);
              //  p.Channel__c=f.remote_network_id;
              //  p.Channel__c = [SELECT id from Channel__c where Account__r.SOCi_Id__c =: f.project_id and Type_of_Channel__c =: f.network LIMIT 1].id;
        newposts.put(f.id, p);
            }
            
          
        }

     insert newposts.values();
                     
  }
  
   
    class PostClass {
        public String id;
        public String project_id;
        public String network;
        public String created_by_name;
        public String schedule;
        public String created_at;
       // public String remote_network_id;
        
    }


 
}
  • September 28, 2017
  • Like
  • 0
public class projectrequestnew { 
              
   @future(callout=true)
    public static void getCalloutResponseContents() {
        String result = null;
        //String result_post = null;  
        
    Http h = new Http();
    HttpRequest req = new HttpRequest();
    req.setEndpoint('endpoint');
    
    req.setMethod('GET');
    HttpResponse res = h.send(req);
        if(res.getStatusCode() == 200){
            result = res.getBody();
        } 
        
      
       // to store soci projects    
        List<ResultClass> WrapperProjectList = new List<ResultClass>();
        
        // to map soci projects
        Map<String, Object> projectResult = new Map<String, Object>();
        
        Map<String, Object> mapResult = (Map<String, Object>) JSON.deserializeUntyped(res.getBody());
        List<Object> resultList = (List<Object>)(mapResult.get('projects'));
        if(resultList != null){
        for (Object entry : resultList) {
             WrapperProjectList.add((ResultClass)(JSON.deserialize(JSON.serialize(entry), ResultClass.class)));             
             Map<String, Object> pResult = (Map<String, Object>) entry;
             projectResult.put((String)pResult.get('id'),pResult.get('meta_idx'));
             
        }   
        }     
        
               Set<String> accNames = new Set<String>();
        for (ResultClass f : WrapperProjectList) {
            accNames.add(f.name);
        }

    // map Soci project name with Account name
        Map<String, Account> accounts = new Map<String, Account>();
        for (Account a : [
                select Id, Name
                from Account
                where Name in :accNames
                ]) {
            accounts.put(a.Name, a);
        }
        for (ResultClass f : WrapperProjectList) {
            Account a;
            if (accounts.containsKey(f.name)) {
                a = accounts.get(f.name);
            } else {
                a = new Account(Name = f.name);
                accounts.put(f.name, a);
            }
            a.SOCi_Id__c = f.id;
        }
        upsert accounts.values();
            
            
// create or insert channel     
            
            Set<String> accIds = new Set<String>();
            for (ResultClass f : WrapperProjectList) {
                accIds.add(f.id);
            }
            Map<String, Channel__c> channels = new Map<String, Channel__c>();
            for (Channel__c ch : [
                    select Id, Name , Soci_Channel_ID__c
                    from Channel__c
                    where Account__r.SOCi_Id__c in :accIds
                    ]) {
                channels.put(ch.Soci_Channel_ID__c, ch);
            }
            
                 
   
        for(Integer i = 0; i<WrapperProjectList.size(); i++){              
            ID acid = [SELECT id from Account where SOCi_Id__c =: WrapperProjectList.get(i).id LIMIT 1].id; 
           
            System.debug('The channel sfdc List value is: ' + channels);
            for (ChannelClass f : WrapperProjectList.get(i).networks) {
                Channel__c ch;
                if (channels.containsKey(f.id)) {
                    ch = channels.get(f.id);
                } else {
                    ch = new Channel__c(Soci_Channel_ID__c = f.id, Account__c = acid);
                    channels.put(f.id, ch);
                }
                ch.Name= WrapperProjectList.get(i).name +' '+ f.network;
                
          
                 Map<String, Object> metaResult = (Map<String, Object>) projectResult.get(WrapperProjectList.get(i).id);
                
                if(f.network == 'twitter')
                {
           
                    ch.Link_to_Channel__c = (String) metaResult.get('Twitter');
                }
                else if(f.network == 'LinkedIn')
                {
                 
                    ch.Link_to_Channel__c = (String) metaResult.get('LinkedIn');
                }
                
                else
                {
                    ch.Link_to_Channel__c = '';
                }
                
                ch.Type_of_Channel__c = f.network;                
                }
                    
            System.debug('The channel List value is: ' + channels);                        
       }          
          upsert channels.values();   

              
  }
  
  
    class ResultClass {
        public String id;
        public String account_name;
        public String name;
        public String account_id;
        public MetaidxClass meta_idx;
        public List<ChannelClass> networks;          
    }  
    class MetaidxClass {
        public String LinkedIn;        
        public String Twitter; 
    }

    class ChannelClass {
        public String id;
        public String network;
        public String name;
        public String picture;
        
    }    
    
}
  • September 27, 2017
  • Like
  • 0
Json respone is :

"meta_idx": {
"Account Manager": "Test "
}

In salesforce thru calloutm want to take the value of "Account Manager" and map to custom object field...

{
                    ch.Account_Manager__c = m.Account Manager;
                }

Its not taking Space in between "Account Manager"..
Thanks in advance...
 
  • September 25, 2017
  • Like
  • 0
Here is my flow...and not able to handle more than 50 leads..we are using batch class to update the leads...

flowlookup
  • September 18, 2017
  • Like
  • 0
Hi,
i have to integrate salesforce with 3rd party which provides rest apis endpoint. We need to implement everything in the salesforce end (coding etc)
My requirement is : i have to sync data from 3rd party object obj1 to salesforce Accounts.
for example:
3rd party fields                 Salesforce fields
obj1.name                =        account name
obj1.id                     =         objid

Client wants to first implement the syncing between these objects from 3rd party to salesforce
then the automation process.. (for example : once obj1 record created in 3rd party it comes to salesforce as a new account)

My question is ...can we do the callout without any trigger in salesforce.
Please help
Thanks 
 
  • September 07, 2017
  • Like
  • 0
hi..need a help in query...oh batch class
Error is : unexpected token: ')' 
We would like to move leads currently in the Working or Busy status that do not have completed tasks in the last 30 days to the ABC status.
  • Lead Status = Working, Busy
  • Last Activity Date < Today – 30

We want to scheduale a batch class daily basis...here is the code..
global class Leadinactiveflow implements Database.Batchable<SObject>

{

 global Database.Querylocator start (Database.BatchableContext BC)
  {
         
   String query = 'SELECT Id, Status, LastActivityDate ,(select id, createdDate,status from Tasks )From Lead WHERE Status in (\'Working\', \'Busy\')  AND  (Today() - LastActivityDate) > 30';
   System.debug(query);

      return Database.getQueryLocator(query);          

  }
  global void execute (Database.BatchableContext BC, List <Lead> scope)

  {

   List<Lead> listLead = new List<Lead>();

    for(Lead l : scope)
     {
      
         l.Status = 'ABC';     

      listLead.add(l);

      }

   
         if(!listLead.isEmpty()){
            update listLead;
        } 

  } 

global void finish (Database.BatchableContext BC)

{

}

}
Schedulable class is :
 
global with sharing class SchedulerForBatchApex implements Schedulable

{
    global void execute(SchedulableContext sc)        

  {
      Leadinactiveflow b = new Leadinactiveflow();
      ID BatchID = Database.executeBatch(new Leadinactiveflow(), 200);
  }

Public static void SchedulerMethod() 

    {
    string con_exp='0 0 1 * * ?';

    System.schedule('LeadinactiveflowTest', con_exp, new SchedulerForBatchApex());
                                     
    }   

}


 
  • September 01, 2017
  • Like
  • 0
Hi All,
We have a custom action button in lightning for Lead convert.
Issue is on clicking the convert button (custom) it does not display error message (for example status is mandatory etc). it simply refresh the page with the model box and lead does not convert.
In debug logs .. validation error message is there...
In Lead settings, Require Validation for Converted Leads is also Checked..

Please suggest!!
Thanks

As per the summer'17 release, we have activated this critical update...
https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_forcecom_process_emails.htm

Problem is : we are getting multiple email notifications on triggering the lead assignment rules...

We have used this process : https://automationchampion.com/tag/run-lead-assignment-rules-for-lead-created-from-process/

Thanks in advance!!!
 

Hi Guys,
I am trying to call standard create new group (CollaborationGroup) action in lightning component for experience builder (Community)
In standard new button once we put group name, access type etc it ask for "Save and Next" button and next page ask to upload group image whereas when i use e.force:createRecord in lightning it display only one screen group name etc and just save button does not show next page to upload group image.

 NewGroup : function (component, event, helper) {
    var createRecordEvent = $A.get("e.force:createRecord");
    createRecordEvent.setParams({
        "entityApiName": "CollaborationGroup"
    });
    createRecordEvent.fire();



Thanks
Hi,

My requirement is to gather contact information with files upload on public site (using guest user).

1. My question is can we pre fill the form for guest users if data already exists in salesforce for example if user's first name, last name and email matches with existing data form pre fill rest of the foelds in form (lightning component)
2. File upload -- Lightning:Fileupload doesnot work if we don't have parent id (contact id). any insight on this? or i am thinking of using two pages on first create record and then get the contact id of just created record and pass it as a parent it to files on next page.

Hope i am able to explain.
 

I have created a community in salesforce and i wanted to navigate to other apps when user clicks call or email button. I created a lightning web component and I used href="mailto:(email here)" and href="tel:(phone here)" but this doesn't work if I open the community in salesforce one app. It does work on Desktop and Mobile browsers. What might be the problem here?

Thanks

<a href="tel:(Number here)">
                        <img
                          alt="Phone"
                          src={phonePinkIcon}
                          title="Phone"
                        />
                      </a>
              
                      <a href="mailto:(Email here)">
                        <img
                          alt="Email"
                          src={emailPinkIcon}
                          title="Email"
                        />
                      </a>

 
Hi Friends,

I am implementing image crousel in lightning component but do not want slds-carousel__content (which displays description and title etc) I want to show the full image on crousel.

Is there any way that i can remove the white space from the bottom of the image?

Thanks
m trying to callout thru schedulable and batch class...m stuck in  Too many callouts: 101 ...plz help
public class SchedulerForPostApex implements Schedulable{
    public void execute(SchedulableContext sc){
        system.debug('*******Going to call future method ');
        Postbatchclass  batchapex = new Postbatchclass();
        id batchprocessid = Database.executebatch(batchapex,1);
system.debug('Process ID: ' + batchprocessid);
  
        
    }
}

----------------------------------------------------------------------

global class Postbatchclass implements Database.Batchable<sObject>,Database.AllowsCallouts {

Public String query;
    
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        query = 'select id, Name, SOCi_Id__c FROM Account where SOCi_Id__c != null'; //need to define query
        return Database.getQueryLocator(query);

  
    }
     global void execute(Database.BatchableContext BC, List<Account> scope) {
     
         FOR(Account sr : scope){
           PostsRequest.getpostsCalloutResponseContents(sr);
       }
         
      }
      global void finish(Database.BatchableContext BC){
      }
}

-------------------------------------------------------------------------------------------------------------------------

public class PostsRequest { 
    
    private static final String API_KEY = 'apikeyy';     
    
    //@future(callout=true)
    public static void getpostsCalloutResponseContents(Account ac) {  
    Http h;
    HttpRequest req;
    HttpResponse res;

    //String finalResult = '';
    Map<String, List<PostClass>> WrapperPostMap = new Map<String, List<PostClass>>();
    List<Account> alist = [select id, Name, SOCi_Id__c FROM Account where SOCi_Id__c != null];  
    List<PostClass> WrapperPostList = new List<PostClass>(); 
    for (Account a : alist) {
        String result = null;                        
        h=new Http();
        req=new HttpRequest();
        req.setEndpoint('endpoint' + a.SOCi_Id__c + '/get?since=2011-01-01&api_key=' + API_KEY);
        req.setMethod('GET');
        res = h.send(req);
        if(res.getStatusCode() == 200){
            result = res.getBody();
          }        
      
            
        List<Object> resultList = (List<Object>) JSON.deserializeUntyped(res.getBody());              
      
        if(resultList != null){
          for (Object entry : resultList) {
                 WrapperPostList.add((PostClass)(JSON.deserialize(JSON.serialize(entry),PostClass.class)));
            }
          }
                WrapperPostMap.put(a.id, WrapperPostList);
          
                System.debug('The WrapperPostListid List value size is: ' + WrapperPostList.size()); 
      h=null;
        req=null;
        res=null;    
    
      } 
        
         System.debug('The WrapperPostListid List value is: ' + WrapperPostList);
         System.debug('The WrapperPostListid List value size is: ' + WrapperPostList.size());
        
        for (Account a : alist) {                
              makeCallout(WrapperPostMap.get(a.Id), a.id);
          }
        
    }    
  
    public static void makeCallout(List<PostClass> WrapperPostList, String aid) {
        String result = null;       
                  
       
      
             System.debug('The WrapperPostList list is: ' + WrapperPostList); 
        Set<String> postIds = new Set<String>();
        for (PostClass f : WrapperPostList) {
            postIds.add(f.id);
        }

        Map<String, Post__c> posts = new Map<String, Post__c>();
        Map<String, Post__c> newposts = new Map<String, Post__c>();
        for (Post__c p : [
                select Id, Name, SOCi_Post_Id__c
                from Post__c
                where SOCi_Post_Id__c in :postIds
                ]) {
            posts.put(p.SOCi_Post_Id__c, p);
        }


        for (PostClass f : WrapperPostList) {
            Post__c p;
            if (posts.containsKey(f.id)) {
             
            } else {
                
                p = new Post__c(SOCi_Post_Id__c = f.id, Account__c = aid);
                p.Name = f.network +' '+ 'Post';
                p.Date_Scheduled__c = Date.valueOf(f.created_at);
                p.Created_By__c = f.created_by_name;
                p.Post_Date__c = Date.valueOf(f.schedule);
              //  p.Channel__c=f.remote_network_id;
              //  p.Channel__c = [SELECT id from Channel__c where Account__r.SOCi_Id__c =: f.project_id and Type_of_Channel__c =: f.network LIMIT 1].id;
        newposts.put(f.id, p);
            }
            
          
        }

     insert newposts.values();
                     
  }
  
   
    class PostClass {
        public String id;
        public String project_id;
        public String network;
        public String created_by_name;
        public String schedule;
        public String created_at;
       // public String remote_network_id;
        
    }


 
}
  • September 28, 2017
  • Like
  • 0
public class projectrequestnew { 
              
   @future(callout=true)
    public static void getCalloutResponseContents() {
        String result = null;
        //String result_post = null;  
        
    Http h = new Http();
    HttpRequest req = new HttpRequest();
    req.setEndpoint('endpoint');
    
    req.setMethod('GET');
    HttpResponse res = h.send(req);
        if(res.getStatusCode() == 200){
            result = res.getBody();
        } 
        
      
       // to store soci projects    
        List<ResultClass> WrapperProjectList = new List<ResultClass>();
        
        // to map soci projects
        Map<String, Object> projectResult = new Map<String, Object>();
        
        Map<String, Object> mapResult = (Map<String, Object>) JSON.deserializeUntyped(res.getBody());
        List<Object> resultList = (List<Object>)(mapResult.get('projects'));
        if(resultList != null){
        for (Object entry : resultList) {
             WrapperProjectList.add((ResultClass)(JSON.deserialize(JSON.serialize(entry), ResultClass.class)));             
             Map<String, Object> pResult = (Map<String, Object>) entry;
             projectResult.put((String)pResult.get('id'),pResult.get('meta_idx'));
             
        }   
        }     
        
               Set<String> accNames = new Set<String>();
        for (ResultClass f : WrapperProjectList) {
            accNames.add(f.name);
        }

    // map Soci project name with Account name
        Map<String, Account> accounts = new Map<String, Account>();
        for (Account a : [
                select Id, Name
                from Account
                where Name in :accNames
                ]) {
            accounts.put(a.Name, a);
        }
        for (ResultClass f : WrapperProjectList) {
            Account a;
            if (accounts.containsKey(f.name)) {
                a = accounts.get(f.name);
            } else {
                a = new Account(Name = f.name);
                accounts.put(f.name, a);
            }
            a.SOCi_Id__c = f.id;
        }
        upsert accounts.values();
            
            
// create or insert channel     
            
            Set<String> accIds = new Set<String>();
            for (ResultClass f : WrapperProjectList) {
                accIds.add(f.id);
            }
            Map<String, Channel__c> channels = new Map<String, Channel__c>();
            for (Channel__c ch : [
                    select Id, Name , Soci_Channel_ID__c
                    from Channel__c
                    where Account__r.SOCi_Id__c in :accIds
                    ]) {
                channels.put(ch.Soci_Channel_ID__c, ch);
            }
            
                 
   
        for(Integer i = 0; i<WrapperProjectList.size(); i++){              
            ID acid = [SELECT id from Account where SOCi_Id__c =: WrapperProjectList.get(i).id LIMIT 1].id; 
           
            System.debug('The channel sfdc List value is: ' + channels);
            for (ChannelClass f : WrapperProjectList.get(i).networks) {
                Channel__c ch;
                if (channels.containsKey(f.id)) {
                    ch = channels.get(f.id);
                } else {
                    ch = new Channel__c(Soci_Channel_ID__c = f.id, Account__c = acid);
                    channels.put(f.id, ch);
                }
                ch.Name= WrapperProjectList.get(i).name +' '+ f.network;
                
          
                 Map<String, Object> metaResult = (Map<String, Object>) projectResult.get(WrapperProjectList.get(i).id);
                
                if(f.network == 'twitter')
                {
           
                    ch.Link_to_Channel__c = (String) metaResult.get('Twitter');
                }
                else if(f.network == 'LinkedIn')
                {
                 
                    ch.Link_to_Channel__c = (String) metaResult.get('LinkedIn');
                }
                
                else
                {
                    ch.Link_to_Channel__c = '';
                }
                
                ch.Type_of_Channel__c = f.network;                
                }
                    
            System.debug('The channel List value is: ' + channels);                        
       }          
          upsert channels.values();   

              
  }
  
  
    class ResultClass {
        public String id;
        public String account_name;
        public String name;
        public String account_id;
        public MetaidxClass meta_idx;
        public List<ChannelClass> networks;          
    }  
    class MetaidxClass {
        public String LinkedIn;        
        public String Twitter; 
    }

    class ChannelClass {
        public String id;
        public String network;
        public String name;
        public String picture;
        
    }    
    
}
  • September 27, 2017
  • Like
  • 0
Json respone is :

"meta_idx": {
"Account Manager": "Test "
}

In salesforce thru calloutm want to take the value of "Account Manager" and map to custom object field...

{
                    ch.Account_Manager__c = m.Account Manager;
                }

Its not taking Space in between "Account Manager"..
Thanks in advance...
 
  • September 25, 2017
  • Like
  • 0
Hi,
i have to integrate salesforce with 3rd party which provides rest apis endpoint. We need to implement everything in the salesforce end (coding etc)
My requirement is : i have to sync data from 3rd party object obj1 to salesforce Accounts.
for example:
3rd party fields                 Salesforce fields
obj1.name                =        account name
obj1.id                     =         objid

Client wants to first implement the syncing between these objects from 3rd party to salesforce
then the automation process.. (for example : once obj1 record created in 3rd party it comes to salesforce as a new account)

My question is ...can we do the callout without any trigger in salesforce.
Please help
Thanks 
 
  • September 07, 2017
  • Like
  • 0
hi..need a help in query...oh batch class
Error is : unexpected token: ')' 
We would like to move leads currently in the Working or Busy status that do not have completed tasks in the last 30 days to the ABC status.
  • Lead Status = Working, Busy
  • Last Activity Date < Today – 30

We want to scheduale a batch class daily basis...here is the code..
global class Leadinactiveflow implements Database.Batchable<SObject>

{

 global Database.Querylocator start (Database.BatchableContext BC)
  {
         
   String query = 'SELECT Id, Status, LastActivityDate ,(select id, createdDate,status from Tasks )From Lead WHERE Status in (\'Working\', \'Busy\')  AND  (Today() - LastActivityDate) > 30';
   System.debug(query);

      return Database.getQueryLocator(query);          

  }
  global void execute (Database.BatchableContext BC, List <Lead> scope)

  {

   List<Lead> listLead = new List<Lead>();

    for(Lead l : scope)
     {
      
         l.Status = 'ABC';     

      listLead.add(l);

      }

   
         if(!listLead.isEmpty()){
            update listLead;
        } 

  } 

global void finish (Database.BatchableContext BC)

{

}

}
Schedulable class is :
 
global with sharing class SchedulerForBatchApex implements Schedulable

{
    global void execute(SchedulableContext sc)        

  {
      Leadinactiveflow b = new Leadinactiveflow();
      ID BatchID = Database.executeBatch(new Leadinactiveflow(), 200);
  }

Public static void SchedulerMethod() 

    {
    string con_exp='0 0 1 * * ?';

    System.schedule('LeadinactiveflowTest', con_exp, new SchedulerForBatchApex());
                                     
    }   

}


 
  • September 01, 2017
  • Like
  • 0
Hi All,
We have a custom action button in lightning for Lead convert.
Issue is on clicking the convert button (custom) it does not display error message (for example status is mandatory etc). it simply refresh the page with the model box and lead does not convert.
In debug logs .. validation error message is there...
In Lead settings, Require Validation for Converted Leads is also Checked..

Please suggest!!
Thanks
Hi
I am using process builder to invoke apex for Lead assignment as explained in the below link:

https://automationchampion.com/tag/run-lead-assignment-rules-for-lead-created-from-process/

Issue is Emails aren’t being sent to the assigned users.
Please help...
where i m lacking...
thanks
hi..
m looking for integrating slack with salesforce
wherein slack messages will generate the leads in sf automatically..
Any help will be appreciated!!!

Thanks
Hello everyone,

I'm new to writing customs integrations between slack and salesforce, is there a sandbox or test environment to test the custom integrations. hank you.

Hi there,

 

We are trying to implement a new custom object to store product defects.  We have 1 requirement we are not sure if it requires customization.  The specific requirement is the following:

 

- The ability to relate product defects to each other (ie. records within the same object) by selecting existing defects in the system.

- A *single* related list (eg. "Related Defects") on the product defect layout to show all "linked" product defects, eg. if DefectA is linked to DefectB and DefectC, DefectA's related list will show B and C, DefectB's related list will show A and C, and so on.

 

Can this be done without customization?

 

thanks