You need to sign in to do that
Don't have an account?
Dee Dee Aaron
Set criteria for trigger to fire.
I have a trigger that works, but I want to add criteria.
If the Sales Engineering Request “Status” does not equal “Approved” or “Unable to Meet Request”, then trigger this.
How do I modify this? Thank you for your help.
My Trigger:
trigger FeedCommentTest on FeedComment (after insert)
{
for(FeedComment f : Trigger.New)
{
if(UserInfo.getProfileId() == '00e6w000000FjiUAAS')
{
Sales_Engineering_Request__c SalesEngineeringRequestToUpdate = [SELECT ID FROM SALES_ENGINEERING_REQUEST__c WHERE ID =: f.ParentId];
SalesEngineeringRequestToUpdate.Status__c = 'Approved';
Update SalesEngineeringRequestToUpdate;
}
}
}
If the Sales Engineering Request “Status” does not equal “Approved” or “Unable to Meet Request”, then trigger this.
How do I modify this? Thank you for your help.
My Trigger:
trigger FeedCommentTest on FeedComment (after insert)
{
for(FeedComment f : Trigger.New)
{
if(UserInfo.getProfileId() == '00e6w000000FjiUAAS')
{
Sales_Engineering_Request__c SalesEngineeringRequestToUpdate = [SELECT ID FROM SALES_ENGINEERING_REQUEST__c WHERE ID =: f.ParentId];
SalesEngineeringRequestToUpdate.Status__c = 'Approved';
Update SalesEngineeringRequestToUpdate;
}
}
}
Don't use the harcodeed profile Id use profile name.
Thanks,
Maharajan.C
All Answers
you can go like this:
trigger FeedCommentTest on FeedComment (after insert)
{
for(FeedComment f : Trigger.New)
{
if(f.status!='Approved' || f.status!='Unable to Meet Request')
}
}
Don't use the harcodeed profile Id use profile name.
Thanks,
Maharajan.C