• Christian Smarsly
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
I am running a very basic setup on entitlements and milestones. That's why I am trying to auto populate entitlements on cases.

My approach in doing so is this:
trigger UpdateEntitlement on Case (after insert) {

if (trigger.isAfter && trigger.isInsert) {
 for (Case c : Trigger.new) {
  if (c.Entitlement == null) {
   c.Entitlement.id = [Select Id from Entitlement Where AccountId = :c.AccountId limit 1].id;
}}

}}

Unfortunately the Entitlement field remains blank. Does anyone know what I am doing wrong?
I am running a very basic setup on entitlements and milestones. That's why I am trying to auto populate entitlements on cases.

My approach in doing so is this:
trigger UpdateEntitlement on Case (after insert) {

if (trigger.isAfter && trigger.isInsert) {
 for (Case c : Trigger.new) {
  if (c.Entitlement == null) {
   c.Entitlement.id = [Select Id from Entitlement Where AccountId = :c.AccountId limit 1].id;
}}

}}

Unfortunately the Entitlement field remains blank. Does anyone know what I am doing wrong?