• Alex Edwin 8
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi Experts,

We are using Opportuities Object, and two standard picklist fields.
1. Standard Picklist Field: Type
2. standard Picklist Field: Stage

Type having below three picklist values.
New Business - Staff Aug
Existing Business - Staff Aug
New Business - Turnkey

If user select type picklist value, accordingly it will show below stage values.
Please find below image

Dependent Picklist values

Please anyone sortout my issue.

Thanks,
Manu
Hi, I have written a trigger with apex on Case Topic assignment but I only managed to get the code coverage upto 80%. Please help in getting the code coverage upto 90% although the code is working fine. 
/**}

 ** Test class for TopicAssignmentTriggerHandler.cls
**/


  

@isTest
public class TopicAssignmentTriggerHandlerTest{

    public static testmethod void AssignmentTriggerHandlertest(){
        Test.startTest();
          
          List <Topic> TopicList=[Select Id,Name from Topic where (Name='Testimonial Feedback' OR Name='Author Feedback' OR Name='Course Feedback' OR Name='General Feedback' OR Name='Course Request' OR Name='Feature Request' OR Name='Testimonial' OR Name='Community Relations' OR Name='Careers' OR Name='Legal' OR Name='Remove From Newsletter' OR Name='Piracy' OR Name='PR' OR Name='Employment Verification')];          
          List<TopicAssignment> TopicAssignmentList=new List<TopicAssignment>();
          List<Case> CaseList=new List<Case>();
          
         //create test Account
          Account testAcc = new Account(
          Name = 'testAccount',
          BillingCountryCode = 'US',
          BillingState = 'California',
          BillingStreet = '6410 via Real',
          BillingPostalCode = '93013',
          BillingCity = 'Carpinteria',
          Industry = 'Construction',
          LDC_ID__c =  1234);
          insert testAcc ;
          System.Assertequals(testAcc.Name,'testAccount');
          
          //Create contact data
          Contact c1 = new Contact(AccountId = testAcc.id, FirstName = 'Test', LastName = 'Contact', Email='c-aray@lynda.com');
          c1.MailingState = 'California';
          c1.MailingCountry = 'United States';
          insert c1;
          System.Assertequals(c1.FirstName,'Test');
          System.Assertequals(c1.LastName,'Contact');
          
          //create case
          Case testcas1 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas1;
        
          TopicAssignment ta1 = new TopicAssignment(Topicid = TopicList.get(0).id, EntityId = testcas1.id);
          insert ta1;
          Case testcas2 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas2;
          TopicAssignment ta2 = new TopicAssignment(Topicid = TopicList.get(1).id, EntityId = testcas2.id);
          insert ta2;
          Case testcas3 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas3;
          TopicAssignment ta3 = new TopicAssignment(Topicid = TopicList.get(2).id, EntityId = testcas3.id);
          insert ta3;
          
          Case testcas4 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas4;
          TopicAssignment ta4 = new TopicAssignment(Topicid = TopicList.get(3).id, EntityId = testcas4.id);
          insert ta4;
          Case testcas5 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas5;
          TopicAssignment ta5 = new TopicAssignment(Topicid = TopicList.get(4).id, EntityId = testcas5.id);
          insert ta5;
         
          Case testcas6 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas6;
          TopicAssignment ta6 = new TopicAssignment(Topicid = TopicList.get(5).id, EntityId = testcas6.id);
          insert ta6;
          Case testcas7 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas7;
          TopicAssignment ta7 = new TopicAssignment(Topicid = TopicList.get(6).id, EntityId = testcas7.id);
          insert ta7;
          
          Case testcas8 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas8;
          TopicAssignment ta8 = new TopicAssignment(Topicid = TopicList.get(7).id, EntityId = testcas8.id);
          insert ta8;
          Case testcas9 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas9 ;
          TopicAssignment ta9 = new TopicAssignment(Topicid = TopicList.get(8).id, EntityId = testcas9.id);
          insert ta9;
          
          Case testcas10 = new Case(CurrencyIsoCode = 'USD',ContactId = c1.id,Description = 'test',Subject = 'test', Status = 'New',Priority='Low', Origin ='Customer Service', RecordTypeId='01270000000Msmq');
          insert testcas10 ;
          TopicAssignment ta10 = new TopicAssignment(Topicid = TopicList.get(9).id, EntityId = testcas10.id);
          insert ta10;
          
          
         Test.stopTest();
    }
}
  • April 29, 2015
  • Like
  • 0
I want to query all accounts on which my contact(logged in user)  is having contact role too.
EG:
I have two accounts A,B and one contact C

C is contact of account A but has contact role on ACCOUNT B
So this is what i want to query,i have to get account A and B on my account look up field.

I am following this blog.But struck here with the query..

http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/

please help!!
Hello All,

I have written below mentioned code and I am getting "Error: Invalid field Testing__r for SObject Case".

Please note, 'Testing' is a custom object and is related list of Case object

<apex:pageBlockSection id="Testing" columns="1" title="Testing" collapsible="true">
      <apex:pageBlockTable value="{!Case.Testing__r}" var="item">
      <apex:column value="{!item.Name__c}"/>
      
      </apex:pageBlockTable>
      
      </apex:pageBlockSection>