07-26-2018 09:43 AM - edited 07-26-2018 10:03 AM
I'm getting the following error at the very end of the AfterRelease event, in what appears to be a final refresh.
--------------------------- RuleStream.Designer --------------------------- ReleaseActionButton Could not release the model. Exception: Object variable or With block variable not set. --------------------------- OK ---------------------------
I have two quoting applications that I'm running from a third application that replaces the default Project/Line Item UI. After release (from with a quote line item), I save the model and load the PLI UI.
When I release from one application, everything works correctly, no error. But when I release from the other application, I get this error at the end of the AfterRelease event. Both apps use the same AfterRelease event code:
Public Sub g_RsEngineer_AfterRelease(ByVal sender As Object, ByVal e As EventArgs) 'Handles g_RsEngineer.RsAfterRelease RS_Message("Custom.vb g_RsEngineer_AfterRelease()", "Caught After Release Event", RS_ERR_INFO, OnlyLogReleaseEvents()) If RootPart.IsCPQ Then ' Change to Quote Management Mode RootPart.Properties("AppMode").InputValue = "MANAGE" End If g_RsEngineer.SaveModel() ' original line item Dim oriProjectID As String = RootPart.ProjectID Dim oriLineItemID As String = RootPart.LineItem ' Check in original line item CheckInLineItem(oriProjectID, oriLineItemID) ' open PLI interface Dim pliProjectID As String = RootPart.ToConstants(1).PliProjectID Dim pliLineItemID As String = RootPart.ToConstants(1).PliLineItemID Dim pliProcessName As String = "DefaultProcess" g_RsEngineer.RsDesigner.LoadModel(pliProjectID, pliLineItemID, pliProcessName) 'g_RsEngineer.RefreshModelViews(0) End Sub
I was getting the error in the last RefreshModelViews(0) before I commented that out, not it happens later in what appears to be a final refresh.
Using RS 8.15.1 on WIN7
07-27-2018 10:22 AM
While it worked in some cases, the LoadModel() call isn't really allowed there like that.
I'm trying to automate a final save and close after the release is complete. The profile will load the correct project/line item, so a simple close at the end of AfterRelease() would suffice, but when I tried CloseModel() instead of LoadModel() it threw a similar error.
For now I'm having the user click a save and close button once release is complete until I can figure out how to automate the close.
09-05-2018 08:31 AM
Hi Chris,
I would say this one should be fairly easy to nail down because of the error message - there is a line of code that is trying to use an object variable that is not referencing a valid object. My bet would be on g_rsEngineer variable.
Dharmesh Sanghavi