My app is getting the object id from the URL query string with the following code:
However, I have a customer who is reporting that this isn't working. The above line of code is returning null, even though I see the correct object ID in their query string. Of course, I'm unable to reproduce the error, and I'm looking for leads on what to look at to find the problem.
What reasons would my Apex code not be able to access the existing id parameter of my current page?
UPDATE: The customer is reporting that the error is only happening on the Business Account object type, with the Person Account and other objects types (Contacts, Opportunities, etc) have no problems. Could differing Account object recordtypes cause this type of issue?
UPDATE 2: Finally got the code onto an org that I could access with Person Accounts enabled. Turns out having Person Accounts enabled is the issue. Unlike I thought in my original question above, the id is getting retrieved from the URL. But later in the code, when querying salesforce for the Account's Name Field we stop when the first Name Field is found (because objects normally have only one Name Field). However, with Person Accounts enabled Accounts now have 3 Name Fields: LastName, FirstName and Name. LastName comes up first. So, when trying get the name value for a Business Account, LastName is null, and thus breaking my code.