• Mandodari Rawat
  • NEWBIE
  • 283 Points
  • Member since 2014
  • Salesforce Developer


  • Chatter
    Feed
  • 1
    Best Answers
  • 6
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 13
    Replies
Hi,

  I wrote a trigger which is working fine when deployed to production am getting below eror Please suggest me how to fix this issue

Error: System.LimitException: Too many SOQL queries: 101 Trigger.logosince: line 28, column 1
 
trigger logosince on Account (before  update) 
{
  Try
 {
   Set<Id> accountId = new Set<Id>();
   List<Id> chkoneprt = new List<Id>();
   List<Id> chkoneid = new List<Id>();
   for (Account a : Trigger.New) 
   {     
      accountId.add(a.id);
      chkoneid.add(a.id);
      chkoneprt.add(a.parentid);
      
      } 
       
      /* not required for ( account actone : [select id,parentid from account 
                                where id in :accountId 
                               ])
        {
          chkoneid.add(actone.id);  
          chkoneprt.add(actone.parentid);  
        }  */
        
          system.debug('ID' + chkoneid);
         system.debug('Parent ID' + chkoneprt);
 
        List<Id> finalid = new List<Id>();
        for ( account actpar : [select id,parentid from account 
                                where 
                                     ( parentid != '' and
                                       parentid in :chkoneprt ) or 
                                     ( parentid != '' and
                                       parentid in :chkoneid ) or
                                      id in :chkoneid 
                               ])
        {
          finalid.add(actpar.id);  
            
        }
        system.debug('ID' + chkoneid); 
        system.debug('Final ID' + finalid);        
             
     List<AggregateResult> gr = [ 
     SELECT min(closedate) from opportunity 
     WHERE accountid IN :chkoneid or accountid in :finalid];
   
       
     for (AggregateResult ar : gr)  {
        system.debug('Min Opp date' + (Datetime)ar.get('expr0'));
        for(Account act : trigger.new) 
              {
              act.Logo_Since__c = (Datetime)ar.get('expr0') + 1;
              
              }
         }     
     
 }
  catch (System.NullPointerException e) {
    system.debug('Null Exception');
  }    
             
         
}

 
If I run PATCH /services/data/v49.0/tooling/sobjects/StandardValueSet/Product2Family, I get an error: MALFORMED_ID: bad id Product2Family.
If I run
POST /services/data/v49.0/tooling/sobjects/StandardValueSet, I get an error: FIELD_INTEGRITY_EXCEPTION: insert isn't supported for the standard value set Product2Family.  
 
Please uncheck the 'Use Tooling API' Checkbox in Query Editor whenever you see sObject type 'XXXX__c' is not supported error while running SOQL.
It is just after 'Execute' button. Please see the snapshot below:
sObject Type XXXX__C is not supported

 
In the query editor I put this SOQL 
SELECT Id, Name, Session_Date__c, Level__c FROM Session__c

I got this error
sObject type 'Session__c' is not supported.
Hi Experts,
I am trying to solve this challenge but not able to solve because of salesfore license issue. Salesforce only allows 2 'Salesfoce' license for DE. Is there a way to solve this challenge? Please help.

Create a Profile and Permission Set to properly handle field access
The Marketing Coordinator and Account Manager both require access to view and update Account Records, but only the Account Manager should be able to see and edit certain fields. Specifically, only the Account Manager should be able to see and edit the Rating field. The Marketing Coordinator should not be able to see or edit the Rating field. Create one profile and one permission set with the appropriate field-level security to solve for this use case.The profile must be named 'Basic Account User' and result in an API name of 'Basic_Account_User'. It should use the 'Salesforce' user license type.
The permission set must be named ‘Account Rating’ and result in an API name of 'Account_Rating'.
Please uncheck the 'Use Tooling API' Checkbox in Query Editor whenever you see sObject type 'XXXX__c' is not supported error while running SOQL.
It is just after 'Execute' button. Please see the snapshot below:
sObject Type XXXX__C is not supported

 
Hi Experts,
I am trying to solve this challenge but not able to solve because of salesfore license issue. Salesforce only allows 2 'Salesfoce' license for DE. Is there a way to solve this challenge? Please help.

Create a Profile and Permission Set to properly handle field access
The Marketing Coordinator and Account Manager both require access to view and update Account Records, but only the Account Manager should be able to see and edit certain fields. Specifically, only the Account Manager should be able to see and edit the Rating field. The Marketing Coordinator should not be able to see or edit the Rating field. Create one profile and one permission set with the appropriate field-level security to solve for this use case.The profile must be named 'Basic Account User' and result in an API name of 'Basic_Account_User'. It should use the 'Salesforce' user license type.
The permission set must be named ‘Account Rating’ and result in an API name of 'Account_Rating'.
Please uncheck the 'Use Tooling API' Checkbox in Query Editor whenever you see sObject type 'XXXX__c' is not supported error while running SOQL.
It is just after 'Execute' button. Please see the snapshot below:
sObject Type XXXX__C is not supported

 
In the query editor I put this SOQL 
SELECT Id, Name, Session_Date__c, Level__c FROM Session__c

