• Tracey Okeby Lucan
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Help! This Apex Trigger has been working in the Org since before my time but it refuses to deail with the new currencies in prodcuts/opportunities. Anyone got any ideas why? 

trigger OppQuotaTrigger on Opportunity (before insert, before update, after insert, after update) {

    if (trigger.isBefore) {
      OppQuota.populateOppQuotaBudget(trigger.new);
    } else if (trigger.isAfter) {
      OppQuota.spawnTermOppNewContract(trigger.new);
      if (trigger.isUpdate) {
        OppQuota.updateOriginalOpp(trigger.old, trigger.new);
      }
    }
    
}


This is the error message I am getting but I don't understanding it as the Account, Opp and Product all have matching Currency Codes. 

Error:Apex trigger OppQuotaTrigger caused an unexpected exception, contact your administrator: OppQuotaTrigger: execution of AfterUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: PricebookEntryId (pricebook entry currency code does not match opportunity currency code): [PricebookEntryId]: Class.OppQuota.spawnTermOppNewContract: line 218, column 1
I need to create a field that returns the 15th of any month that opportunity is closed in. I think this should be simple but I cannot make it work.  Needs to be a Date value in the end. 

So basically if an Opp is closed in June 2017 then field should display 15/06/2017

Please help?
I need to create a field that returns the 15th of any month that opportunity is closed in. I think this should be simple but I cannot make it work.  Needs to be a Date value in the end. 

So basically if an Opp is closed in June 2017 then field should display 15/06/2017

Please help?