function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GauravGathaniaGauravGathania 

Urgent-Migrating Scontrols to Production

Hi,
I am trying to migrate a set of Scontrols and some custom fields from Qa/Dev/Sandbox to Production using  salesforce Ant(Migration Tool).
I am able to retrieve the content from QA Environment successfully.But I am not able to deploy it to Production.
Deployment to Dev and Sandbox from QA is happening perfectly.
I am facing following run time error while I try the same steps for Production:

C:\salesforce_ant\sample>ant deployUnpackaged
Buildfile: build.xml

deployUnpackaged:

BUILD FAILED
C:\salesforce_ant\sample\build.xml:25: Failures:
Test failure, method: testClass.test -- System.DmlException: Update failed. Firs t exception on row 0 with id a0R400000005mpPEAQ; first error: ENTITY_IS_DELETED,  entity is deleted stack Class.testClass.test: line 6, column 1

Code coverage issue, class: tocAgreementAfterUpdate -- Test coverage of selected  Apex Trigger is 0%, at least 1% test coverage is required Code coverage issue, class: tocOportunityAfterUpdate -- Test coverage of selecte d Apex Trigger is 0%, at least 1% test coverage is required Code coverage issue, class: trmAccountBeforeUpdate -- Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required Code coverage issue -- Average test coverage across all Apex Classes and Trigger s is 0%, at least 75% test coverage is required







Message Edited by GauravGathania on 08-23-2008 12:51 AM
jpizzalajpizzala
Looks like one of your Apex test methods is trying to use a record that has been deleted from your production org.  What happens when you try to access the record in Salesforce using the provided Salesforce ID?

Instead of using Salesforce IDs directly in your code, try to create the elements in memory for your test methods.  This will allow you to use the same test methods across any version of your org (developer, sandbox, production) as long as the tested fields exist.  Here are a few examples from the Apex docs:

GauravGathaniaGauravGathania
Hi,
I am not sure whether the user has created any such object previously.
This is so because we are using a common user with admin rights.

I just want to migrate my Scontrols and Formula-Fields and right now I don't have any classes or triggers to worry about.

Can using another user with Admin privileges will solve the issue?
I have not tried it as being a developer I want to avoid all R&D because its a Production Box.

Thanks for your prompt reply.
jpizzalajpizzala
If your SControls and formula fields require objects/fields that do not exist in the org you are trying to deploy to, you will receive deployment errors.  First, make sure that all necessary objects/fields are present before deploying your new code.

Then, I would suggest using the Force.com plugin for the Eclipse IDE if you are migrating SControls (or for any Force.com development).  In my opinion, the ANT tool should be used only as a last resort when deploying Apex classes/triggers fails in the IDE.
GauravGathaniaGauravGathania
Hi,
Want to confirm something that is there any setting on Production that makes sure that Apex Test Classes are executed before any Scontrol or any other object upload ?
RachnaRachna
Hi

If you have fixed this problem can you please post the solution here?.I am facing a similar one.

Thanks
Rachna