Iven
2010-05-22 18:49:01 UTC
Hello,
I want to realize a webpart in our EP where our supplier can confirm the
dispatch of our purchase.
In the Weppart I have two textboxes for the PurchId and the LineNum and a
button with a clicked event. When pressing the button the AXDatasourche
(Purchline) should be filtered to the current purchase.
So I added a method to the DataSet in AX called setRanges:
void setRanges(ProdId _prodId, LineNum _lineNum)
{
;
PurchIdQbr.value(_prodId);
LineNumQbr.value(strfmt('%1', _lineNum));
PurchLine_DS.executeQuery();
}
In the clicked event of the Button, I call the DataSet method:
PurchLine_DS.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("setRanges",
PurchId.Text, Convert.ToDecimal(LineNum.Text));
This works fine when I press the button shortly after the web page was
loaded. When I wait about 30 seconds before I press the butten I get a error
message, that the buisiness connector is not longer avaiable:
Microsoft.Dynamics.Framework.BusinessConnector.Session.Exceptions.NoKernelSessionException: No .NET Business Connector session could be found.
I dont have this problem when I call a static method of a class, there I can
wait several minutes and the method call doesn't crash:
Exapmle:
AxBaseWebPart.GetWebpart(this).Session.AxaptaAdapter.CallStaticClassMethod("WK_EPBoxAdvice",
"existsPurchLine", PurchId.Text, Convert.ToInt32(LineNum.Text));
Has anybody an idea how I can solve this problem?
Thanks,
Iven
I want to realize a webpart in our EP where our supplier can confirm the
dispatch of our purchase.
In the Weppart I have two textboxes for the PurchId and the LineNum and a
button with a clicked event. When pressing the button the AXDatasourche
(Purchline) should be filtered to the current purchase.
So I added a method to the DataSet in AX called setRanges:
void setRanges(ProdId _prodId, LineNum _lineNum)
{
;
PurchIdQbr.value(_prodId);
LineNumQbr.value(strfmt('%1', _lineNum));
PurchLine_DS.executeQuery();
}
In the clicked event of the Button, I call the DataSet method:
PurchLine_DS.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("setRanges",
PurchId.Text, Convert.ToDecimal(LineNum.Text));
This works fine when I press the button shortly after the web page was
loaded. When I wait about 30 seconds before I press the butten I get a error
message, that the buisiness connector is not longer avaiable:
Microsoft.Dynamics.Framework.BusinessConnector.Session.Exceptions.NoKernelSessionException: No .NET Business Connector session could be found.
I dont have this problem when I call a static method of a class, there I can
wait several minutes and the method call doesn't crash:
Exapmle:
AxBaseWebPart.GetWebpart(this).Session.AxaptaAdapter.CallStaticClassMethod("WK_EPBoxAdvice",
"existsPurchLine", PurchId.Text, Convert.ToInt32(LineNum.Text));
Has anybody an idea how I can solve this problem?
Thanks,
Iven