• Mohammed Siddique
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 11
    Replies
Hello,
I dont have any Coding knowledge and really hoping some one to help me out with the trigger issue I have.
we have a trigger written to pull all the contact info and roll up on one of our Account record type which is working fine in development. But we are receiving an error within our Hubspot application (Installed Package) during a mass update to contacts. The Error message in HubSpot for not syncing the contacts reads: java.lang.RuntimeException: Salesforce save error: trgr_NumberOfProvidersAccountRollUp: System.LimitException: Too many SOQL queries: 101 : CANNOT_INSERT_UPDATE_ACTIVATE_ENT wanted to know how can we adjust our code so that the number os SOQL fired is less than 100. Below is the Code can you please help us out


trigger trgr_ParentAccount_Provider_Count on Account (after insert, after update, after delete, after undelete)
{
    Set<Id> QPAcctIds = new Set<Id>();
    List<Account> UpdtAcct = new List<Account>();

    if(Trigger.isDelete)
    {
        for (Account Acct0 : Trigger.old)
        {
            //qualify only those deleted accounts that are not Parent
            //Add parentid of those deleted accounts to the Id list
            
            system.debug('Deleted Account ---> ' + Acct0.name);
            
            If(Acct0.ParentID != NULL)
               {
                   QPAcctIds.add(Acct0.ParentId);
               }
        }
    }
    
    if(!Trigger.isDelete)
    {
        for (Account Acct : Trigger.new)
        {
            //qualify only those accounts that are not Parent
            //Add parentid of those accounts to the same Id list from above
            
            system.debug('Account ---> ' + Acct.name);
            
            If(Acct.ParentID != NULL)
               {
                   QPAcctIds.add(Acct.ParentId);
               }
        }
    }   
    
    system.debug('Qualified Parent Accounts ---> ' + QPAcctIds);
        
    for (Id QPAId : QPAcctIds)
    {
        Account PAcct = [select id, name from Account where id =: QPAId];
        
        for (AggregateResult result : [Select sum(Full_time_provider_Licenses__c) FTP,
                                       sum(Part_time_provider_Licenses__c) PTP,
                                       sum(Hospitalist_Licenses__c) HSP,
                                       sum(Locum_Licenses__c) LCM,
                                       sum(Rotating_Provider_Licenses__c) RTP
                                       from Account where ParentID =: QPAId])
        {   
            PAcct.P_Full_time_providers__c = (Decimal)result.get('FTP');
            PAcct.P_Part_time_providers__c = (Decimal)result.get('PTP');
            PAcct.P_Hospitalists__c = (Decimal)result.get('HSP');
            PAcct.P_Locums__c = (Decimal)result.get('LCM');
            PAcct.P_Rotating_Providers__c = (Decimal)result.get('RTP');            
        }
        
        system.debug('FTP count ---> '+ PAcct.P_Full_time_providers__c);
        system.debug('PTP count ---> '+ PAcct.P_Part_time_providers__c);
        system.debug('HSP count ---> '+ PAcct.P_Hospitalists__c);
        system.debug('LCM count ---> '+ PAcct.P_Locums__c);
        system.debug('RTP count ---> '+ PAcct.P_Rotating_Providers__c);
        
        UpdtAcct.add(PAcct);
    }
        
        system.debug('Parent Accounts to be updated ---> ' + UpdtAcct);
        
        Update UpdtAcct;    
}
I am attempting to deploy a custom object that I created in sandbox to production.  I created an outbound change set on sandbox and that uploaded it successfully.  I went into production and attempted to deploy the change set but it failed.  I got the following error message:

 

Problem: Validation Failed

Error Message : influencecontroller.runICTest(), Details: System.QueryException: List has no rows for assignment to SObject Class.influencecontroller.sendInfluence: line 93, column 1 Class.influencecontroller.runICTest: line 226, column 1

 
Trigger or anything to do with apex is in no way associated with the object I am trying to move over into production.  Furthermore, there are no triggers at all associated with my object.  It's actually a pretty simple object with a few minor workflows.  Why am I getting the above error?

 

Thanks in advance.
I found an application in AppExchange (Group Alerts for Chatter), this app works like a triggers whenever specified records is changed or updated it triggers a Chatter post notifications to Chatter Groups. This works only on standard objects but while googling I found there is a template which lets you add custom object as well, with the help of Apex coding template I was able to add custom object in the Group Alerts for Chatter in my sandbox and when tried pushing the setting to production Org I’m getting an error which say “Code Coverage Error” it says we need to add Test classes for existing code. Need assistance adding test classes.

Thanks in advance....
I need to know, how Chatter is backed up by Salesforce and is it possible for us to back it up and store the data?
I also wanted to know how far back is the data available? (beginning of time or does it archive after so long)
I need to know, how Chatter is backed up by Salesforce and is it possible for us to back it up and store the data?
I also wanted to know how far back is the data available? (beginning of time or does it archive after so long)
Hello,

I have setup an Authentication Provider and Named Credential to authenticate to Google (specifically Google Calendar), this has worked fine in Sandbox for the past 2 weeks (and is still authenticated as I write this, using a free Gmail account). The problem came when I needed to replicate this in production, where I'm using the same settings though adjusted with the production domain url for the callback. Now the Named Credential fails to authenticate. The error I get is Remote_Error: invalid_request

If I edit the Sandbox Named Credential which is currently authenticated and click save to start the auth flow again, then I get the same error in the Sandbox environment, however that one stays authenticated even after that (same if I use the Test-Only Initialization URL inside Auth.Provider)

