You need to sign in to do that
Don't have an account?
Josephine But
How to get the name of the reference?
Hi,
I have the following statement I want to do the testing, System.assertEquals('Kitchen Cabinet',stockX[0].product__c );
stockX[0].product__c is a reference( a lookup field to the product), how can I get the name of the product instead of getting the reference??
Thanks,
Jo
I have the following statement I want to do the testing, System.assertEquals('Kitchen Cabinet',stockX[0].product__c );
stockX[0].product__c is a reference( a lookup field to the product), how can I get the name of the product instead of getting the reference??
Thanks,
Jo
You can use stockX[0].product__r.Name to reference the name field from product.
Thanks.