I had added an account field onto a quote product, so I could then use the account id to inject into some fetchXML in a subgrid so I only showed quote products which had only been sold to the the account selected on the quote.
I could have looked this up using a query but I thought I would add it onto the Quote Product form and pass the value using relationships.
It worked fine but as I came to release the code I thought I didn’t really need the account lookup field on the form so I took it off.
Then when testing my code it wasn’t working, so I pressed F12 and was ready to debug, except it wasn’t running my code because it was erroring whilst trying to get the account lookup field, with this error.
SCRIPT5007: Unable to get value of the property ‘getValue’: object is null or undefined
This is logical when I stop to think about it because why would CRM load up all the variables which are not being used on the form, it would be a complete waste of time.