+ Start a Discussion
vijayakumar Bvijayakumar B 

URL Comparision

hi friends,
 this trigget is not working.
my aim is to print an error message  if the selected url is shine.com

 could you help me..?

trigger ppp on Job_Posting__c (before insert,before update) {

//Employment_Website__c web=new Employment_Website__c();
for (Job_Posting__c jobInLoop : Trigger.new) {
        jobInLoop.addError('WE cannot post your Job to shine.com');
//Web_Address__c   Price_Per_Post__c

Vamsi KrishnaVamsi Krishna

you can convert the input string to all lower case and use contains function to check if the value has shine.com ...


How you are executing this Trigger ??

Also,what is the Datattype of field Employment_Website__c
vijayakumar Bvijayakumar B
*Data type of the field "Employment_Website__c" is URL and in fact i'm tying compare it with the given string. then1 thing i want to tell is here look up relation is there..*
The way @Vamsi has suggested looks good to me,just to add one thign to it ,try below code in your if condition :-
and I didn't understand what you meant by lookup relation here ...