• foraworm
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 8
    Replies
Hi all,


I am trying to deploy a trigger to a production environment.

The trigger was created directly within Salesforce (Setup|Crate|Object|Trigger|Button New).
After a long search I decided to install eclipse with Fore.com IDE plugin.

After check in the sandbox version I did some changes on the trigger and save it back to sandbox. It works fine.

Using the deploy wizard within the IDE (Force.com|Deploy to Server ...) does not work.

I guess I need a testclass but I have no idea how to do this and where I have to save this testclass.
Is there a simple step-by-step instuction.

Another problem is that field names and object names between sandbox and production environment differ.
So I have to change some field and object names before deploy the trigger to production environment.
I do not know I that causes any problem.

The trigger:

 

Trigger checkTrialProductAvailable on Trial_Connect_del__c (before insert,before update) { List<ID> TrialProductIDs = new List<ID>{}; List<ID> TrialIDs = new List<ID>{}; for(Trial_Connect_del__c objTrial_Connect : Trigger.new){ if(objTrial_Connect.Trial_Product_RoW__c != null){ TrialProductIDs.add(objTrial_Connect.Trial_Product_RoW__c); TrialIDs.add(objTrial_Connect.Trial_ROW__c); } } if(TrialProductIDs.size() > 0){ if(TrialProductIDs.size() == 1){ ID myCurrentT_Id = TrialIDs.get(0); Trial_ROW__c myCurrentTrialObj = [SELECT Trial_Actual_Ship_Date__c, Verf_gbar_ab__c FROM Trial_ROW__c T WHERE T.ID = : myCurrentT_Id]; Date myCurrentTrial_Actual_Ship_Date = myCurrentTrialObj.Trial_Actual_Ship_Date__c; Date myCurrentTrial_Verf_gbar_ab_Date = myCurrentTrialObj.Verf_gbar_ab__c; Map<ID,Trial_Connect_del__c> mapTrial_ConnectFields = new Map<ID,Trial_Connect_del__c>([ Select Id, Trial_ROW__c, Trial_Product_RoW__c From Trial_Connect_del__c Where Trial_Product_RoW__c in :TrialProductIDs]); List<ID> myList = new List<ID>(mapTrial_ConnectFields.keySet()); Trial_Connect_del__c myTC; Trial_ROW__c myT; ID myIdT; List<ID> listTrialID = new List<ID>(); for(ID myID : myList){ myTC = mapTrial_ConnectFields.get(myID); myIdT = myTC.Trial_ROW__c; if(myIdT != null){ listTrialID.add(myIdT); } } List<Trial_ROW__c> objListTrial = new List<Trial_ROW__c>(); objListTrial = [SELECT T.Name FROM Trial_ROW__c T WHERE (T.ID IN :listTrialID) AND ((T.Verf_gbar_ab__c > :myCurrentTrial_Actual_Ship_Date) AND (T.Trial_Actual_Ship_Date__c < :myCurrentTrial_Verf_gbar_ab_Date)) ]; List<String> listStrTrialName = new List<String>(); for(Trial_ROW__c objTrialName : objListTrial){ listStrTrialName.add(objTrialName.Name); } if(listStrTrialName.isEmpty() == false){ Trial_Connect_del__c objTrial_Connect2 = trigger.new[0]; objTrial_Connect2.addError('Trial Product is occupied by other Trial(s) ' + listStrTrialName); } } else{ Trial_Connect_del__c objTrial_Connect3 = trigger.new[0]; objTrial_Connect3.addError('Unexpected count of Trial Products!'); } } }

 

Summary Log:

 

*** Deployment Log *** Result: FAILED Date: 30. Oktober 2009 12:22:44 MEZ # Deployed From: Project name: BerchtoldSandbox Username: salesforce@hwi.info Endpoint: test.salesforce.com # Deployed To: Username: salesforce@hwi.info Endpoint: www.salesforce.com # Deploy Results: File Name: package.xml Full Name: package.xml Action: UPDATED Result: SUCCESS Problem: n/a File Name: triggers/checkTrialProductAvailable.trigger Full Name: checkTrialProductAvailable Action: UPDATED Result: SUCCESS Problem: n/a # Test Results: checkTrialProductAvailable Testabdeckung für ausgewählte Apex Trigger beträgt0 %; mindestens 1 % Testabdeckung erforderlich Die durchschnittliche Testabdeckung für alle Apex-Klassen und -Auslöser beträgt 37 %; mindestens 75 % Testabdeckung ist erforderlich

 

Debug Log:

 