I have also tried using a different Gmail account with a new project in the google console, different client secret and id, but I got the same error.

My authentication provider is using Open ID Connect as Provider Type. I have also tried using Google as provider type however I get a different error: Id_Token_Error: Missing id_token

User-added image
User-added image
User-added image
User-added image

Any help would be kindly appreciated.
Thanks,
Cosmin
  • September 27, 2018
  • Like
  • 0
Hello,
I dont have any Coding knowledge and really hoping some one to help me out with the trigger issue I have.
we have a trigger written to pull all the contact info and roll up on one of our Account record type which is working fine in development. But we are receiving an error within our Hubspot application (Installed Package) during a mass update to contacts. The Error message in HubSpot for not syncing the contacts reads: java.lang.RuntimeException: Salesforce save error: trgr_NumberOfProvidersAccountRollUp: System.LimitException: Too many SOQL queries: 101 : CANNOT_INSERT_UPDATE_ACTIVATE_ENT wanted to know how can we adjust our code so that the number os SOQL fired is less than 100. Below is the Code can you please help us out


trigger trgr_ParentAccount_Provider_Count on Account (after insert, after update, after delete, after undelete)
{
    Set<Id> QPAcctIds = new Set<Id>();
    List<Account> UpdtAcct = new List<Account>();

    if(Trigger.isDelete)
    {
        for (Account Acct0 : Trigger.old)
        {
            //qualify only those deleted accounts that are not Parent
            //Add parentid of those deleted accounts to the Id list
            
            system.debug('Deleted Account ---> ' + Acct0.name);
            
            If(Acct0.ParentID != NULL)
               {
                   QPAcctIds.add(Acct0.ParentId);
               }
        }
    }
    
    if(!Trigger.isDelete)
    {
        for (Account Acct : Trigger.new)
        {
            //qualify only those accounts that are not Parent
            //Add parentid of those accounts to the same Id list from above
            
            system.debug('Account ---> ' + Acct.name);
            
            If(Acct.ParentID != NULL)
               {
                   QPAcctIds.add(Acct.ParentId);
               }
        }
    }   
    
    system.debug('Qualified Parent Accounts ---> ' + QPAcctIds);
        
    for (Id QPAId : QPAcctIds)
    {
        Account PAcct = [select id, name from Account where id =: QPAId];
        
        for (AggregateResult result : [Select sum(Full_time_provider_Licenses__c) FTP,
                                       sum(Part_time_provider_Licenses__c) PTP,
                                       sum(Hospitalist_Licenses__c) HSP,
                                       sum(Locum_Licenses__c) LCM,
                                       sum(Rotating_Provider_Licenses__c) RTP
                                       from Account where ParentID =: QPAId])
        {   
            PAcct.P_Full_time_providers__c = (Decimal)result.get('FTP');
            PAcct.P_Part_time_providers__c = (Decimal)result.get('PTP');
            PAcct.P_Hospitalists__c = (Decimal)result.get('HSP');
            PAcct.P_Locums__c = (Decimal)result.get('LCM');
            PAcct.P_Rotating_Providers__c = (Decimal)result.get('RTP');            
        }
        
        system.debug('FTP count ---> '+ PAcct.P_Full_time_providers__c);
        system.debug('PTP count ---> '+ PAcct.P_Part_time_providers__c);
        system.debug('HSP count ---> '+ PAcct.P_Hospitalists__c);
        system.debug('LCM count ---> '+ PAcct.P_Locums__c);
        system.debug('RTP count ---> '+ PAcct.P_Rotating_Providers__c);
        
        UpdtAcct.add(PAcct);
    }
        
        system.debug('Parent Accounts to be updated ---> ' + UpdtAcct);
        
        Update UpdtAcct;    
}
Hi,

I have created a visualforce page for the community login, when I choose login page as my custom visualforce page I am getting error as displayed below.

Unable to set a VF page as Login page for my community.

I tried assigning all Profiles to that VF page but it still gave me the same error.
User-added image


 
I am attempting to deploy a custom object that I created in sandbox to production.  I created an outbound change set on sandbox and that uploaded it successfully.  I went into production and attempted to deploy the change set but it failed.  I got the following error message:

 

Problem: Validation Failed

Error Message : influencecontroller.runICTest(), Details: System.QueryException: List has no rows for assignment to SObject Class.influencecontroller.sendInfluence: line 93, column 1 Class.influencecontroller.runICTest: line 226, column 1

 
Trigger or anything to do with apex is in no way associated with the object I am trying to move over into production.  Furthermore, there are no triggers at all associated with my object.  It's actually a pretty simple object with a few minor workflows.  Why am I getting the above error?

 

Thanks in advance.
I found an application in AppExchange (Group Alerts for Chatter), this app works like a triggers whenever specified records is changed or updated it triggers a Chatter post notifications to Chatter Groups. This works only on standard objects but while googling I found there is a template which lets you add custom object as well, with the help of Apex coding template I was able to add custom object in the Group Alerts for Chatter in my sandbox and when tried pushing the setting to production Org I’m getting an error which say “Code Coverage Error” it says we need to add Test classes for existing code. Need assistance adding test classes.

Thanks in advance....
I need to know, how Chatter is backed up by Salesforce and is it possible for us to back it up and store the data?
I also wanted to know how far back is the data available? (beginning of time or does it archive after so long)