You need to sign in to do that
Don't have an account?
Manid
hai guys i am trying t o write code for this but i am not getting would please help me
write a trigger on Account, While inserting a account name value as ‘someName’ ended with ‘text’ ex: ‘renuText’.
it should through an error On Account Object if name field has 'text'
it should through an error On Account Object if name field has 'text'
trigger checkTrigger on Account(before insert)
{
list<Account> acc=Trigger.new;
for(integer i=0;i<acc.size();i++)
{
if(acc.get(i).Name.contains('text'))
{
acc.get(i).addError('Name contains Text....Please make the mendatory changes');
break;
}
}
}
This logic will stop acc to be saved if the name contains (''text") anywhere....
Hope this helps.....
write Validation rule for above scenario while inserting the record and Validation rule should not fire while updating form workflow it should accept.
I don’t think you can achieve same by simple Validation Rule..
Hope this helps and Mark best answer which you liked.
you can write Validation also for above scenario.
you can put
this code on validation formula editer only where Name is the Field Name of account Object.
If this code fullfill you requirement then pls mark as best answer which helps others also.
Thanks
Vikas
if(RIGHT(Name, 4)== 'Text',true,false)