*** Beginning Test 1: unsubscribe.static testMethod void testUnsubscribe2() 20091030131033.922:Class.unsubscribe.testUnsubscribe2: line 134, column 4: Insert: SOBJECT:Lead 20091030131033.922:Class.unsubscribe.testUnsubscribe2: line 134, column 4: DML Operation executed in 123 ms 20091030131033.922:Class.unsubscribe.testUnsubscribe2: line 141, column 4: Insert: SOBJECT:Contact 20091030131033.922:Class.unsubscribe.testUnsubscribe2: line 141, column 4: DML Operation executed in 44 ms 20091030131033.922:Class.unsubscribe.handleInboundEmail: line 76, column 3: No Unsuscribe word found in the subject line. 20091030131033.922:Class.unsubscribe.testUnsubscribe2: line 149, column 4: returning Messaging.InboundEmailResult from method global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail, Messaging.InboundEnvelope) in 2 ms 20091030131033.922:External entry point: returning from end of method static testMethod void testUnsubscribe2() in 214 ms Cumulative resource usage: Resource usage for namespace: (default) Number of SOQL queries: 0 out of 100 Number of query rows: 0 out of 500 Number of SOSL queries: 0 out of 20 Number of DML statements: 2 out of 100 Number of DML rows: 2 out of 500 Number of script statements: 38 out of 200000 Maximum heap size: 0 out of 1000000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 10 Number of record type describes: 0 out of 10 Number of child relationships describes: 0 out of 10 Number of picklist describes: 0 out of 10 Number of future calls: 0 out of 10 Number of find similar calls: 0 out of 10 Number of System.runAs() invocations: 0 out of 20 Total email recipients queued to be sent : 0 Stack frame variables and sizes: Frame0 *** Ending Test unsubscribe.static testMethod void testUnsubscribe2() *** Beginning Test 2: unsubscribe.static testMethod void testUnsubscribe() 20091030131034.141:Class.unsubscribe.testUnsubscribe: line 103, column 4: Insert: SOBJECT:Lead 20091030131034.141:Class.unsubscribe.testUnsubscribe: line 103, column 4: DML Operation executed in 42 ms 20091030131034.141:Class.unsubscribe.testUnsubscribe: line 110, column 4: Insert: SOBJECT:Contact 20091030131034.141:Class.unsubscribe.testUnsubscribe: line 110, column 4: DML Operation executed in 21 ms 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 33, column 3: SelectLoop:LIST:SOBJECT:Contact 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 33, column 20: SOQL query with 1 row finished in 69 ms 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 33, column 3: Number of iterations: 1 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 45, column 5: Update: LIST:SOBJECT:Contact 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 45, column 5: DML Operation executed in 102 ms 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 53, column 3: SelectLoop:LIST:SOBJECT:Lead 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 53, column 17: SOQL query with 1 row finished in 8 ms 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 63, column 12: Lead Object: Lead:{Name=Rasmus Mencke, Email=rmencke@salesforce.com, HasOptedOutOfEmail=true, Id=00Q2000000DoRoHEAV} 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 53, column 3: Number of iterations: 1 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 66, column 3: Update: LIST:SOBJECT:Lead 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 66, column 3: DML Operation executed in 24 ms 20091030131034.141:Class.unsubscribe.handleInboundEmail: line 73, column 2: Found the unsubscribe word in the subject line. 20091030131034.141:Class.unsubscribe.testUnsubscribe: line 118, column 4: returning Messaging.InboundEmailResult from method global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail, Messaging.InboundEnvelope) in 212 ms 20091030131034.141:External entry point: returning from end of method static testMethod void testUnsubscribe() in 281 ms Cumulative resource usage: Resource usage for namespace: (default) Number of SOQL queries: 2 out of 100 Number of query rows: 2 out of 500 Number of SOSL queries: 0 out of 20 Number of DML statements: 4 out of 100 Number of DML rows: 4 out of 500 Number of script statements: 45 out of 200000 Maximum heap size: 0 out of 1000000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 10 Number of record type describes: 0 out of 10 Number of child relationships describes: 0 out of 10 Number of picklist describes: 0 out of 10 Number of future calls: 0 out of 10 Number of find similar calls: 0 out of 10 Number of System.runAs() invocations: 0 out of 20 Total email recipients queued to be sent : 0 Stack frame variables and sizes: Frame0 *** Ending Test unsubscribe.static testMethod void testUnsubscribe() Cumulative profiling information: No profiling information for SOQL operations. No profiling information for SOSL operations. No profiling information for DML operations. No profiling information for method invocations.

 

 

 

Hope someone can help.

 

Thanks! 

 

 

Hi all,

 

I am new in Apex and Salesforce. 

I have seen some posts to that issue.

But is there also a simple way (for example copy and paste) to migrate my trigger from Sandbox to production environment?

 

Thanks! 

Hi all,

 

We lend Demo-Products to our customers by a certain time period with a lot of date fields.

(delivery date to customer, arrival date at customer, delivery date back to us, arrival date back to us, ...)

 

I need a report that gives a overview over all Demo-Products, which shows where is a Product at certain point of time.

I can not present it in a well readable presentation with Salesforce standard tools.

 

Is there any possibility to create reports with Apex or extend Salesforce customized reports with Apex.

 

Thanks!

Hi,

 

I have a customized object  named  Demo  as a container for another object named Demo-Product. A Demo record can have one or more Demo-Products. Each Demo-Product can be part of many Demo records. Our customers can rent a Demo-Product for example for 30 days. 

 

