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
SFDC coderSFDC coder 

id value of incorrect type

Hello Experts ,

We have an mobile application that uses salesforce SDK and is connected with salesforce. In a given scenario, mobile applicaiton syncs a child and parent one after the other. This was working fine untill now. They used to sync a parent using a temporary id which they self created and using that self created id they associated the child. However this flow has stopped working now all of a sudden and it gives an error like ParentObj__c: id vlaue of incorect type. 

Can anyone please advise?

Thanks in advance
NagendraNagendra (Salesforce Developers) 
Hi SFDC Coder,

Above error is due to the invalid id because the id which you are providing now might be an invalid id i.e(ex-0035000001rqMCy) this is a 15 digit id which is invalid,salesforce uses 18 digit id internally means at code level.The 18 digit id is same as the 15 digit id but the last 3 digit is a checksum of 15 digit .So you have to use the 18 digit id i.e (ex-0035000001rqMCyAAM) instead of (ex-0035000001rqMCy) .If you want to have some help to know how to calculate the 18 digit id from 15 digit then check here below

http://forceguru.blogspot.sg/2010/12/how-salesforce-18-digit-id-is.html

Please mark this post as solved if it helps.

Best Regards,
Nagendra.P
SFDC coderSFDC coder
Hi Nagendra,

The problem is that they try to insert parent and child one after the other. So basically hey use the id field by populating some random characters like temp-djfbkdsooispdk whose length is greater than 18 . Using this id field containing some random values, they are able to hold its related child records. They do so because parent is is not yet inserted and hence there is no valid id to provide to the child records.

This happens to be working till last week but not now.
Any advice?
Regards,
Neha Patil
Ajay ChaudharyAjay Chaudhary
Hello,
I have same problem with parent and child. We upload parent and then child. We used id "@2312235046736629".