Updating FLC item fails with 'section.field.invalidValue'

When updating a FLC item with the Sample.TransferItemBOMs job it fails with 'section.field.invalidValue'

Issue

When an item is updated, using the job 'Sample.TransferItemBOMs', it fails. An error message like this can be seen in the log file '%localappdata%\coolorange\powerFLC\Logs\powerFLC.log'
Item.Update([ {[DESCRIPTION, T5]}, {[LAST_UPDATED_BY, Administrator]}, {[VAULT_STATE, Released]}, {[NUMBER, 100005]}, {[STOCK_NUMBER, ]}, and 14 more ]) | Failed, exception = {#JDd.#5Dd}.
#JDd.#5Dd: section.field.invalidValue: section.field.invalidValue

Cause

This error can be caused when passing incorrect values to your FLC item. This article does not handled this particular case.

This error can also be caused when attempting to edit locked items, which is rather confusing. The article will handle this case.

How are properties locked on a FLC-item? 

In the workspace settings in the item details

item_details

It is possible to activate workflow locking for a whole section of the datasheet.

item_detail_edit

If workflow locking is activated and the item moves into a locked state it won't be possible for a user to make any changes to these fields. The FLC GUI might display the fields as editable, but will display an error message when attempting to save changes.

workflow_lockedState

This behavior can be overridden with the "Admin Override Workflow Locks" permission

roles_override_lock

Solution

Use an impersonation user, just for the interface that has the "Admin Override Workflow locks" permission. This could be achieved by using the -UseSystemUserEmail switch on the Connect-FLC cmdlet https://doc.coolorange.com/projects/powerflc/en/stable/code_reference/commandlets/Connect-FLC

If that switch is used the cmdlet will always use the email address that is configured in the pFLC settings dialog instead of the email of the logged in Vault user or user that triggered the job.