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
CEC DevCEC Dev 

RecordTypeId: id value of incorrect type: 0123000000004MgAAI

This is a second problem that I'm having while attempting to create a new Opportunity.

I am populating the RecordTypeId property with the following line:

opp.RecordTypeId = SalesForceDataProvider.GetRecordType(order.Channel).Id;

...where the order.Channel will either be "Wholesale" or "Retail Sale". The code for GetRecordType is:

public static RecordType GetRecordType(string channel)
{
QueryResult qr =
null;
try
{
qr = salesForce.query(
string.Format("select Id from RecordType where (Name = '{0}')", channel));
}
...

The code is retrieving a valid id from the RecordType object. What's odd is that when order.Channel = "Retail Sale", I do not get this error. It only occurs when order.Channel = "WholeSale". Clearly, I'm pulling the right record because the value in the error message indicates a valid value was returned (0123000000004MgAAI). So, what could be the problem here???

Thanks,

-- Tom

DevAngelDevAngel

Hmmm...

 

Investigating.  I'm getting the same error.  May have a bug.  Will let you know when I know.

CEC DevCEC Dev

Thanks for looking into it. I'm looking forward to a response.

-- Tom

Michael SMichael S

Any luck on this one?

I have encountered the problem as well.

Michael

CEC DevCEC Dev

Just wanted to pass this on to you. I couldn't wait for a fix to this problem so I did a little experimentation. I created another record type named Wholesale New (temporarily) and made sure I could query that and use it for opportunity inserts. Then I went through all of the existing opportunities marked with Wholesale as the record type and changed them to point to the Wholesale New. Once that was done, I deleted the Wholesale record type and renamed Wholesale New to Wholesale. Then I started getting the error message again. So it appears that the problem lies in the record type specifically being named Wholesale, which causes a different record to be pulled even though it's not valid. So I just renamed my record type so that it was a little different from Wholesale. I suspect you could do the same thing and be all set.

Good luck,

Tom

benjasikbenjasik
Can you go into the profile detail for the user that is doing this insert, and see if they have the record type available to their profile?