by Mike.Sheen » Sat Aug 02, 2014 12:26 pm
Hi Indika,
It'd be better to just call the business logic's Read method, using the RecID of the current job - that will cause the UI to respond as if the cancel button was pressed.
You *can* press the cancel button using code, but it's better if you don't - you never know what other plugins or whatever are doing - for example if there is a modal dialog currently open then the tool click on the ribbon might not have any effect (I've not tested this, I'm just imagining there will be circumstances where a UI simulated action won't always work).
Let me know if calling the business logic Read method doesn't work for you, and I'll invest some more time myself and come up with a solution.
Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials
If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution