You need to sign in to do that
Don't have an account?
Heather_Hanson
Test class for record type selector component
I’m having trouble with my test class…not sure what I’m doing wrong, but I’m getting the following errors:
Illegal assignment from Map to List (line 6)
Method does not exist or incorrect signature: void getRecTypeId(String) from the type RecordTypeSelector (line 11)
My test class is for a custom record type selector component on my Asset object for my customer object OrderProject__c.
Any help would be appreciated!!
Illegal assignment from Map to List (line 6)
Method does not exist or incorrect signature: void getRecTypeId(String) from the type RecordTypeSelector (line 11)
My test class is for a custom record type selector component on my Asset object for my customer object OrderProject__c.
Any help would be appreciated!!
@isTest public class TestRecordTypeSelector { static testmethod void testFetchRecordTypes() { List<String> value = RecordTypeSelector.fetchRecordTypeValues('Asset'); } static testmethod void testgetRecordTypeId() { String recordTypeLabel = 'Avaya'; ID testId = RecordTypeSelector.getRecTypeId(recordTypeLabel); System.assert(testId != null); } }
Can you please post the Apex Class: RecordTypeSelector .
It will help us to solve your issue.
Thanks,
Maharajan.C
Try the below changes in test class:
@isTest
public class TestRecordTypeSelector {
static testmethod void testFetchRecordTypes() {
Map<Id, String> value = RecordTypeSelector.fetchRecordTypeValues('Asset');
}
}
In your above post i can see only the fetchRecordTypeValues method what about getRecTypeId method is it needed or not?
Thanks,
Maharajan.C
Method does not exist or incorrect signature: void getRecTypeId(String) from the type RecordTypeSelector
I think I may need to review the whole component too though because the pop-up is happening when I press my quick action and my list of Record Types is supplied, but I can't save because I'm getting the following error even though I'm populating the Asset ID:
No access to field AssetId. Either the field was removed from the entity or access to this field was removed.
Maybe I just need to start my weekend, but any help or feedback you can provide would be greatly appreciated!!