How can I programatically click the Cancel button  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

How can I programatically click the Cancel button

Postby indikad » Fri Aug 01, 2014 5:05 pm

say the Service Manager - Jobs window.
for example - when a user starts a new job - given a condition - I want to alert user that this job cannot be saved and programatically hit he Cancel button.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: How can I programatically click the Cancel button  Topic is solved

Postby 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
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: How can I programatically click the Cancel button

Postby indikad » Mon Aug 04, 2014 11:55 am

calling the read method worked ( on Job.CreateStart ) this is what I need to.
Thanks Mike.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron