function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steve_FinlaySteve_Finlay 

Validation error upon trying to make an approval

I have migrated a custom object from my development org across to the production org via the Force.com IDE and have then manually added the Approval Process.

 

However, now when I try to approve a test record I get the following error...

 

"There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Related To: id value of incorrect type: a082000000PGudk". 

 

There is not much of a hint as to what 'field' has the incorrect type.

 

As a said the record has been entered and the approver has select 'Approve' to the submitted record.

 

What has gone wrong?  The approval process was working fine in my development org.

 

Any help would be appreciated.

 

Steve

SteveBowerSteveBower

Well, remember that the validation that's complaining may be on some other record... perhaps there's a trigger, workflow rule, field update, etc. which you didn't have in your development environment, etc.

 

I think the message ["Related To" value of incorrect type] is telling you that some lookup field was populated with an Id (a082000000PGudk) which doesn't match the type of record that the lookup is defined for.   (Imagine populating a Contact

's Account lookup field with a Task Id).

 

"a08" is the prefix for the Id that was attempted to be used.   You may be able to enter in "/a082000000PGudk" in your URL (like: https://na4.salesforce.com/a082000000PGudk) and see the record that something tried to use.  However that record might be gone.   If you enter https://na4.salesforce.com/a08/o is should bring you to the overview for that object, so at least you can tell what type of record it complained about.

 

Best, Steve.