• Amit Jha 20
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Create a Queueable Apex class that inserts the same Contact for each Account for a specific state. Write unit tests that achieve 100% code coverage for the class.
Create an Apex class called 'AddPrimaryContact' that implements the Queueable interface.
Create a constructor for the class that accepts as its first argument a Contact sObject and a second argument as a string for the State abbreviation.
The execute method must query for a maximum of 200 Accounts with the BillingState specified by the State abbreviation passed into the constructor and insert the Contact sObject record associated to each Account. Look at the sObject clone() method.
Create an Apex test class called 'AddPrimaryContactTest'.
In the test class, insert 50 Account records for BillingState "NY" and 50 Account records for BillingState "CA". Create an instance of the AddPrimaryContact class, enqueue the job and assert that a Contact record was inserted for each of the 50 Accounts with the BillingState of "CA".
The unit tests must cover all lines of code included in the AddPrimaryContact class, resulting in 100% code coverage.
Run your test class at least once (via 'Run All' tests the Developer Console) before attempting to verify this challenge.

The formula below requires certain picklists to be populated based on dollar values in corresponding fields.  This works for all departments.  I added the red section because I want to filter in two departments that have to obey this validation rule.  When I added the 3 red lines I no longer received error messages when I was supposed to.  I only want Networks and Distribution to have to follow this validation rule.  What am I missing?

 

Thanks.

 


AND(
DATEVALUE(CreatedDate) > DATE(2012,8,23),
AND(
ISPICKVAL( CCI_Division_Region__c , "CCI Networks"),
ISPICKVAL( CCI_Division_Region__c , "CCI Distribution"),
OR(
AND(Services__c > 0,
ISBLANK(TEXT(Product__c )),
ISBLANK(Services_Product_Involved__c)),
AND(Support__c > 0,
ISBLANK(Support_Provider__c)),
AND(Product__c > 0,
ISBLANK(TEXT(Product_Manufacturer__c))))))