I got this error
sObject type 'Session__c' is not supported.
Hi,

  I wrote a trigger which is working fine when deployed to production am getting below eror Please suggest me how to fix this issue

Error: System.LimitException: Too many SOQL queries: 101 Trigger.logosince: line 28, column 1
 
trigger logosince on Account (before  update) 
{
  Try
 {
   Set<Id> accountId = new Set<Id>();
   List<Id> chkoneprt = new List<Id>();
   List<Id> chkoneid = new List<Id>();
   for (Account a : Trigger.New) 
   {     
      accountId.add(a.id);
      chkoneid.add(a.id);
      chkoneprt.add(a.parentid);
      
      } 
       
      /* not required for ( account actone : [select id,parentid from account 
                                where id in :accountId 
                               ])
        {
          chkoneid.add(actone.id);  
          chkoneprt.add(actone.parentid);  
        }  */
        
          system.debug('ID' + chkoneid);
         system.debug('Parent ID' + chkoneprt);
 
        List<Id> finalid = new List<Id>();
        for ( account actpar : [select id,parentid from account 
                                where 
                                     ( parentid != '' and
                                       parentid in :chkoneprt ) or 
                                     ( parentid != '' and
                                       parentid in :chkoneid ) or
                                      id in :chkoneid 
                               ])
        {
          finalid.add(actpar.id);  
            
        }
        system.debug('ID' + chkoneid); 
        system.debug('Final ID' + finalid);        
             
     List<AggregateResult> gr = [ 
     SELECT min(closedate) from opportunity 
     WHERE accountid IN :chkoneid or accountid in :finalid];
   
       
     for (AggregateResult ar : gr)  {
        system.debug('Min Opp date' + (Datetime)ar.get('expr0'));
        for(Account act : trigger.new) 
              {
              act.Logo_Since__c = (Datetime)ar.get('expr0') + 1;
              
              }
         }     
     
 }
  catch (System.NullPointerException e) {
    system.debug('Null Exception');
  }    
             
         
}

 
Hello, I'm stuck. I am new to the world of Salesforce Administration, and went right to the trailhead on Wave Analytics, skipping CRM basics. I've uploaded the two data sets required for Wave Analytics and now I'm out of space.  Can I ask for additional space?   
Hi,
I am not able to understand the below question correctly Please help me out. - 
Create a class that has a method accepting two strings. The method searches for contacts that have a last name matching the first string and a mailing postal code (API name: MailingPostalCode) matching the second. It gets the ID and Name of those contacts and returns them.The Apex class must be called 'ContactSearch' and be in the public scope.
The Apex class must have a public static method called 'searchForContacts'.
The 'searchForContacts' method must accept two incoming strings as parameters, find any contact that has a last name matching the first, and mailing postal code matching the second string. The method should return a list of Contact records with at least the ID and Name fields.
The return type for 'searchForContacts' must be 'List<Contact>'.
Please help me in getting this - I tried, but not working -
https://developer.salesforce.com/trailhead/data_security/data_security_fields
Respected Sir,
This is with reference to Salesforce Trailhead Challenge .
On 2nd February 2015, I fulfilled challenge requirements.
On 3rd February 2015, I got an email to confirm Shipping Address.
I had already confirmed it.
Could you please update me the status for the same?
Mit freundlichen Grüßen /Thanking you and With Best Regards, 
 
Pankaj Phukane
The Marketing Coordinator and Account Manager both require access to view and update Account Records, but only the Account Manager should be able to see and edit certain fields. Specifically, only the Account Manager should be able to see and edit the Rating field. The Marketing Coordinator should not be able to see or edit the Rating field. Create one profile and one permission set with the appropriate field-level security to solve for this use case. The profile must be named 'Basic Account User' and result in an API name of 'Basic_Account_User'. It should use the 'Salesforce' user license type. The permission set must be named ‘Account Rating’ and result in an API name of 'Account_Rating'.
Hi All,

Can anyone please help me with bellow challenge.


Create an Apex trigger for Account that matches Shipping Address Postal Code with Billing Address Postal Code based on a custom field.
For this challenge, you need to create a trigger that, before insert or update, checks for a checkbox, and if the checkbox field is true, sets the Shipping Postal Code (whose API name is ShippingPostalCode) to be the same as the Billing Postal Code (BillingPostalCode).The Apex trigger must be called 'AccountAddressTrigger'.
The Account object will need a new custom checkbox that should have the Field Label 'Match Billing Address' and Field Name of 'Match_Billing_Address'. The resulting API Name should be 'Match_Billing_Address__c'.
With 'AccountAddressTrigger' active, if an Account has a Billing Postal Code and 'Match_Billing_Address__c' is true, the record should have the Shipping Postal Code set to match on insert or update.

For above challenge i tried with following code but looks like it doesnt mach the requirement.

trigger AccountAddressTrigger on Account (before insert, before update) {
    for(Account a : Trigger.new){
        If (a.Match_Billing_Address__c = true) {
            /*ShippingPostalCode = BillingPostalCode;*/
        }   
    } 

}

Please help me