function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
Try the below code snippet as reference:
Trigger chekaccount on contac(before insert)
{
contact con=trigger.new[0];
if(con.accountid!=null)
integer i= [select count() from contact where accountid=:con.accountid];
if(i>0)
trigger.addError('you can\'t add this contact');
}
Note: contact has a lookup with account.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
k..
I want to use lookup datatype in triggers ..?
and my task is check whether new lead is belongs to particular QUEUE or not?
please help me to achieve above...........
you need to query leads by comparing queue id.Queue id comes from Group .
Hi,
Try the below code snippet as reference:
Trigger chekaccount on contac(before insert)
{
contact con=trigger.new[0];
if(con.accountid!=null)
{
integer i= [select count() from contact where accountid=:con.accountid];
if(i>0)
{
trigger.addError('you can\'t add this contact');
}
}
}
Note: contact has a lookup with account.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
k..
I want to use lookup datatype in triggers ..?
and my task is check whether new lead is belongs to particular QUEUE or not?
please help me to achieve above...........
you need to query leads by comparing queue id.Queue id comes from Group .