• Eric Blaxton
  • NEWBIE
  • 90 Points
  • Member since 2013
  • Admin

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 24
    Replies
Hello,
I have a problem with challenge validation (Hands On and Quizz) when I press the button, I have the three dots, the button is deactivated but nothing happens. After five minutes or so, the button is reactived but no validation or errors...
Could you help me please ?

Thanks,
Pierre-Yves
Hi and thanks for your help in advance.

I am having what appears to be an Order of Sequence violation.
 
  1. This error happens intermittently and never happens when testing.  Based on the Order of Execution it shouldn’t be happening.
Here is what I have
  1. User enters a Registration Request
  2. Enters in required fields
  3. Hits save
  4. Before insert trigger which checks for duplicate records
    1. If duplicate found there should be an error message thrown.  (happens frequently)
  5. Process builder which:  (here is where I sometimes get the “Field Custom Validation Exception”)
    1. Looks for logged in user
    2. Looks for Account Team member of logged in user
    3. Assigns team member to variable x
    4. Writes x to Registration Request Record
  6. Saves original  record
  7. Creates another record
Of course, If we had better error messages for Process builder, this would be a moot question.  
 
Hello and thanks in advance.

I want to report on Accounts within certain miles of a big city.  Let's say Accounts within 50 miles of Dallas.  What i did was set up geolocation fields, then i was able to run SOQL queries on Workbench. The problem now is being able to export to Excel or some other format.  

Any ideas or suggestions?
Hi and thanks in advance.

I have several trigger and a several tests written.  The code coverage is good, 77% and higher per test, but I want to get them higher.  The tests don't cover my .addError code.  the 2 lines not covered are in bold.

My trigger:
trigger checkAccountCreditStatusisRejected on Opportunity (before insert) {
       //Create list to store data in  
       list<id>AccountidLst=new list<id>(); 
      
       for(Opportunity opp : System.trigger.new)
      { // store all Opportunity Account Id's
       AccountidLst.add(opp.AccountId);
      }
      // Create map that stores the id and credit status of Active Opportunity Account
      map<id,account>accountMap=new map<id,account>([select id,Credit_Status__c from account where id In : AccountidLst]);
      
      for (Opportunity opp : System.trigger.new) {          
          if(accountMap.containskey(opp.AccountId))
            {
            if (accountMap.get(opp.AccountId).Credit_Status__c == 'Rejected')
              {
                opp.addError('WARNING: New Opportunity cannot be created when Account Credit Status = Rejected');

              }// end if 
            }
                           
       }//end for  
        
    }// end trigger

My test:
@isTest 
public class testCheckAccountCreditStatusisRejected{
   static testMethod void checkAccountCreditStatusisRejected () {
 
         // create mock user
User mockUser = new User(alias = 'newUser', email='newuser@pbsnow.com',
emailencodingkey='UTF-8', lastname='Testing',
languagelocalekey='en_US', localesidkey='en_US', profileid = UserInfo.getProfileId(),
timezonesidkey='America/Los_Angeles', CommunityNickname='test1', username='testAddDefaultTeam@pbsnow.com');
insert mockUser;  
        
        //Define list
        list<id>AccountidLst=new list<id>();  
        
       //create Account and Opportunity to add default team member
        Account acc = new Account ( Name = 'testAccount', BillingStreet = '123 Main Street', BillingCity = 'Dallas' ,
         BILLINGCOUNTRYCODE='US', BillingStateCode = 'TX', Industry = 'Healthcare', Company__c = 'Pinnacle Business Systems', BillingPostalCode = '75749' );
         insert acc;                     
      
       // store all Opportunity Account Id's
       AccountidLst.add('001J000001DYN5I');     
        
        // Create map that stores the id and credit status of Active Opportunity Account
      map<id,account>accountMap=new map<id,account>([select id,Credit_Status__c from account where Name = 'testAccount']);      
     
       
        Opportunity opp = new Opportunity( Name = 'testOpportunity', Account = acc,/* ToBeSync__c = false,*/ StageName ='Prospecting', Is_this_a_Maintenance_Renewal_Op__c = 'No',Description = 'Test', CloseDate = Date.today(),
         OwnerId = mockUser.id);
                 
        try{
            insert opp;
         
         if(accountMap.containskey('001J000001DYN5I'))
            {
            if (accountMap.get('001J000001DYN5I').Credit_Status__c == 'Rejected')
              {
                opp.addError('WARNING: New Opportunity cannot be created when Account Credit Status = Rejected');
              }// end if 
            }
            
         }//end try
         catch (ListException e) {
         
         }
       
    }

}// end public class

 
Good morning and thanks in advance,

Requirement is when a new opportunity is created:
1.Lookup an Opportunity Team Member name whose role equals "Primary SE"
2.Copy that name into a custom field on the opportunity. Field name is "SE"

I was told to use a Process to trigger a Flow where most of the logic willl be placed.  

One question so far:
1. How to pass the current op id into the flow, so the flow knows which op to update
 
At OpenGov, we're transforming the way government works. To do this, our team is building something no one has before: a cloud-based financial analysis platform that governments use to collaborate more effectively, make smarter, data-driven decisions and achieve greater transparency.

