You need to sign in to do that
Don't have an account?
Dman100
creating and deploying triggers
I read that you can only create a trigger in the sandbox. Is this correct? If so, how do you deploy the trigger to the production instance once the trigger has been created? Does it automatically get added to the production environment or do you have to do something to deploy the trigger?
Are triggers available with the Professional Edition or only with the Enterprise and Unlimited Editions?
Thanks for any help.
Triggers and Apex code in general can only be created in either development orgs or sandboxes. Once everything is working there you can deploy it to production orgs. The easiest way to create the code and deploy it is to use Eclipse with the Force.com plugin since deployment is not possible via the browser and using ant is way harder than using Eclipse.
Keep in mind that to be able to deploy to production orgs you have to have unit tests that cover at 75% of your code.
One the triggers and everything else is working in salesforce as needed you can do your other development in Visual Studio using the newly exposed webservice methods (if you created some of course) via the wsdl file.
All development concerning salesforce objects and logic cannot be done in Visual Studio though.
regards,
Andreas
Hi Andreas,
I just installed Eclipse, but I've never used before. Are there any tutorials, simple examples to help get someone new to using Eclipse up and running. As a starting point, I'm just want to create a couple of simple triggers that will auto populate some fields. Once I'm successful at implementing those, I'd like to move into some more complex triggers.
Any tutorials that walk thru this process? Not having used Eclipse before I feel very much in the dark as to where to start.
Also, can you explain what you meant about 75% unit testing to deploy to production? I didn't understand what you meant.
Thanks for your help.
Regards.
I haven't seen any tutorials but the interface is very GUI-esque. Make sure you have installed for Force.com plug-ins (from the mirror sites).
First, catalog the instance you want by File > New > Force.com Project and walk through the steps to create the instance. Common errors here are not specifying the correct endpoint or security token.
Then under the instance name, e.g. Sandbox, expand the tree to show src > unpackaged > triggers. Right-click under the Force.com sub-menu click New Trigger.
SFDC has implemented some controls to make sure triggers do not run in infinite loops or use too many resources. In order to test that your code is in "compliance", for lack of a better term, it requires a test class for each trigger and class. There are some examples in the Cookbook that can help you to write triggers as well as their associated test classes.