DannyC wrote:when opening the Work Order form I get an error
Interesting. I don't.
This still isn't the plugin which demonstrates the reported problem.
It's the exact plugin. Not even edited anywhere (aside from my System.Diagnostics.Debugger.Launch line).
You're also doing a Search inside the ReadData method for some reason
I had that remmed out for most of my development to avoid throwing any spanners in. I'm mainly just concentrating on the ButtonClicked.
I'm just loading the Work Order form in demo data
Me too.
I'll try the V2 version and see what happens. I actually really appreciate the help.
But you mustn't have saved the plugin after remming out the code for the ReadData and exporting it - go look at the plugin you posted - there is code in the ReadData which is just plain wrong and should not be there, and prevents the work order form from loading - and after fixing the problem line of code it then loads a search window for each instruction when reading a work order. It's obviously remnants of ButtonClicked code incorrectly placed in the ReadData method - but it indicates that what you posted for me to test with wasn't what you actually tested with.
DannyC wrote:Lightbulb moment...you're gonna hate me.
On a instruction line, I was going directly to the lookup, hadn't entered any text yet.
If I firstly enter in some text then do the lookup, the CustomFieldValue isn't null. Makes sense now.
Phew, sorry 'bout that.

No problem - we all make mistakes. You can just check for CustomFieldValue being null in the ButtonClicked and not do anything in that case.
This does highlight how spending a little effort in properly preparing everything we would need to see the problem can save everyone a lot of time.
When I report problems to our own software suppliers, I go to great lengths to make it as easy as possible for them to replicate for themselves the problem I am having - because if they can't repro the issue then they can't do anything.