You need to sign in to do that
Don't have an account?
Allister McKenzie 10
Retrieve child value from relationship query
I am trying to use the case priority field, of the most recently inserted case, to change a field on the account.
How would I do this.
for (Account a : [SELECT id,(select id, priority from cases order by createddate desc limit 1) FROM account WHERE Id IN :parent]){ if (a.Priority == 'medium') { // update account } }
How would I do this.
Maybe not the cleanest example, but this looks for the first case with a priority of medium.