Create custom object when incident category changes
Could someone please tell me what I am doing wrong with the following code? I have created an add-in that should capture the change of category of an incident when it is saved, and then populate values on a custom object. The custom object is called 'CustomAudit' and contains an OldCategory and NewCategory field - which I want to set as the original incident category and then what the user changes the category to. When I test the add-in and change the category I get the error ' Object reference not set to an instance of an object.