If I add a Demo-Product to a Demo record for a particular customer I need an automatic check for the availability of the Demo-Product.

 

Sample:

 

Customer Micro Ltd. has Demo-Product xy1 from 10/15/2009 to 11/14/2009

Customer Masters Ltd. wants Demo-Product xy1 from 11/01/2009 to 11/30/2009

 

In such a case I need a notification for the User if he is trying to add the Demo-Product xy1 to a new or existing  Demo-Record. A message like "Demo-Product xy1 is occupied until 11/14/2009!" should appear. So I need to check all Demo-Products xy1 in all Demo records for a given time period.

 

I think I have to do it with Apex, however I have no experiences in Apex until yet.  I need a quick-tutorial to solve this issue with Apex and data access to the records.  Or is there any other posibility to solve this problem.

 

Thanks. 

Hi.

 

If i set a chart on a dashboard, it is not the same as the chart in the report. I don't have the same options to create charts like in a report.

 

How can i create the same charts in a dashboard like in a report?

Hi,

 

i have a time based workflow that was triggered on a field from a self maded object.

The workflow send a e-Mail. But this mail have to be send to the owner of a opportunity.

The self maded object are a part of an opportunity.

 

How can i realize that?

Hi,

 

i've to create a report/E-Mail about Trials (created object). This report/E-Mail have to be execute 5-Days before a date in the trial will be reach.

 

For example: In the field "deliverence (back)" is the date 08.23. . The current day is 08.18. . A repor/E-Mail will be send to the creater of the Trial.

 

What can i do to solve this problem?

 

Thank you.

Hi,

 

i have to build a chart like the chart from the picture. I have all dates, for example beginn of the "Transport", end of the "Transport".

But i dont know how i can build this chart. Can you help me?

 

Thank you

Message Edited by foraworm on 08-06-2009 01:14 AM

Hi,

 

i'm trying to create a report about Opportunities and Trials (self-provided). But i cant select any of the (date)fields form the trials. I need this fields for the report and for the cart.

If i create a report only about the trials , it is able to select (and see) these fields .

 

Do you know how i can solve this problem?

 

Thank you.

Message Edited by foraworm on 08-05-2009 03:23 AM

Hi,

 

how can i set in an report the default value of start date set to today and the default value of the end date 6 months later?

 

Thank you.

Hi,

 

how i can inform the Users about ther opportunities (for this month) automaticly with E-Mails.

Every user have to get only the opportunities witch the useres own.

 

Thank you.

Hi all,

 

I am new in Apex and Salesforce. 

I have seen some posts to that issue.

But is there also a simple way (for example copy and paste) to migrate my trigger from Sandbox to production environment?

 

Thanks! 

Hi all,

 

We lend Demo-Products to our customers by a certain time period with a lot of date fields.

(delivery date to customer, arrival date at customer, delivery date back to us, arrival date back to us, ...)

 

I need a report that gives a overview over all Demo-Products, which shows where is a Product at certain point of time.

I can not present it in a well readable presentation with Salesforce standard tools.

 

Is there any possibility to create reports with Apex or extend Salesforce customized reports with Apex.

 

Thanks!

Hi,

 

I have a customized object  named  Demo  as a container for another object named Demo-Product. A Demo record can have one or more Demo-Products. Each Demo-Product can be part of many Demo records. Our customers can rent a Demo-Product for example for 30 days. 

 

If I add a Demo-Product to a Demo record for a particular customer I need an automatic check for the availability of the Demo-Product.

 

Sample:

 

Customer Micro Ltd. has Demo-Product xy1 from 10/15/2009 to 11/14/2009

Customer Masters Ltd. wants Demo-Product xy1 from 11/01/2009 to 11/30/2009

 

In such a case I need a notification for the User if he is trying to add the Demo-Product xy1 to a new or existing  Demo-Record. A message like "Demo-Product xy1 is occupied until 11/14/2009!" should appear. So I need to check all Demo-Products xy1 in all Demo records for a given time period.

 

I think I have to do it with Apex, however I have no experiences in Apex until yet.  I need a quick-tutorial to solve this issue with Apex and data access to the records.  Or is there any other posibility to solve this problem.

 

Thanks. 

Hi,

 

i've to create a report/E-Mail about Trials (created object). This report/E-Mail have to be execute 5-Days before a date in the trial will be reach.

 

For example: In the field "deliverence (back)" is the date 08.23. . The current day is 08.18. . A repor/E-Mail will be send to the creater of the Trial.

 

What can i do to solve this problem?

 

Thank you.

Hi,

 

i'm trying to create a report about Opportunities and Trials (self-provided). But i cant select any of the (date)fields form the trials. I need this fields for the report and for the cart.

If i create a report only about the trials , it is able to select (and see) these fields .

 

Do you know how i can solve this problem?

 

Thank you.

Message Edited by foraworm on 08-05-2009 03:23 AM

Hi,

 

how can i set in an report the default value of start date set to today and the default value of the end date 6 months later?

 

Thank you.