You need to sign in to do that
Don't have an account?
Christian Smarsly
My approach in doing so is this:
Unfortunately the Entitlement field remains blank. Does anyone know what I am doing wrong?
auto populate entitlement on case
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?
Cross object formula doesn't help much, because it's a lookup field.
UpdateEntitlement: execution of BeforeInsert caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.UpdateEntitlement