I am using update record component to update the IsPassword field on the UserLogin object.

For that I am adding a condition to update the take the records based on Logged in user Id.

i.e. UserId=LoggedInUserId -- this is formula variable in my flow

now when I see in debug logs, I am getting trying to update null exception.

Can anyone help. Flow Screen

Debug Logs:--

05:28:35.0 (99262397)|LIMIT_USAGE|[EXTERNAL]|SOQL_ROWS|1|50000
05:28:35.0 (99294736)|LIMIT_USAGE|[EXTERNAL]|SOQL|1|100
05:28:35.0 (99305677)|LIMIT_USAGE|[EXTERNAL]|AGGS|1|300
05:28:35.0 (99487679)|FLOW_BULK_ELEMENT_DETAIL|FlowRecordUpdate|Lock_User|1
05:28:35.0 (99501062)|LIMIT_USAGE|[EXTERNAL]|DML|1|150
05:28:35.0 (99512522)|LIMIT_USAGE|[EXTERNAL]|DML_ROWS|1|10000
05:28:35.0 (101297822)|FLOW_VALUE_ASSIGNMENT|3202f300e2d00bd82863c896dd316bc21916ee-629f|Lock_User|false
05:28:35.0 (101397185)|FLOW_ELEMENT_ERROR|The flow tried to update these records: null. This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: entity type cannot be updated: User Login. You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>.|FlowRecordUpdate|Lock_User
05:28:35.0 (101551262)|FLOW_ELEMENT_LIMIT_USAGE|1 SOQL queries, total 1 out of 100
05:28:35.0 (101565710)|FLOW_ELEMENT_LIMIT_USAGE|1 SOQL query rows, total 1 out of 50000
05:28:35.0 (101598770)|FLOW_ELEMENT_LIMIT_USAGE|1 DML statements, total 1 out of 150
05:28:35.0 (101611937)|FLOW_ELEMENT_LIMIT_USAGE|1 DML rows, total 1 out of 10000
05:28:35.0 (101625267)|FLOW_ELEMENT_END|3202f300e2d00bd82863c896dd316bc21916ee-629f|FlowRecordUpdate|Lock_User
  • Are you trying to set the value to True? According to the documentation, you can't do that. developer.salesforce.com/docs/atlas.en-us.api.meta/api/… Commented Jul 5, 2019 at 20:35
  • Yes I was trying to set it true. Btw, I think I understood the problem, the profile need Manage Users permissions to acccss UserLogin object. now since flow runs user flow and my profile is Customer Community Plus Login,it is not able to access the records. So I think the solution here is to trigger or process builder by updating the checkbox on Contact object,,and instead of isPasswordLocked, I will try to set IsFrozen.
    – mvk1991
    Commented Jul 6, 2019 at 8:52

1 Answer 1


You can't set the IsPasswordLocked field to true. See https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_userlogin.htm. As you've said in the comments, if you want to lock someone out, you can set IsFrozen to be true

  • yes.. btw will it work.. if I call the function in without sharing class to do this.
    – mvk1991
    Commented Jul 7, 2019 at 16:46
  • In my org, we are using a flow to set the IsFrozen field to true, but it is running under a system admin user. If you want it to run under any user, you'd have to test it. I give it a 50/50 chance of working. Commented Jul 8, 2019 at 13:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .