• mannar
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
when I try to add it as a New Trigger in the contacts "buttons and links".
trigger ContAutoRegionTrigger on Contact (before insert,before update)
{
If((Trigger.new.MailingPostalcode=='94501' || Trigger.new.MailingPostalcode=='94502')&& (Trigger.new.MailingCountry== 'USA'))
{
Trigger.new.Region__C = 'BAY AREA';
}
else
{
Trigger.new.Region__C = 'north america';
}
}
 
I  get the error as:
Error: Compile Error: Single row trigger not allowed, use the bulk keyword at line 1 column 1
 
 
Regards
Reena
 
 
<SCRIPT type=text/javascript>function initSelectionInEditor() { setSelectionInEditor('Body', 0, 0) }setContentWindow(window);initSelectionInEditor();</SCRIPT>

“We have developed code using standard Apex language Trigger feature that automatically populates a field with geography information based on zip codes, US states and countries.   As we could not get the information from Apex guide on the usage of picklists for Zipcodes, states and countries, we had to hardcode the literals for zipcodes, states and countries in the trigger for checking.   We made the code working but it has become unreadable.  My precise questions:

 

1.     How do we use picklists in Triggers?

2.    Salesforce.com has not made Triggers available in Enterprise edition yet and we need to go live with the functionality in production; is there any other alternative you can suggest?

3.    We were given a non-Apex language alternative to use but the byte size of the code is more than 1000 characters.

 

So far we have only received generic responses to similar queries.  Can you pls provide specific responses?

 

What we are requesting is not a new feature from SF.com – rather we want to know how to use the existing feature effiectively.”

 

We have developed code using standard Apex language Trigger feature
that automatically populates a field with geography information based 
on zip codes, US states and countries.   As we could not get the 
information from Apex guide on the usage of picklists for Zipcodes, states and 
countries, we had to hardcode the literals for zipcodes, states and 
countries in the trigger for checking.   We made the code working but it 
has become unreadable.  My precise questions:
 
 
1.     How do we use picklists in Triggers?
 
2.    Salesforce.com has not made Triggers available in Enterprise 
edition yet and we need to go live with the functionality in production; is 
there any other alternative you can suggest? 
 
3.    We were given a non-Apex language alternative to use but the byte 
size of the code is more than 1000 characters.
 
 
 
So far we have only received generic responses to similar queries.  Can 
you pls provide specific responses?
 
 
 
What we are requesting is not a new feature from SF.com – rather we 
want to know how to use the existing feature effiectively.†
 
 
Regards
Reena
 
 
ref:00D062.50033C4dr:ref