+ Start a Discussion
Shanmugapriya Murugandurai 6Shanmugapriya Murugandurai 6 

ERROR: Attempt to de-reference a null object

I want to create a record for a  custom object, If I click on save for the first time, it shows the error as  "ERROR: Attempt to de-reference a null object" and if I click on "save"  one more time(not changing any field values), it doesn't shows error and record was successfully created.

Can anyone tell me why this error occurs for the first time i click on save and not for the second time i click on "save" on visualforce page???

Thanks.
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hi,

Not sure why this is happening. May you post your code too? It would help in finding a solution.