Portal Giving Errors because of use of record fields of a record type

Certified Senior Developer

I have a single page portal backed by an interface.
That interface has many queried record types initially in the local variables.

After publish, the portal is loading fine, that means there is not security issue and the service account is working fine.

There is an employee id field which is having a search button on the interface which is being called in the portal, the moment I click search, I  get the following error:

Help me navigate this error please

  Discussion posts and replies are publicly visible

  • Certified Lead Developer

    Seems like you try to access a non existing field when clicking that button. While this is very obvious, we can hardly tell anything more without you providing more details

  • Certified Senior Developer

    If you're still having issues with it, I may be able to lend some insight. I ran into this myself when building my portal object. To build off of what Stefan has said, it seems to be an error that happens when you try to index into a record type field for a variable that is actually null. 

    Say you query Some Record for a result, and want to use SomeRecord.field1. If your query for Some Record returns a null value, then your indexing into field1 (through the correct bracket notiation) will fail. Adding null checks can help mitigate this. I'm not sure why it happens, as I felt that records themselves made it so this didn't happen, but it does seem to be a minor issue when using portals.