+ Start a Discussion
m_roarkm_roark 

How do I update the API version for an older trigger in my production environment?

I have some older triggers generated in my production environment using old versions of the APEX which I want to update to the most recent versions in order to gain access to updated methods and functionality.  I currently use the Force.com IDE for Eclipse to develop all of my triggers and classes.

 

I tried updating the version in the'*.trigger-meta.xml' file.  However, when I attempt to save the updated file, I receive this error message: 'Save error: Unable to perform save on all files: An unexpected error has occurred. Please try again, or check the log file for details.'

 

 

Short of deleting this trigger and recreating it, how can I update the API version of the trigger?

Best Answer chosen by Admin (Salesforce Developers) 
m_roarkm_roark

I do have a sandbox available, and am using the most recent version of the Force.com IDE (which gives me up to API version 16.0).

 

Let me just confirm the workflow steps.

 

1.  Edit the trigger in my UAT sandbox environment to update the API version.

2.  Test trigger to validate that it functions in the new API version.

3.  Open Eclipse, and, in the project which corresponds to my sandbox, refresh the trigger from SalesForce.

4.  Deploy the trigger to production using the 'Deploy to SalesForce' option in the toolkit.

 

 This does look like it will work.  I will test it out, and update this thread once I confirm if this does solve my issue.

 

*Updated to include step suggested by wchristny

Message Edited by m_roark on 02-17-2010 09:18 AM

All Answers

wchristnywchristny

Do you have a sandbox available to you?  If so, when you edit the trigger in the sandbox, there should be a "Version Settings" tab that would allow you to adjust the API Version.

 

Just

wchristnywchristny

Just be aware of the API versions available to you in Eclipse.  You may need to update Eclipse to utiltize newer API versions.

m_roarkm_roark

I do have a sandbox available, and am using the most recent version of the Force.com IDE (which gives me up to API version 16.0).

 

Let me just confirm the workflow steps.

 

1.  Edit the trigger in my UAT sandbox environment to update the API version.

2.  Test trigger to validate that it functions in the new API version.

3.  Open Eclipse, and, in the project which corresponds to my sandbox, refresh the trigger from SalesForce.

4.  Deploy the trigger to production using the 'Deploy to SalesForce' option in the toolkit.

 

 This does look like it will work.  I will test it out, and update this thread once I confirm if this does solve my issue.

 

*Updated to include step suggested by wchristny

Message Edited by m_roark on 02-17-2010 09:18 AM
This was selected as the best answer
wchristnywchristny

I would add one more step to be safe.  After updating the API version, you should retest the trigger before deploying it to production to make sure the version change didn't break it.

m_roarkm_roark
This worked!  Thanks for the insight wchristny.