We are fostering collaboration not just within the government but with elected officials and the community, bringing financial transparency and citizen engagement to state and local governments, special districts, education and non-profits.

To support our mission, we're seeking an experienced and savvy Salesforce administrator to join our Sales Operations team.

Check out our careers page (http://opengov.com/careers/) and click here to apply directly (https://jobs.lever.co/opengov/be7e9560-8196-4a7d-9fd4-b28fd84a2b14/apply).

Hope to speak with you soon!

Please, no recruiters or agencies.
------------------------------------------------------------

Salesforce Administrator

Are you a Salesforce Admin with experience helping a SAAS business scale? If so, we'd like to meet you!

OpenGov is looking for an energetic, business-savvy technician to run its Salesforce system. You will be tasked with the continuous improvement and administration of Salesforce for all stakeholders, including Sales, Marketing, Account Management, and all other internal teams utilizing the platform. The ideal candidate is results-driven, has strong business and engineering talents, and is committed to our mission of revolutionizing government finance.

Key Responsibilities:
  • Provide strategic direction for our Salesforce system and work with other stakeholders to establish and implement best practices with regards to system configuration, development, testing, maintenance, and data integrity.
  • Administration of our Salesforce environment including: customizing and implementing profiles, roles, security settings, sharing rules, custom applications, custom objects, custom fields, page layouts, workflow, validation rules, dashboards, reports, and so on.
  • Work with end users to provide best practices and tips on Salesforce usage including training, documentation and support as necessary.
  • Research additional functionality that would enhance our business capabilities.
Our Ideal Candidate Has:
  • A blend of technical and business experience. You should know how to write an Apex trigger, but also know why that trigger should get implemented that way, or whether there is a better way to accomplish the business goal.
  • Knowledge of sales and marketing processes; in-depth knowledge of CRM strategy and systems. Proven experience building components of a Salesforce system to support core business processes.
  • Salesforce Admin certification with 3-5 years of experience in a sales and marketing environment.
  • Minimum of an undergraduate degree in Computer Science or related field.
  • Strong verbal/written communication and data presentation skills, including an ability to effectively communicate with both business and technical teams.
Bonus Points For:
  • Certified Salesforce Developer
  • Hubspot Experience
Goal : Add a Rollup Summary field on the Account that shows the Total of Invoices (Custom field)

I would like to use Apex code if possible.  

Thanks for advice, tips and comments

Regards.
Hi and thanks in advance.

Requirement: I need tips on a trigger to create a task and assign it to a related user on the Quote object.  It should happen when a quote enters the intial submittal.

Has anyone done this using Apex or vf?

Regards
Hi and thanks in advance.

Problem:  I have a custom object that uses a Lookup (user) field.  I need this field in order to email a related user.  The problem is this field does not show up on reports.  So I created a picklist intending to populate the field from the Lookup, when either created or edited.  

How do I typecast or convert the value of a Lookup field to a picklist value.  Here is my trigger:

trigger Reg_Request_to_Reg on Registration_Requests__c (after insert) {
    List<Registration__c> newRegistration = new List <Registration__c>();
   
        for (Registration_Requests__c reg : trigger.new) {
           
            Registration__c newReg = new Registration__c();
            
            newReg.Inside_Sales_Rep__c = reg.Inside_Sales_Rep_Name__c; // Inside_Sales_Rep__c = Picklist / Inside_Sales_Rep_Name__c = Lookup
            newReg.Inside_Sales_Rep_Name__c = reg.Inside_Sales_Rep_Name__c;
            
            newRegistration.add(newReg);
           
        }//end for
        //try {
        insert newRegistration;
       //  }
       // catch (DmlException e) {
        //System.debug('The following exception has occurred: ' + e.getMessage());  
       // System.('The following exception has occurred: ' + e.getMessage());          
       // }
        }//end trigger


Hi and thanks for your replies.

Requirements were to do a duplicate check on Account Name and Zipcode.   I created a custom field and did the workflow update and validation rule and everything worked great...BUT the error message is ugly.

Is there a way to provide a clean error message?

I ended up writing a trigger, which gives me full control over the error message, but would like to learn a different approach.

Regards.
Hi and thanks in advance...

Requirement: Before inserting New Opportunity check Account.Credit_Status__C (custom field).  If it doesn't meet requirements pop-up message.  If this is not the way it's done feel free to offer ideas.

Here is the code
trigger checkAccountCreditStatusisRejected on Opportunity (before insert) {
      
     for (Opportunity opp : System.trigger.new) {           
        if (opp.AccountId.Credit_Status__c == 'Rejected')
          {
             opp.addError('A new Opportunity cannot be created on account where Credit Status = Rejected');
          }// end if         
                        
       }//end for   
     
}// end trigger

Regards

Hi and thanks for reading this and for any help...

 

The requirement is to stop users from saving duplicate Team Member roles when they add or edit their Default Opportunity or Account Team.  

 

So, if Tom wants to add users to his default opp team, he can only add 1 "Sales Manager", 1 "Sales Lead", etc.

 

 

Eric