-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
7Questions
-
14Replies
A test class for a trigger
Hello,
I would like to know when a trigger is deployed, is the test class already used ? Or it's only used during the deployment ?
As I have a pb with a deployed trigger and its test class to deploy another trigger, I was thinking I could inactivate the test class already deployed by Eclipse ? Can you confirm me if my idea is correct ?
Thank you.
-
- Med Usa1
- February 15, 2012
- Like
- 0
- Continue reading or reply
How to deploy a trigger in Eclipse ?
Hello,
I have an error in the deployment of a trigger in Salesforce and I would like to know if there is another way to deploy it, for example in Eclipse and to go beyond the error ?
(The error is due to a limit : Number of SOQL queries: 101 out of 100 ******* CLOSE TO LIMIT and I can't solve the pb, I haven't a query inside a for loops...)
Thank you for your help.
-
- Med Usa1
- February 15, 2012
- Like
- 0
- Continue reading or reply
Deploying a trigger : System.LimitException
Hello,
I try to deploy a trigger and its test class in production but I have this error :
Failure Message: "System.LimitException: Too many query rows: 50001", Failure Stack Trace:...
The code coverage of this trigger is 100%.
I think the pb is due to another test class for another trigger but the both (the 2 triggers and the 2 test classes) are on the same object (Opportunity).
The other trigger is already deployed.
How can I solve this problem ?
Thank you.
-
- Med Usa1
- February 09, 2012
- Like
- 0
- Continue reading or reply
How can I delete trigger from production ?
Hello,
I try to delete a trigger and its test class from production.
I follow this process :
Using the IDE:
1) Assuming you have a sandbox environment synchronized with your Prod org, you will first want to inactivate the trigger in sandbox. You can refresh your IDE project to consume these changes
2) In the Sandbox org, you will then want to run all tests: Navigate to Setup->Develop->Apex Classes and click "Run All Tests". This will run all of the tests in the sandbox org. This is an important step to validate whether or not the inactive trigger has impacted any asserts within your test methods. Assuming this behavioral change has impacted your tests, you will need to update your asserts to reflect this.
3) Once all tests are passing, you can now deploy these changes to your production environment. You can use the Deploy to Server wizard in the IDE. Simply select the tests that you have modified, as well as the inactive trigger, and deploy these changes to your production environment.
4) Validate the trigger is now inactive in your production environment.
Deleting the trigger (if necessary - an inactive trigger will not fire and therefore can be considered as "soft deleted")
5) Create a new IDE project against your Active production org.
6) Right click on the specified trigger and select delete. Accept the option to delete from server. Since the trigger is inactive - it can now be deleted from the production environment.
But I can't deploy an inactive trigger, I have this error :
Failure Message: "System.AssertException: Assertion Failed: Expected: 1002, Actual: null", Failure Stack Trace: "Class.PI_Num_Auto_Increment_Test_Class.validate_PI_Num_Auto_Increment: line 38, column 9 External entry point"
Can you explain me how can I do this deletion ?
Thank you.
-
- Med Usa1
- February 03, 2012
- Like
- 0
- Continue reading or reply
Test Class For A Trigger
Hello,
I have on Opportunity a trigger and a test class for a special case (created and deployed for a long time by someone else).
I have created another trigger (always on opportunity) to do totaly something else and I created a test class to cover the code. (100% of coverage)
When I want to deploy my new trigger and its test class in production I have this error :
Failure Message: "System.LimitException: Too many query rows: 50001", Failure Stack Trace:...
It tries to test not my test class but the other test class of the old trigger.
I don't understand why the other Test Class is executed and for the wrong trigger ? Why don't it take the good test class ?
Could you explain to me and give me a solution for this pb ?
Thank you.
-
- Med Usa1
- January 31, 2012
- Like
- 0
- Continue reading or reply
Pb during the deployment of a trigger
Hello,
I try to deploy my trigger and its test class in production but I have this error :
Failure Message: "System.LimitException: Too many query rows: 50001", Failure Stack Trace:...
The code coverage of this trigger is 100%.
I think the pb is due to another test class for another trigger but the both (the 2 triggers and the 2 test classes) are on the same object (Opportunity).
The other trigger is already deployed.
I don't understand why the other Test Class is executed and for the wrong trigger ? Why don't it take the good test class ?
Could you explain to me and give me a solution for this pb ?
Thank you.
-
- Med Usa1
- January 30, 2012
- Like
- 0
- Continue reading or reply
Trigger : How to set a value to a field
Hello,
I want to add a value to a field on a before insert trigger.
I want to make an auto number with different conditions so to select the last number and set the value = last + 1 to the field.
Where can I find a documentation for that ? To add a value to a field on before insert ?
I don't know how to recover this value :
Opportunity q_opp = [SELECT MAX(Opp_Num__c) FROM Opportunity];
and what it will return if there is no record in the table.
Thank you.
-
- Med Usa1
- January 18, 2012
- Like
- 0
- Continue reading or reply
A test class for a trigger
Hello,
I would like to know when a trigger is deployed, is the test class already used ? Or it's only used during the deployment ?
As I have a pb with a deployed trigger and its test class to deploy another trigger, I was thinking I could inactivate the test class already deployed by Eclipse ? Can you confirm me if my idea is correct ?
Thank you.
- Med Usa1
- February 15, 2012
- Like
- 0
- Continue reading or reply
How to deploy a trigger in Eclipse ?
Hello,
I have an error in the deployment of a trigger in Salesforce and I would like to know if there is another way to deploy it, for example in Eclipse and to go beyond the error ?
(The error is due to a limit : Number of SOQL queries: 101 out of 100 ******* CLOSE TO LIMIT and I can't solve the pb, I haven't a query inside a for loops...)
Thank you for your help.
- Med Usa1
- February 15, 2012
- Like
- 0
- Continue reading or reply
Deploying a trigger : System.LimitException
Hello,
I try to deploy a trigger and its test class in production but I have this error :
Failure Message: "System.LimitException: Too many query rows: 50001", Failure Stack Trace:...
The code coverage of this trigger is 100%.
I think the pb is due to another test class for another trigger but the both (the 2 triggers and the 2 test classes) are on the same object (Opportunity).
The other trigger is already deployed.
How can I solve this problem ?
Thank you.
- Med Usa1
- February 09, 2012
- Like
- 0
- Continue reading or reply
How can I delete trigger from production ?
Hello,
I try to delete a trigger and its test class from production.
I follow this process :
Using the IDE:
1) Assuming you have a sandbox environment synchronized with your Prod org, you will first want to inactivate the trigger in sandbox. You can refresh your IDE project to consume these changes
2) In the Sandbox org, you will then want to run all tests: Navigate to Setup->Develop->Apex Classes and click "Run All Tests". This will run all of the tests in the sandbox org. This is an important step to validate whether or not the inactive trigger has impacted any asserts within your test methods. Assuming this behavioral change has impacted your tests, you will need to update your asserts to reflect this.
3) Once all tests are passing, you can now deploy these changes to your production environment. You can use the Deploy to Server wizard in the IDE. Simply select the tests that you have modified, as well as the inactive trigger, and deploy these changes to your production environment.
4) Validate the trigger is now inactive in your production environment.
Deleting the trigger (if necessary - an inactive trigger will not fire and therefore can be considered as "soft deleted")
5) Create a new IDE project against your Active production org.
6) Right click on the specified trigger and select delete. Accept the option to delete from server. Since the trigger is inactive - it can now be deleted from the production environment.
But I can't deploy an inactive trigger, I have this error :
Failure Message: "System.AssertException: Assertion Failed: Expected: 1002, Actual: null", Failure Stack Trace: "Class.PI_Num_Auto_Increment_Test_Class.validate_PI_Num_Auto_Increment: line 38, column 9 External entry point"
Can you explain me how can I do this deletion ?
Thank you.
- Med Usa1
- February 03, 2012
- Like
- 0
- Continue reading or reply
Trigger : How to set a value to a field
Hello,
I want to add a value to a field on a before insert trigger.
I want to make an auto number with different conditions so to select the last number and set the value = last + 1 to the field.
Where can I find a documentation for that ? To add a value to a field on before insert ?
I don't know how to recover this value :
Opportunity q_opp = [SELECT MAX(Opp_Num__c) FROM Opportunity];
and what it will return if there is no record in the table.
Thank you.
- Med Usa1
- January 18, 2012
- Like
- 0
- Continue reading or reply
How do I delete triggers from salesforce
I had EmployeeBefore and EmployeeAfter triggers. I deleted them from Eclipse but how do I get rid of it in SF. I created a new trigger called EmployeeTrigger. When I run tests it is still executing those two deleted triggers along with Employee Trigger. So for some reason I need to delete it from Salesforce. Under src, I right clicked on Triggers and said save to server but it is still executing both before and after triggers.
Quick help would be appreciated.
thanks in advance,
kathyani
- kathyani
- December 04, 2008
- Like
- 0
- Continue reading or reply