You need to sign in to do that
Don't have an account?
Anne Moore
Test Class Addition
Hello! I am not a developer! I wanted to start off with that.
We have an existing test class. On the test class that's running, the object has a required field that has a lookup filter. Below is the current information in the test class:
//find existing contact from an acccount with the right record type
Contact testContact = [SELECT id, name FROM Contact c where c.active__c = true and c.accountid in(SELECT id FROM ACCOUNT a where a.recordtypeid = :brokerRecordType) Limit 1 ];
I recently had to add to the lookup filter on this field that the contact record should also only access contacts from the account selected in another lookup field on this object. Would anyone be willing to offer advice on how can I add this to the test class? Thanks in advance!!
We have an existing test class. On the test class that's running, the object has a required field that has a lookup filter. Below is the current information in the test class:
//find existing contact from an acccount with the right record type
Contact testContact = [SELECT id, name FROM Contact c where c.active__c = true and c.accountid in(SELECT id FROM ACCOUNT a where a.recordtypeid = :brokerRecordType) Limit 1 ];
I recently had to add to the lookup filter on this field that the contact record should also only access contacts from the account selected in another lookup field on this object. Would anyone be willing to offer advice on how can I add this to the test class? Thanks in advance!!
You may not even need the check that the record id matches the brokerRecordType, but its difficult to say for sure without knowing how the rest of your application works.