• Andrew King
  • 10 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
  • 0
Hello, and thanks in advance for any suggestions, greatly appreciated!

we created a trigger that queries the accounts and creates custom invoice records for each stop on our service trucks.  each route is designated with a color and a service week per month (week 1, week2, etc) so that when you pick a color and a week, any account that meets that criteria will have an invoice record created.  we created workflows to push fields from the related account to each invidivual invoice record, but these workflows are causing trigger errors on our invoice creation trigger. any idea what to do, based on this error message?

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger Logistic_trigger_run caused an unexpected exception, contact your administrator: Logistic_trigger_run: execution of BeforeInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, A workflow or approval field update caused an error when saving this record. Contact your administrator to resolve it. Division undefined: []: Trigger.Logistic_trigger_run: line 177, column 1
hello, I'd like to create a trigger that compiles the sum of a number field on all order records, and updates the sum with each subsequent edit of the existing field on a record.  We need a running sum of the number field on all orders, and it needs to update every time we edit the number field on existing orders.  Any suggestions on how to write this trigger.  

Example: we have number field A with a value of 10 on order 1.  we have number field A with a value of 20 on order 2.  The sum is 30.  we go back and edit the number field on order 2 from 20 to 30.  we need the sum to change from 30 to 40.  instead it is changing from 30 to 60.  we need it to replace the old value with the new, not add the new value to the old.

Any suggestions will be greatly appreciated.
Trying to Deploy a Trigger from sandbox to production, getting these 3 failed components upon validation of change set:

API NAME: ChatterAnswersEscalationTriggerTest.validateQuestionEscalation()
PROBLEM: Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []", Failure Stack Trace:

API NAME: MyProfilePageControllerTest.testSave()
PROBLEM: Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Number needs to be in (999) 999-9999 format.: [Phone]", Failure Stack Trace: "Class.MyProfilePageControllerTest.testSave: line 34, column 1"

API NAME: chatter_answers_question_escalation_to_case_trigger
PROBLEM: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

Any suggestions/advice to get this change set to deploy would be EXTREMELY helpful.  Thanks in advance