You need to sign in to do that
Don't have an account?
Dee Dee Aaron
Help to write test class
Hi there. I have a trigger that works. I just need help writing the test class. Can you please provide a test class instead of linking me to a page that says "how to write a test class". Thank you for your help.
trigger FeedCommentTest on FeedComment (after insert)
{
for(FeedComment f : Trigger.New)
{
if(UserInfo.getProfileId() == '00e6w000000QHyUAAW')
{
Sales_Engineering_Request__c SalesEngineeringRequestToUpdate = [SELECT ID FROM SALES_ENGINEERING_REQUEST__c WHERE ID =: f.ParentId];
SalesEngineeringRequestToUpdate.Status__c = 'Approved';
Update SalesEngineeringRequestToUpdate;
}
}
}
trigger FeedCommentTest on FeedComment (after insert)
{
for(FeedComment f : Trigger.New)
{
if(UserInfo.getProfileId() == '00e6w000000QHyUAAW')
{
Sales_Engineering_Request__c SalesEngineeringRequestToUpdate = [SELECT ID FROM SALES_ENGINEERING_REQUEST__c WHERE ID =: f.ParentId];
SalesEngineeringRequestToUpdate.Status__c = 'Approved';
Update SalesEngineeringRequestToUpdate;
}
}
}
Please mark this answer as Best if you find the information shared helpful. Thank You!