• Clint Majors (Personal)
  • NEWBIE
  • 55 Points
  • Member since 2015
  • CRM Developer
  • Genscape


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hello, 
I am currently having an issue with workflow and was hoping you can help me out. I need a way to make it stop triggering once those tasks have already been created once. 

I currently have a workflow set to trigger a set of tasks as follows:
created, and every time it’s edited
AND( 
ISPICKVAL( StageName , "Pilot Implementation Pending"), 
NOT( ISPICKVAL( PRIORVALUE(StageName) , "Pilot Passed Back For Assistance") ))&& ( Account.Owner.UserRole.Name = "Implementation Team")


Any help would be greatfully appreciated. 
Dear all, 
I am trying to solve one of the Trailhead Challenges in the unit: Creating Test Data for Apex Tests and is giving me the following error:

Challenge Not yet complete... here's what's wrong: 
Executing the 'generateRandomContacts' method failed. Either the method does not exist, is not static, or did not return the correct set of Contact records.

The following is the code; 
public class RandomContactFactory {

    public static List<Contact> generateRandomContacts (integer nNumContacts, string sLastName)
    {
        List<Contact> lContactList = new List<Contact>();
        
        for(integer i=0; i<nNumcontacts; i++)
        {
            Contact c = new Contact(LastName= sLastName + ' ' +i);
            lContactList.add(c);

        }    
        return lContactList;
    }
    
}

What I need to solve is the following:

 Create an Apex class that returns a list of contacts based on two incoming parameters: one for the number of contacts to generate, and the other for the last name. The list should NOT be inserted into the system, only returned. The first name should be dynamically generated and should be unique for each contact record in the list.The Apex class must be called 'RandomContactFactory' and be in the public scope.
The Apex class should NOT use the @isTest annotation.
The Apex class must have a public static method called 'generateRandomContacts' (without the @testMethod annotation).
The 'generateRandomContacts' method must accept an integer as the first parameter, and a string as the second. The first parameter controls the number of contacts being generated, the second is the last name of the contacts generated.
The 'generateRandomContacts' method should have a return type of List<Contact>.
The 'generateRandomContacts' method must be capable of consistently generating contacts with unique first names.
For example, the 'generateRandomContacts' might return first names based on iterated number (i.e. 'Test 1','Test 2').
The 'generateRandomContacts' method should not insert the contact records into the database.

Can anyone help me? 

Thanks!

Bea

 
Hello, 
I am currently having an issue with workflow and was hoping you can help me out. I need a way to make it stop triggering once those tasks have already been created once. 

I currently have a workflow set to trigger a set of tasks as follows:
created, and every time it’s edited
AND( 
ISPICKVAL( StageName , "Pilot Implementation Pending"), 
NOT( ISPICKVAL( PRIORVALUE(StageName) , "Pilot Passed Back For Assistance") ))&& ( Account.Owner.UserRole.Name = "Implementation Team")


Any help would be greatfully appreciated. 
Dear all, 
I am trying to solve one of the Trailhead Challenges in the unit: Creating Test Data for Apex Tests and is giving me the following error:

Challenge Not yet complete... here's what's wrong: 
Executing the 'generateRandomContacts' method failed. Either the method does not exist, is not static, or did not return the correct set of Contact records.

The following is the code; 
public class RandomContactFactory {

    public static List<Contact> generateRandomContacts (integer nNumContacts, string sLastName)
    {
        List<Contact> lContactList = new List<Contact>();
        
        for(integer i=0; i<nNumcontacts; i++)
        {
            Contact c = new Contact(LastName= sLastName + ' ' +i);
            lContactList.add(c);

        }    
        return lContactList;
    }
    
}

What I need to solve is the following:

 Create an Apex class that returns a list of contacts based on two incoming parameters: one for the number of contacts to generate, and the other for the last name. The list should NOT be inserted into the system, only returned. The first name should be dynamically generated and should be unique for each contact record in the list.The Apex class must be called 'RandomContactFactory' and be in the public scope.
The Apex class should NOT use the @isTest annotation.
The Apex class must have a public static method called 'generateRandomContacts' (without the @testMethod annotation).
The 'generateRandomContacts' method must accept an integer as the first parameter, and a string as the second. The first parameter controls the number of contacts being generated, the second is the last name of the contacts generated.
The 'generateRandomContacts' method should have a return type of List<Contact>.
The 'generateRandomContacts' method must be capable of consistently generating contacts with unique first names.
For example, the 'generateRandomContacts' might return first names based on iterated number (i.e. 'Test 1','Test 2').
The 'generateRandomContacts' method should not insert the contact records into the database.

Can anyone help me? 

Thanks!

Bea