APIv4 'Invalid field' but really permission problem
I used APIv4 Explorer to create this:
$results = \Civi\Api4\Email::update()
->addValue('on_hold', 0)
->addWhere('email', '=', 'test@example.org')
->addWhere('contact_id.is_deleted', '=', FALSE)
->addWhere('on_hold', '=', 1)
->execute();
I copied it into a script, ran it and got the message:
Invalid field 'contact_id.is_deleted'
That caused a bit of head-scratching and double-checking I hadn't got weird characters in there until trying update(FALSE)
- it worked.
An error message about lack of permission would be much more helpful than the current 'Invalid field'.
CiviCRM: 5.50.3