I want to thank, each reader, and followers of automationchampion.com, for their support and feedback(s). Some of you requested me to write a blog post to explain (1) MALFORMED_ID Error; and, (2) how to solve it.
I have and will continue to, try my best to incorporate suggested topics, from readers and followers of my blog, in my upcoming articles.
Process Builder is a way of automating business processes. It is an upgraded version of the Workflow Rule. Whenever a user creates a process, the system automatically creates a Visual Workflow – and a Flow Trigger (which is now deprecated) – to call the Flow. Creation of the Flow happens behind the scenes; and therefore, a user does not need to interact with these ‘shadow’ (behind the scenes) Flows. Process Builder is a powerful tool for system administrators and developers to implement business processes without writing code. However, with great power comes great responsibility – If a user starts creating a new process for each requirement – or creating processes without understanding Salesforce limitations – then, a user may encounter many issues, either in future or, during testing/deployment phase.
In my last post Getting Started with Process Builder – Part 66 (How to fix FIELD_INTEGRITY_EXCEPTION Error), I discussed how to solve FIELD_INTEGRITY_EXCEPTION error by passing the correct record ID to Process Builder action.
This article goes one step further; it explains another common error – MALFORMED_ID Error. The article shows – (1) why errors could occur; (2) how to identify errors (by using a system generated fault email/debug log); and, finally, (3) how to solve the problem.
Business Use case
Donna Serdula is working as a System administrator at Universal Containers (UC). UC implemented Account Management a few years ago in Salesforce. Serdula has a requirement from her manager that, as soon as a Contact gets created, without assigning it to an account, then auto assign such Contacts to a global account ‘Customers with no account’‘.
‘Global account’ named ‘Customers with no account’? What is that?
Well, in this case, a ‘global account’ is nothing but a ‘holding place’ for unassigned contacts – i.e., contacts, that, when created, could not, or did not, get assigned to an account.
For instance, suppose a User creates a contact named John Smith; but, at this point, the User is not sure to which account John Smith belongs to.
Leaving Account field blank, while creating a contact, may create data integrity issue(s). Therefore, it would behoove a User to collect all unassigned contacts in one central place – in our case, that would be a global account named ‘Customers with no account’ account.
Let us continue with our aforementioned John Smith use case. Now, suppose, that few months later, the User learns that John Smith works for Acme Corporation, and therefore, he belongs to Acme Corporation Account.
So, in a situation(s) like this, to maintain data integrity, when creating a John Smith contact, the User can assign John Smith to ‘Customers with no accounts’ ‘holding’ account. And then, as soon as the User finds out that John Smith belongs to Acme Corporation, the User can click on the Contact Tab, look for John Smith, and then, update John Smith’s Account from ‘Customers with no account’ to Acme Corporation.
What is MALFORMED_ID Error?
A user mostly encounters a MALFORMED_ID error when he/she populates(1) a lookup field, ID with invalid characters; or (2) populates an ID with length less than 15 characters.
For example, while updating a contact via Process Builder if, in the place of AccountId, a user passes a 14 digit ID of an account record or ABC in place of account ID, then, the user will encounter MALFORMED_ID error.
Below, I will show you how to avoid getting a MALFORMED_ID Error while using the Process Builder.
First, I will update a contact by passing a wrong ID (14 digits account ID) for contacts that are not assigned to an account when it is created.
This will generate a MALFORMED_ID error because you are only allowed to pass 15 digits valid account ID.
Next, I will show you how to identify the root cause behind MALFORMED_ID error followed by a way to solve it.