logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
AndrzejPalczewski  
#1 Posted : Wednesday, May 5, 2021 1:02:19 PM(UTC)
AndrzejPalczewski

Rank: Newbie

Groups: Registered
Joined: 5/3/2021(UTC)
Posts: 6
United States

Thanks: 1 times
We have written an application that uses API in order to Create/Update Customers and Create Invoices.

Integration works OK if executed from Windows command prompt.

We would like to schedule the execution to run automatically every xxx minutes. When trying to use Windows Task Scheduler the following error is generated "System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."
It probably indicates that API is trying to communicate with Desktop. Please note that when executed from command line, no messages or popups are generated under the same conditions.

How could we schedule our Integration Application?
aarony  
#2 Posted : Wednesday, May 5, 2021 4:57:54 PM(UTC)
aarony

Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 2/28/2018(UTC)
Posts: 50
Location: Red Wing, MN

Was thanked: 3 time(s) in 3 post(s)
I have run through some tests here with the Windows Task Scheduler and am able to reproduce the error you are seeing.
I will put this into our tracking system so that it can hopefully be addressed in a future update.

For now, I think your options are to either;

1. Configure the Task to "Run only when user is logged on"
This will run the application in User Interactive mode and prevent the exception from being thrown.
It also means the application will display so you'll likely want to run it on a PC/VPC not being actively used.

2. Modify your application to run continuously and utilize it's own timer to perform the task.
This can then be started on a user's desktop (or made to start when the user logs in) and be left to run in the background.

Regards,

- Aaron.
AndrzejPalczewski  
#3 Posted : Wednesday, May 5, 2021 10:09:09 PM(UTC)
AndrzejPalczewski

Rank: Newbie

Groups: Registered
Joined: 5/3/2021(UTC)
Posts: 6
United States

Thanks: 1 times
Thank you very much Aaron for the prompt response.
I have tried option 1 hoping that I could logon through RDP and then disconnect the session. Did not work.
Will try option 2 or some variant of it.
By the way what has to be installed on the computer that runs the Interface? Currently we run it on CenterPoint Server.
aarony  
#4 Posted : Thursday, May 6, 2021 1:22:55 PM(UTC)
aarony

Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 2/28/2018(UTC)
Posts: 50
Location: Red Wing, MN

Was thanked: 3 time(s) in 3 post(s)
Interesting, I tried your test and connected to a VPC using RDP.

I set up my Task to run the application using the "Run only when user is logged on" option.
I set the task to run at 5 min. intervals and then disconnected (not logged out) from the RDP session.

When I reconnected 20 minutes or so later, my application had run successfully several times.

To use the API, CenterPoint will have to be installed on the same PC and configured to connect to the Database(s) you wish to use the API against.

Regards,

- Aaron.
AndrzejPalczewski  
#5 Posted : Thursday, May 6, 2021 1:43:07 PM(UTC)
AndrzejPalczewski

Rank: Newbie

Groups: Registered
Joined: 5/3/2021(UTC)
Posts: 6
United States

Thanks: 1 times
It kind of worked at the beginning (using your scenario) but then scheduler was getting stuck. After I logged out and logged back in then scheduler showed executions but I did not see database actions.
Will have to test some more, maybe there were other activities on the computer that caused it.
For now I have set up a batch file that executes integration in the loop using timeout command to pause for 5 minutes between runs.
aarony  
#6 Posted : Tuesday, July 13, 2021 7:31:27 PM(UTC)
aarony

Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 2/28/2018(UTC)
Posts: 50
Location: Red Wing, MN

Was thanked: 3 time(s) in 3 post(s)
This issue should now be fixed in CenterPoint 16 which is available for download.
thanks 1 user thanked aarony for this useful post.
AndrzejPalczewski on 7/13/2021(UTC)
AndrzejPalczewski  
#7 Posted : Tuesday, July 13, 2021 8:31:22 PM(UTC)
AndrzejPalczewski

Rank: Newbie

Groups: Registered
Joined: 5/3/2021(UTC)
Posts: 6
United States

Thanks: 1 times
Thank you!
I have installed 16.1 and initial test showed that updating Customer worked as a batch job.
We will do more testing and I will let you know about the result.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.