on 09-14-2014 11:21 AM
Hi
I have wrote a report for a customer for B1 V9 which takes some time to run as it runs lots of queries
With the customers data, running it locally it takes about 1 minute on my notebook
On the customers network they keep getting a message about the application has stopped working at various points in the program and doesn't finish
I update the message bar but wonder if it could be the form I am displaying which I am not updating which could be causing problems
We are both running B1 V9 PL8
Just wondered if anyone has had a similar problem and can suggest anything please ?
Thanks
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andy,
The problem as described in thread is: when our addon is doing a long process, the Sbo will time out and regards our addon not responding.
The solution given was to remove windows message queue.
In view of this, your form does not matter.
Just before you do your long process, start this timer to clear the windows message queue every interval. And as soon as your process stopped, destroy this timer.
It is working on application level. So no form is involved.
Regards
Edy
Hi
Having a bit of a problem converting the c# code in the link to vb.net
Can anyone help please?
Thanks
Andy
Timer tm = new Timer(new TimerCallback(KeepUIAlive));
tm.Change(1000 * 60, 0);
System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(OpenMyForm)); // this calls the NET form but it could be just a heavy load method.
t.TrySetApartmentState(System.Threading.ApartmentState.STA);
t.Start();
t.Join();
tm.Dispose();
public void OpenMyForm()
{
System.Windows.Forms.Form nf = new System.Windows.Forms.Form();
Process p = Process.GetProcessesByName("SAP Business One")[0];
nf.ShowDialog(new MyWindow());
}
public void KeepUIAlive(object info)
{
Timer t = (Timer)info;
B1Connections.theAppl.RemoveWindowsMessage(SAPbouiCOM.BoWindowsMessageType.bo_WM_TIMER, true);
t.Change(1000 * 60, 0);
}
Hi Andy,
The VB version :
The calling
Dim oTimer As New System.Threading.Timer(New System.Threading.TimerCallback(AddressOf oTimerCallBack))
Try
oTimer.Change(0, 1000 * 60) 'Trigger every 60 seconds
'Do your heavy processing here.
Catch
Finally
oTimer.Dispose
End Try
Callback procedure
Private Sub oTimerCallBack(ByVal State As Object)
Try
SBO_Application.RemoveWindowsMessage(SAPbouiCOM.BoWindowsMessageType.bo_WM_TIMER, True)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Regards
Edy
User | Count |
---|---|
91 | |
7 | |
7 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.