NAV2013 R2 Update 13-RTC Connection has been lost

ScottJonesScottJones Member Posts: 44
edited 2015-02-23 in NAV Three Tier
We are upgrading our client from NAV2009 Classic to NAV2013 R2 RTC. They are currently running CRP/Testing and we are experiencing the Role Tailored Clients loosing connection to the single middle tier. The client gives the error:

The server "net.[url=tcp://fs-vm-nav2013-test/DynamicsNAV/Service]tcp://fs-vm-nav2013-test/DynamicsNAV/Service[/url]" is either unavailable or your connection has been lost. Do you want to attempt reconnect?"

The event log on the middle tier server indicates:
Server instance: FSSSNav71
User: <DomainName>\<UserName>
Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavSessionTerminatedException
Message: The server stopped the session (ID: 150381) because of a stop session request.
StackTrace:
     at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args)
     at Microsoft.Dynamics.Nav.Service.NSField.DrillDownField(NavSession con)
     at Microsoft.Dynamics.Nav.Service.NSField.DrillDown(NavSession session)
     at SyncInvokeDrillDownField(Object , Object[] , Object[] )
     at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
     at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2146233088
----------------------------------
Type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
StackTrace:
     at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
     at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
     at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args)
Source: mscorlib
HResult: -2146232828
----------------------------------
Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavSessionTerminatedException
Message: The server stopped the session (ID: 150381) because of a stop session request.
StackTrace:
     at Microsoft.Dynamics.Nav.Runtime.SessionAccessLock.[color=#00FF40]ThrowSessionTerminatedException[/color]()
     at Microsoft.Dynamics.Nav.Service.ServiceCall.GetClientReturnValue(Action invokeCallback)
     at Microsoft.Dynamics.Nav.Service.NSClientCallback.[color=#40FF40]FormRunModal[/color](NavForm form, NavFormRuntimeParameters parameters)
     at Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal(NavRecord record, Int32 fieldNo)
     at Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal(Boolean isInLookupTrigger, Boolean isLookup, Int32 formId, NavRecord record, Int32 fieldNo)
     at Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal(Boolean isInLookupTrigger, Boolean isLookup, Int32 formId, NavRecord record)
     at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit50006.FncWFCockpit_Scope.OnRun()
     at Filter.InvokeWithFilter(NavMethodScope )
     at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit50006.FncWFCockpit(Int32 poptMode, Int32 poptType, NavText ptxtTeamFilter)
     at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit50006.OnInvoke(Int32 memberId, Object[] args)
     at Microsoft.Dynamics.Nav.BusinessApplication.Page50119.TxtQueriedAssignedToTeam_a45_OnDrillDown_Scope.OnRun()
     at Filter.InvokeWithFilter(NavMethodScope )
     at Microsoft.Dynamics.Nav.BusinessApplication.Page50119.TxtQueriedAssignedToTeam_a45_OnDrillDown()				- User clicked Action button to assign an instruction to their team
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2146233088

The error occurs on various Pages. In this instance Page50119 and always seems to be after running a FormRunModal() followed by ThrowSessionTerminatedException(). The pages are not using any external components, we were using PingPong to refresh the page but we have recently stripped this out.

We have tried changing the client heartbeat from 120 seconds to 60 seconds for the client to server and doubling the session timeout from 10mins to 20mins on the middle tier but neither have helped.

Has anyone else experienced timeouts after running FormRunModal() this occurs on a number of different pages after a modal form has been dispayed.

Thank you

Regards

Scott

Comments

  • vremeni4vremeni4 Member Posts: 323
    Hi,

    This behaviour usually indicts that something went wrong during the upgrade. Objects not fully or correctly upgraded.
    What I found strange is that you are talking about FormRunModal() which should not exist in NAV 2013 R2.
    NAV 2013 R2 only supports pages and all calls and links should use Page.Runmodal command.

    My action would be:
    1. Compile all objects and make sure there are no use of Forms or old reports.
    2. Try to use standard pages to see if the error still appears.

    I hope this helps.
    Thanks.
  • dipakpatel2505dipakpatel2505 Member Posts: 169
    Hi ScottJones,

    The behaviour, which you have mentioned in your post, is usually seen when you are using wrong build version of Navision (Wrong means lower build version).

    Let me explain in more detail as below

    Suppose you have upgraded Objects in Navision 2013 R2 Rollup 10. Now you are using Navision 2013 R2 Rollup 7 or Rollup 9 to open Role Tailored Client of Nav 2013 R2 Rollup 10. In this case, I face the same problem which you have reported. Here, When you open Nav 2013 R2 Database in development environment, you will be able to open it in both Build version and Systems will not give you any error but in case of RTC, it will give you error.

    So, Please make sure that you are using correct build version to open your Nav 2013 R2 Upgraded Database. After open Database with correct build version in development environment, Compile all objects then try to start RTC Client.

    Please do not forget to mark Post as solved it hints have solved your problem.
  • ScottJonesScottJones Member Posts: 44
    Just to confirm. We are using pages. The event log I have included contains the call stack which details C# calls NavForm.RunModal which I assume is the call to the Pages. I cannot understand why there are three calls. This page is a Factbox with counts to different document types, which link to individual pages to show those document types:

    at Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal(NavRecord record, Int32 fieldNo)
    at Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal(Boolean isInLookupTrigger, Boolean isLookup, Int32 formId, NavRecord record, Int32 fieldNo)
    at Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal(Boolean isInLookupTrigger, Boolean isLookup, Int32 formId, NavRecord record)

    The objects and system we have developed is based on Cumulative Update 8. It would take many days to grapht all the changes onto CU13 so currently we have just upgraded the RTC and middle tier. We started on CU8 with the issue and then upgraded RTC & Middle tier to CU13 to try to fix. We have done a global compile of all objects and restarted the middle tier server and still get the same issue.

    We have double checked build numbers on all 5 terminal servers (Which have been running NAV2009 classic only for over a year no problems), the middle tier server, the two middle tier services on this instance. The error occurs both from the Terminal Servers and on the RTC installed on the Middle Tier Server (No network in way). We've tried using the LIVE middle tier server and service rather than the test, just in case it is a problem with the virtualised middle tier server. We've added an extra virtual processor and extra 4GB RAM. It even does it with two users only.

    Tonight we are going to try to delete all the blobs in the 'Object Metadata' table so they are recreated when the RTC starts. Has any tried this will all object metadata be recreated.

    We also have two separate middle tier instances, one with debugging enabled one without. Clients connect to the middle tier without. The error also occurs without anyone on the second instance, and the second instance was added to try to pinpoint the problem.

    Any further pointers would be appreciated
  • MarijnMarijn Member Posts: 69
    You do not answer the second but crucial question vremeni4 asked you: Do the standard, out of the box, untouched pages also loose their connection? Because if not, your customized pages do contain a problem. This should be the very first thing to check.
  • ScottJonesScottJones Member Posts: 44
    This week are getting the users to keep a detailed log of dates, times and pages. It is difficult to say, but thus far I have not seen one myself...

    The problem being the users are testing the tailored document 'workflow' modules which they spend 95% of their time in.

    I will get one of our team here to test the financials side but we are uncertain when the error occurs it affects other users.

    Thank you
  • vremeni4vremeni4 Member Posts: 323
    Hi,

    I have looked at the error message again
    The fun starts with the Page 50119 then it goes to the codeunit 50006
    The codeunit 50006 calls Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal ?!?!?!

    Is it possible to double check that in the codeunit 50006 there are no calls which use "Form" word.
    Sometimes compiler ignores lines or code that call Forms.
    You also need to check in the variables.
    at Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal(Boolean isInLookupTrigger, Boolean isLookup, Int32 formId, NavRecord record)
         at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit50006.FncWFCockpit_Scope.OnRun()
         at Filter.InvokeWithFilter(NavMethodScope )
         at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit50006.FncWFCockpit(Int32 poptMode, Int32 poptType, NavText ptxtTeamFilter)
         at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit50006.OnInvoke(Int32 memberId, Object[] args)
         at Microsoft.Dynamics.Nav.BusinessApplication.Page50119.TxtQueriedAssignedToTeam_a45_OnDrillDown_Scope.OnRun()
         at Filter.InvokeWithFilter(NavMethodScope )
    

    I Hope this helps.
    Thanks.
  • ScottJonesScottJones Member Posts: 44
    Hmmm,

    I exported CU50006 as text and looked for form variables but I cannot see any. Only page variables.

    Below is a copy of the C# the middle tier code created from the C/Side code for Codeunit50006

    Within this you can see the NavForm.RunModal. I assume the developers of the middle tier were used to forms rather than pages and thus their methods have the word Form in them?
                    StmtHit(67);
                    base.Parent.FncResetInstructionLine(ptblInstructionLine, 2);
                    if(CStmtHit(68)&(poptMode==2))
                    {
                      StmtHit(69);
                      base.Parent.FncCommit();
                      StmtHit(70);
                      tblQueryType.Target.ALReset();
                      StmtHit(71);
                      tblQueryType.Target.ALSetRangeSafe(15, NavType.Option, ( (NavOption)(tblQueryType.Target.GetFieldValueSafe(15, NavType.Option)) ).CreateInstance(0));
                      if(CStmtHit(72)&(NavForm.RunModal(false, true, 0, tblQueryType.Target)==FormResult.LookupOK))
                      {
                        StmtHit(73);
                        ptblInstructionLine.Target.SetFieldValueSafe(42, NavType.Code, new NavText(ptblInstructionLine.Target.GetFieldValueSafe(42, NavType.Code).NavDefinedLengthMetadata, ( (NavCode)(tblQueryType.Target.GetFieldValueSafe(1, NavType.Code)) )));
                        StmtHit(74);
                        ptblInstructionLine.Target.SetFieldValueSafe(66, NavType.Boolean, NavBoolean.Create(true));
                      }
                      else
                      {
                        StmtHit(75);
                        NavDialog.ALError(new Guid(50006, 15259, 51726, 8, 5, 183, 5, 131, 107, 210, 210), text026, ( (NavCode)(ptblInstructionLine.Target.GetFieldValueSafe(5, NavType.Code)) ));
                      }
                    }
                    StmtHit(76);
    
  • vremeni4vremeni4 Member Posts: 323
    Hi,

    There is something very wrong going on in the CU 50006
    Is it possible to copy here functions
    FncWFCockpit
    FncWFCockpit_Scope

    as without looking at the code it will be very difficult to identify what is wrong.

    Thanks.
  • ScottJonesScottJones Member Posts: 44
    Hope this helps... It is too big to post all the code...
        public Int32 FncWFCockpit(Int32 poptMode,Int32 poptType,NavText ptxtTeamFilter)
        {
          FncWFCockpit_Scope \u03b2scope = new FncWFCockpit_Scope(this, poptMode, poptType, ptxtTeamFilter);
          \u03b2scope.Run();
          return (\u03b2scope.\u03b3retVal);
        }
    
    private class FncWFCockpit_Scope : NavMethodScope<Codeunit50006>
        {
          public static UInt32 \u03b1scopeId;
          [NavName(@"poptMode")]
          public NavOption poptMode;
          [NavName(@"poptType")]
          public NavOption poptType;
          [NavName(@"ptxtTeamFilter")]
          public NavText ptxtTeamFilter;
          [NavName(@"tblInstructionLine")]
          public NavRecordHandle tblInstructionLine;
          [NavName(@"tblInstructionRoutingLine")]
          public NavRecordHandle tblInstructionRoutingLine;
          [NavName(@"tblRequest")]
          public NavRecordHandle tblRequest;
          [NavName(@"pgInstructionLineView")]
          public NavFormHandle pgInstructionLineView;
          [ReturnValue]
          public Int32 \u03b3retVal = 0;
          
          protected override UInt32 RawScopeId 
          {
            get
            {
              return (FncWFCockpit_Scope.\u03b1scopeId);
            }
            set
            {
              FncWFCockpit_Scope.\u03b1scopeId = value;
            }
          }
          
          internal FncWFCockpit_Scope(Codeunit50006 \u03b2parent,Int32 poptMode,Int32 poptType,NavText ptxtTeamFilter) : base(\u03b2parent)
          {
            this.poptMode = NavOption.Create(fncWFCockpitpoptMode_metadata, poptMode);
            this.poptType = NavOption.Create(fncWFCockpitpoptType_metadata, poptType);
            ptxtTeamFilter = ptxtTeamFilter.ModifyLength(260);
            this.ptxtTeamFilter = ptxtTeamFilter;
            tblInstructionLine = new NavRecordHandle(this, 50001, false, SecurityFiltering.Validated);
            tblInstructionRoutingLine = new NavRecordHandle(this, 50009, false, SecurityFiltering.Validated);
            tblRequest = new NavRecordHandle(this, 50032, false, SecurityFiltering.Validated);
            pgInstructionLineView = new NavFormHandle(this, 50016);
          }
          
          
          
          protected override void OnRun()
          {
            StmtHit(0);
            tblInstructionLine.Target.ALReset();
            StmtHit(1);
            tblInstructionRoutingLine.Target.ALReset();
            StmtHit(2);
            tblRequest.Target.ALReset();
            StmtHit(3);
            switch(( (Int32)(poptType) ))
            {
              case 1: 
              {
                
                {
                  StmtHit(4);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 41, 60);
                  StmtHit(5);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(6);
                  tblInstructionLine.Target.ALSetFilter(41, @"%1", ALCompiler.ToNavValue(@""));
                  StmtHit(7);
                  tblInstructionLine.Target.ALSetRangeSafe(60, NavType.Boolean, ALCompiler.ToNavValue(true));
                }
              }
              break;
              case 2: 
              {
                
                {
                  StmtHit(8);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 41, 60);
                  StmtHit(9);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(10);
                  tblInstructionLine.Target.ALSetFilter(41, @">%1", ALCompiler.ToNavValue(@""));
                  StmtHit(11);
                  tblInstructionLine.Target.ALSetRangeSafe(60, NavType.Boolean, ALCompiler.ToNavValue(true));
                }
              }
              break;
              case 3: 
              {
                
                {
                  StmtHit(12);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 41, 60);
                  StmtHit(13);
                  tblInstructionLine.Target.ALSetRangeSafe(41, NavType.Code, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
                  StmtHit(14);
                  tblInstructionLine.Target.ALSetRangeSafe(60, NavType.Boolean, ALCompiler.ToNavValue(true));
                  StmtHit(15);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                }
              }
              break;
              case 4: 
              {
                
                {
                  StmtHit(16);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 66, 41);
                  StmtHit(17);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(18);
                  tblInstructionLine.Target.ALSetRangeSafe(66, NavType.Boolean, ALCompiler.ToNavValue(true));
                  StmtHit(19);
                  tblInstructionLine.Target.ALSetFilter(41, @"%1", ALCompiler.ToNavValue(@""));
                }
              }
              break;
              case 5: 
              {
                
                {
                  StmtHit(20);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 66, 41);
                  StmtHit(21);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(22);
                  tblInstructionLine.Target.ALSetRangeSafe(66, NavType.Boolean, ALCompiler.ToNavValue(true));
                  StmtHit(23);
                  tblInstructionLine.Target.ALSetRangeSafe(41, NavType.Code, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
                }
              }
              break;
              case 6: 
              {
                
                {
                  StmtHit(24);
                  tblRequest.Target.ALSetCurrentKey(DataError.ThrowError, 18, 30);
                  StmtHit(25);
                  tblRequest.Target.ALSetFilter(18, ptxtTeamFilter);
                  StmtHit(26);
                  tblRequest.Target.ALSetRangeSafe(30, NavType.Option, ( (NavOption)(tblRequest.Target.GetFieldValueSafe(30, NavType.Option)) ).CreateInstance(2));
                }
              }
              break;
              case 7: 
              {
                
                {
                  StmtHit(27);
                  tblRequest.Target.ALSetCurrentKey(DataError.ThrowError, 18, 30);
                  StmtHit(28);
                  tblRequest.Target.ALSetFilter(18, ptxtTeamFilter);
                  StmtHit(29);
                  tblRequest.Target.ALSetRangeSafe(30, NavType.Option, ( (NavOption)(tblRequest.Target.GetFieldValueSafe(30, NavType.Option)) ).CreateInstance(2));
                  StmtHit(30);
                  tblRequest.Target.ALSetRangeSafe(19, NavType.Code, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
                }
              }
              break;
              case 8: 
              {
                
                {
                  StmtHit(31);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 65);
                  StmtHit(32);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(33);
                  tblInstructionLine.Target.ALSetRangeSafe(65, NavType.Boolean, ALCompiler.ToNavValue(true));
                }
              }
              break;
              case 9: 
              {
                
                {
                  StmtHit(34);
                  tblInstructionRoutingLine.Target.ALSetCurrentKey(DataError.ThrowError, 20, 34, 31, 35);
                  StmtHit(35);
                  tblInstructionRoutingLine.Target.ALSetFilter(20, @"%1", ptxtTeamFilter);
                  StmtHit(36);
                  tblInstructionRoutingLine.Target.ALSetRangeSafe(34, NavType.Boolean, ALCompiler.ToNavValue(false));
                  StmtHit(37);
                  tblInstructionRoutingLine.Target.ALSetRangeSafe(31, NavType.Boolean, ALCompiler.ToNavValue(false));
                  StmtHit(38);
                  tblInstructionRoutingLine.Target.ALSetRangeSafe(35, NavType.Boolean, ALCompiler.ToNavValue(false));
                }
              }
              break;
              case 10: 
              {
                
                {
                  StmtHit(39);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 44);
                  StmtHit(40);
                  tblInstructionLine.Target.ALSetRangeSafe(44, NavType.Code, ptxtTeamFilter);
                }
              }
              break;
              case 11: 
              {
                
                {
                  StmtHit(41);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 43);
                  StmtHit(42);
                  tblInstructionLine.Target.ALSetRangeSafe(43, NavType.Code, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
                }
              }
              break;
              case 12: 
              {
                
                {
                  StmtHit(43);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 47);
                  StmtHit(44);
                  tblInstructionLine.Target.ALSetRangeSafe(40, NavType.Code, ptxtTeamFilter);
                  StmtHit(45);
                  tblInstructionLine.Target.ALSetRangeSafe(47, NavType.Code, ptxtTeamFilter);
                }
              }
              break;
              case 13: 
              {
                
                {
                  StmtHit(46);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 41, 46);
                  StmtHit(47);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(48);
                  tblInstructionLine.Target.ALSetRangeSafe(41, NavType.Code, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
                  StmtHit(49);
                  tblInstructionLine.Target.ALSetRangeSafe(46, NavType.Code, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
                }
              }
              break;
              case 14: 
              {
                
                {
                  StmtHit(50);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 66);
                  StmtHit(51);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(52);
                  tblInstructionLine.Target.ALSetRangeSafe(66, NavType.Boolean, ALCompiler.ToNavValue(true));
                }
              }
              break;
              case 15: 
              {
                
                {
                  StmtHit(53);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 66, 41);
                  StmtHit(54);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(55);
                  tblInstructionLine.Target.ALSetRangeSafe(66, NavType.Boolean, ALCompiler.ToNavValue(true));
                  StmtHit(56);
                  tblInstructionLine.Target.ALSetRangeSafe(41, NavType.Code, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
                }
              }
              break;
              case 16: 
              {
                
                {
                  StmtHit(57);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 66);
                  StmtHit(58);
                  tblInstructionLine.Target.ALSetRangeSafe(66, NavType.Boolean, ALCompiler.ToNavValue(true));
                }
              }
              break;
              case 17: 
              {
                
                {
                  StmtHit(59);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 60);
                  StmtHit(60);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(61);
                  tblInstructionLine.Target.ALSetRangeSafe(60, NavType.Boolean, ALCompiler.ToNavValue(true));
                }
              }
              break;
              case 18: 
              {
                
                {
                  StmtHit(62);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 41, 60);
                  StmtHit(63);
                  tblInstructionLine.Target.ALSetRangeSafe(41, NavType.Code, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
                  StmtHit(64);
                  tblInstructionLine.Target.ALSetRangeSafe(60, NavType.Boolean, ALCompiler.ToNavValue(true));
                  StmtHit(65);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                }
              }
              break;
              case 19: 
              {
                
                {
                  StmtHit(66);
                  tblInstructionLine.Target.ALSetCurrentKey(DataError.ThrowError, 40, 66, 41);
                  StmtHit(67);
                  tblInstructionLine.Target.ALSetFilter(40, ptxtTeamFilter);
                  StmtHit(68);
                  tblInstructionLine.Target.ALSetRangeSafe(66, NavType.Boolean, ALCompiler.ToNavValue(true));
                  StmtHit(69);
                  tblInstructionLine.Target.ALSetFilter(41, @">%1", ALCompiler.ToNavValue(@""));
                }
              }
              break;
              
            }
            if(CStmtHit(70)&(poptType!=9))
            {
              StmtHit(71);
              tblInstructionLine.Target.ALSetRangeSafe(64, NavType.Boolean, ALCompiler.ToNavValue(false));
              StmtHit(72);
              tblInstructionLine.Target.ALSetFilter(10, @">%1", ALCompiler.ToNavValue(0));
            }
            StmtHit(73);
            switch(( (Int32)(poptMode) ))
            {
              case 1: 
              {
                StmtHit(74);
                switch(( (Int32)(poptType) ))
                {
                  case 6: 
                  case 7: 
                  {
                    StmtHit(75);
                    \u03b3retVal = (tblRequest.Target.ALCount);
                    return ;
                  }
                  break;
                  case 9: 
                  {
                    StmtHit(76);
                    \u03b3retVal = (tblInstructionRoutingLine.Target.ALCount);
                    return ;
                  }
                  break;
                  default:
                  {
                    StmtHit(77);
                    \u03b3retVal = (tblInstructionLine.Target.ALCount);
                    return ;
                  }break;
                  
                }
              }
              break;
              case 2: 
              {
                
                {
                  StmtHit(78);
                  tblInstructionLine.Target.ALFilterGroup = 2;
                  StmtHit(79);
                  switch(( (Int32)(poptType) ))
                  {
                    case 1: 
                    case 2: 
                    case 3: 
                    case 8: 
                    case 17: 
                    case 18: 
                    {
                      
                      {
                        StmtHit(80);
                        pgInstructionLineView.Target.SetTableView(tblInstructionLine.Target);
                        if(CStmtHit(81)&((poptType.CompareTo(poptType.CreateInstance(2)) == 0) || (poptType.CompareTo(poptType.CreateInstance(17)) == 0) || (poptType.CompareTo(poptType.CreateInstance(8)) == 0)))
                        {
                          StmtHit(82);
                          pgInstructionLineView.Target.Invoke(1000000001, new Object[]{});
                        }
                        if(CStmtHit(83)&((poptType.CompareTo(poptType.CreateInstance(17)) == 0) || (poptType.CompareTo(poptType.CreateInstance(18)) == 0)))
                        {
                          StmtHit(84);
                          pgInstructionLineView.Target.Invoke(1000000004, new Object[]{});
                        }
                        StmtHit(85);
                        pgInstructionLineView.RunModal();
                      }
                    }
                    break;
                    case 4: 
                    case 5: 
                    case 10: 
                    case 11: 
                    case 12: 
                    case 13: 
                    case 14: 
                    case 15: 
                    case 16: 
                    case 19: 
                    {
                      StmtHit(86);
                      NavForm.RunModal(false, false, 50013, tblInstructionLine.Target);
                    }
                    break;
                    case 9: 
                    {
                      StmtHit(87);
                      NavForm.RunModal(false, false, 50048, tblInstructionRoutingLine.Target);
                    }
                    break;
                    case 6: 
                    case 7: 
                    {
                      StmtHit(88);
                      NavForm.RunModal(false, false, 50154, tblRequest.Target);
                    }
                    break;
                    
                  }
                  StmtHit(89);
                  tblInstructionLine.Target.ALFilterGroup = 0;
                }
              }
              break;
              
            }
          }
          
        }
        [NavName(@"fncCheckAddressDetails")]
        [SourceSpans(915638108042887197, 915919583019663423, 916201066586374207, 916482550153084964, 917045482926768195, 917326966493478979, 917608450060189732, 917889899267162112)]
        private class FncCheckAddressDetails_Scope : NavMethodScope<Codeunit50006>
        {
          public static UInt32 \u03b1scopeId;
          [NavName(@"codContactNo")]
          public NavCode codContactNo;
          [NavName(@"tblContact")]
          public NavRecordHandle tblContact;
          
          protected override UInt32 RawScopeId 
          {
            get
            {
              return (FncCheckAddressDetails_Scope.\u03b1scopeId);
            }
            set
            {
              FncCheckAddressDetails_Scope.\u03b1scopeId = value;
            }
          }
          
          internal FncCheckAddressDetails_Scope(Codeunit50006 \u03b2parent,NavCode codContactNo) : base(\u03b2parent)
          {
            codContactNo = codContactNo.ModifyLength(20);
            this.codContactNo = codContactNo;
            tblContact = new NavRecordHandle(this, 5050, false, SecurityFiltering.Validated);
          }
          
          
          
          protected override void OnRun()
          {
            StmtHit(0);
            tblContact.Target.ALGetSafe(DataError.ThrowError, 409565, codContactNo);
            if(CStmtHit(1)&((( (NavText)(tblContact.Target.GetFieldValueSafe(50001, NavType.Text)) )!=@"")|(( (NavText)(tblContact.Target.GetFieldValueSafe(50002, NavType.Text)) )!=@"")))
            {
              if(CStmtHit(2)&((( (NavText)(tblContact.Target.GetFieldValueSafe(50001, NavType.Text)) )==@"")|(( (NavText)(tblContact.Target.GetFieldValueSafe(50002, NavType.Text)) )==@"")))
              {
                StmtHit(3);
                NavDialog.ALError(new Guid(50006, 15259, 51751, 8, 5, 197, 5, 131, 107, 210, 210), text008, ( (NavCode)(tblContact.Target.GetFieldValueSafe(1, NavType.Code)) ));
              }
            }
            if(CStmtHit(4)&((( (NavText)(tblContact.Target.GetFieldValueSafe(50003, NavType.Text)) )!=@"")|(( (NavCode)(tblContact.Target.GetFieldValueSafe(50004, NavType.Code)) )!=@"")))
            {
              if(CStmtHit(5)&((( (NavText)(tblContact.Target.GetFieldValueSafe(50003, NavType.Text)) )==@"")|(( (NavCode)(tblContact.Target.GetFieldValueSafe(50004, NavType.Code)) )==@"")))
              {
                StmtHit(6);
                NavDialog.ALError(new Guid(50006, 15259, 51751, 8, 5, 198, 5, 131, 107, 210, 210), text009, ( (NavCode)(tblContact.Target.GetFieldValueSafe(1, NavType.Code)) ));
              }
            }
          }
          
        }
        [NavName(@"fncClearInhibitionsResults")]
        [SourceSpans(919297282740977691, 919578757717753943, 919860232694530133, 920141707671306277, 920704657624858650, 920986132601634902, 921267607578411092, 921549082555187236, 922393507485515795, 922674982462292047, 922956457439068237, 923237932415844388, 925208265843212321, 925489740819988511, 926052690773540892, 926334182930186268, 926615623547224064)]
        private class FncClearInhibitionsResults_Scope : NavMethodScope<Codeunit50006>
        {
          public static UInt32 \u03b1scopeId;
          [NavName(@"ptblInstructionLine")]
          public INavRecordHandle ptblInstructionLine;
          [NavName(@"tblInhibitionsQuery")]
          public NavRecordHandle tblInhibitionsQuery;
          [NavName(@"tblInhibitionsResult")]
          public NavRecordHandle tblInhibitionsResult;
          [NavName(@"tblPartyName")]
          public NavRecordHandle tblPartyName;
          
          protected override UInt32 RawScopeId 
          {
            get
            {
              return (FncClearInhibitionsResults_Scope.\u03b1scopeId);
            }
            set
            {
              FncClearInhibitionsResults_Scope.\u03b1scopeId = value;
            }
          }
          
          internal FncClearInhibitionsResults_Scope(Codeunit50006 \u03b2parent,[NavObjectId(ObjectId = 50001)]INavRecordHandle ptblInstructionLine) : base(\u03b2parent)
          {
            ptblInstructionLine = ptblInstructionLine.ALByValue(this, false);
            this.ptblInstructionLine = ptblInstructionLine;
            tblInhibitionsQuery = new NavRecordHandle(this, 50036, false, SecurityFiltering.Validated);
            tblInhibitionsResult = new NavRecordHandle(this, 50035, false, SecurityFiltering.Validated);
            tblPartyName = new NavRecordHandle(this, 50003, false, SecurityFiltering.Validated);
          }
          
          
          
          protected override void OnRun()
          {
            StmtHit(0);
            tblInhibitionsResult.Target.ALReset();
            StmtHit(1);
            tblInhibitionsResult.Target.ALSetRangeSafe(1, NavType.Code, ( (NavCode)(ptblInstructionLine.Target.GetFieldValueSafe(1, NavType.Code)) ));
            StmtHit(2);
            tblInhibitionsResult.Target.ALSetRangeSafe(2, NavType.Integer, ALCompiler.ToNavValue(ptblInstructionLine.Target.GetFieldValueSafe(2, NavType.Integer).ToInt32()));
            StmtHit(3);
            tblInhibitionsResult.Target.ALDeleteAll(true);
            StmtHit(4);
            tblInhibitionsQuery.Target.ALReset();
            StmtHit(5);
            tblInhibitionsQuery.Target.ALSetRangeSafe(1, NavType.Code, ( (NavCode)(ptblInstructionLine.Target.GetFieldValueSafe(1, NavType.Code)) ));
            StmtHit(6);
            tblInhibitionsQuery.Target.ALSetRangeSafe(2, NavType.Integer, ALCompiler.ToNavValue(ptblInstructionLine.Target.GetFieldValueSafe(2, NavType.Integer).ToInt32()));
            StmtHit(7);
            tblInhibitionsQuery.Target.ALDeleteAll(true);
            StmtHit(8);
            tblPartyName.Target.ALReset();
            StmtHit(9);
            tblPartyName.Target.ALSetRangeSafe(1, NavType.Code, ( (NavCode)(ptblInstructionLine.Target.GetFieldValueSafe(1, NavType.Code)) ));
            StmtHit(10);
            tblPartyName.Target.ALSetRangeSafe(2, NavType.Integer, ALCompiler.ToNavValue(ptblInstructionLine.Target.GetFieldValueSafe(2, NavType.Integer).ToInt32()));
            if(CStmtHit(11)&(tblPartyName.Target.ALFindSet(DataError.TrapError, true, false)))
            {
              do
              {
                StmtHit(12);
                tblPartyName.Target.SetFieldValueSafe(40, NavType.Date, NavDate.Create(0U));
                StmtHit(13);
                tblPartyName.Target.SetFieldValueSafe(50, NavType.Date, NavDate.Create(0U));
                StmtHit(14);
                tblPartyName.Target.ALModify(DataError.ThrowError, true);
              }
              while(!(CStmtHit(15)&(tblPartyName.Target.ALNext()==0)));
            }
          }
          
        }
        [NavName(@"fncCreateChangeOfUserNotification")]
        [SourceSpans(928023007021039655, 928304490587750407, 928867431951368256, 929148906928144493, 929430381904920672, 929711856881696900, 929993331858473078, 930274806835249182, 930556281812025393, 930837756788801566, 931119231765577775, 931400706742353955, 931682181719130161, 931963656695906357, 932245131672682528, 932526606649458765, 932808081626234911, 933089556603011094, 933933981533339682, 934215456510115904, 934778415053602852, 935059890030379047, 935341365007155239, 935622839983931428, 936185789937483817, 939000548295180311, 939282023272284202, 940970873132613655, 941815272293138432)]
        private class FncCreateChangeOfUserNotification_Scope : NavMethodScope<Codeunit50006>
        {
          public static UInt32 \u03b1scopeId;
          [NavName(@"ptblInstructionLine")]
          public INavRecordHandle ptblInstructionLine;
          [NavName(@"pcodProcessCode")]
          public NavCode pcodProcessCode;
          [NavName(@"tblInstructionHeader")]
          public NavRecordHandle tblInstructionHeader;
          [NavName(@"tblInstructionManagementSetup")]
          public NavRecordHandle tblInstructionManagementSetup;
          [NavName(@"tblUserSetup")]
          public NavRecordHandle tblUserSetup;
          [NavName(@"tblUserSetup2")]
          public NavRecordHandle tblUserSetup2;
          [NavName(@"tblRecordlLink")]
          public NavRecordHandle tblRecordlLink;
          [NavName(@"cduMail")]
          public NavCodeunitHandle cduMail;
          [NavName(@"cduSMTPMail")]
          public NavCodeunitHandle cduSMTPMail;
          [NavName(@"dotBinaryWriter")]
          public NavDotNet dotBinaryWriter;
          [NavName(@"dotEncoding")]
          public NavDotNet dotEncoding;
          [NavName(@"ostStreamOutObj")]
          public NavOutStream ostStreamOutObj;
          [NavName(@"txtNote")]
          public NavText txtNote = NavText.Default(1000);
          [NavName(@"intLinkID")]
          public Int32 intLinkID = 0;
          [NavName(@"txtURL")]
          public NavText txtURL = NavText.Default(1000);
          [NavName(@"rrfRecRef")]
          public NavRecordRef rrfRecRef;
          
          protected override UInt32 RawScopeId 
          {
            get
            {
              return (FncCreateChangeOfUserNotification_Scope.\u03b1scopeId);
            }
            set
            {
              FncCreateChangeOfUserNotification_Scope.\u03b1scopeId = value;
            }
          }
          
          internal FncCreateChangeOfUserNotification_Scope(Codeunit50006 \u03b2parent,[NavObjectId(ObjectId = 50001)]INavRecordHandle ptblInstructionLine,NavCode pcodProcessCode) : base(\u03b2parent)
          {
            ptblInstructionLine = ptblInstructionLine.ALByValue(this, false);
            this.ptblInstructionLine = ptblInstructionLine;
            pcodProcessCode = pcodProcessCode.ModifyLength(50);
            this.pcodProcessCode = pcodProcessCode;
            tblInstructionHeader = new NavRecordHandle(this, 50000, false, SecurityFiltering.Validated);
            tblInstructionManagementSetup = new NavRecordHandle(this, 50011, false, SecurityFiltering.Validated);
            tblUserSetup = new NavRecordHandle(this, 91, false, SecurityFiltering.Validated);
            tblUserSetup2 = new NavRecordHandle(this, 91, false, SecurityFiltering.Validated);
            tblRecordlLink = new NavRecordHandle(this, 2000000068, false, SecurityFiltering.Validated);
            cduMail = new NavCodeunitHandle(this, 397);
            cduSMTPMail = new NavCodeunitHandle(this, 400);
            dotBinaryWriter = new NavDotNet(this, @"mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", @"System.IO.BinaryWriter", false);
            dotEncoding = new NavDotNet(this, @"mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", @"System.Text.Encoding", false);
            ostStreamOutObj = NavOutStream.Default(this);
            rrfRecRef = new NavRecordRef(this, SecurityFiltering.Validated);
          }
          
          
          
          protected override void OnRun()
          {
            if(CStmtHit(0)&(pcodProcessCode==ALSystemString.ALUppercase(ALDatabase.ALUserID)))
            {
              StmtHit(1);
              return ;
            }
            StmtHit(2);
            tblInstructionHeader.Target.ALGetSafe(DataError.ThrowError, 409565, ( (NavCode)(ptblInstructionLine.Target.GetFieldValueSafe(1, NavType.Code)) ));
            StmtHit(3);
            txtNote = new NavText(1000, ALSystemString.ALStrSubstNo(text190, ( (NavCode)(tblInstructionHeader.Target.GetFieldValueSafe(1, NavType.Code)) ), ( (NavCode)(ptblInstructionLine.Target.GetFieldValueSafe(5, NavType.Code)) ), pcodProcessCode));
            StmtHit(4);
            txtURL = new NavText(1000, ALSystemOperatingSystem.ALGetUrl(NavClientType.Current, ALDatabase.ALCompanyName, NavObjectType.Page, 50010));
            StmtHit(5);
            txtURL = new NavText(1000, txtURL+@"&filter="+apostrophe+@"No."+apostrophe+@"%20IS%20"+apostrophe+( (NavCode)(tblInstructionHeader.Target.GetFieldValueSafe(1, NavType.Code)) )+apostrophe);
            StmtHit(6);
            intLinkID = tblInstructionHeader.Target.ALAddLink(txtURL, ALSystemString.ALStrSubstNo(@"Instruction Under Query %1", ( (NavCode)(tblInstructionHeader.Target.GetFieldValueSafe(1, NavType.Code)) )));
            StmtHit(7);
            tblRecordlLink.Target.ALGetSafe(DataError.ThrowError, 449479, ALCompiler.ToNavValue(intLinkID));
            StmtHit(8);
            tblRecordlLink.Target.SetFieldValueSafe(8, NavType.Option, ( (NavOption)(tblRecordlLink.Target.GetFieldValueSafe(8, NavType.Option)) ).CreateInstance(1));
            StmtHit(9);
            tblRecordlLink.Target.SetFieldValueSafe(13, NavType.Boolean, NavBoolean.Create(true));
            StmtHit(10);
            tblRecordlLink.Target.SetFieldValueSafe(14, NavType.Text, new NavText(tblRecordlLink.Target.GetFieldValueSafe(14, NavType.Text).NavDefinedLengthMetadata, pcodProcessCode));
            StmtHit(11);
            rrfRecRef.ALSetTable(tblRecordlLink.Target);
            StmtHit(12);
            tblRecordlLink.Target.SetFieldValueSafe(2, NavType.RecordID, rrfRecRef.ALRecordId);
            StmtHit(13);
            ostStreamOutObj.ALAssign(( (NavBLOB)(tblRecordlLink.Target.GetFieldValueSafe(9, NavType.BLOB)) ).ALCreateOutStream(this));
            StmtHit(14);
            dotEncoding.ALAssign(dotEncoding.InvokeStaticPropertyGet<NavDotNet>(@"UTF8", 17U));
            StmtHit(15);
            dotBinaryWriter.ALAssign(dotBinaryWriter.CreateDotNet(ALCompiler.OutStreamToDotNet(this, ostStreamOutObj), dotEncoding));
            StmtHit(16);
            dotBinaryWriter.InvokeMethod<Object>(@"Write", 14U, txtNote);
            StmtHit(17);
            tblRecordlLink.Target.ALModify(DataError.ThrowError);
            StmtHit(18);
            tblInstructionManagementSetup.Target.ALGetSafe(DataError.ThrowError, 409565);
            if(CStmtHit(19)&(tblInstructionManagementSetup.Target.GetFieldValueSafe(190, NavType.Boolean).ToBoolean()))
            {
              StmtHit(20);
              tblUserSetup.Target.ALGetSafe(DataError.ThrowError, 409565, pcodProcessCode);
              StmtHit(21);
              tblUserSetup2.Target.ALGetSafe(DataError.ThrowError, 409565, ALCompiler.ToNavValue(ALSystemString.ALUppercase(ALDatabase.ALUserID)));
              StmtHit(22);
              tblUserSetup2.Target.ALTestFieldSafe(50001, NavType.Text);
              StmtHit(23);
              tblUserSetup2.Target.ALTestFieldSafe(17, NavType.Text);
              if(CStmtHit(24)&((ALSystemString.ALStrLen(( (NavText)(tblUserSetup.Target.GetFieldValueSafe(17, NavType.Text)) ))>0)))
              {
                StmtHit(25);
                cduSMTPMail.ClearReference();
                StmtHit(26);
                cduSMTPMail.Target.Invoke(1, new Object[]{( (NavText)(tblUserSetup2.Target.GetFieldValueSafe(50001, NavType.Text)) ), ( (NavText)(tblUserSetup2.Target.GetFieldValueSafe(17, NavType.Text)) ), ( (NavText)(tblUserSetup.Target.GetFieldValueSafe(17, NavType.Text)) ), new NavText(ALSystemString.ALStrSubstNo(text180, ( (NavCode)(tblInstructionHeader.Target.GetFieldValueSafe(1, NavType.Code)) ))), new NavText(ALSystemString.ALStrSubstNo(text190, ( (NavCode)(tblInstructionHeader.Target.GetFieldValueSafe(1, NavType.Code)) ), ( (NavCode)(ptblInstructionLine.Target.GetFieldValueSafe(5, NavType.Code)) ), pcodProcessCode)), false});
                StmtHit(27);
                cduSMTPMail.Target.Invoke(3, new Object[]{});
              }
            }
          }
          
        }
        [NavName(@"fncCreatePECEnquiryNotification")]
        [SourceSpans(955044596201619456)]
        private class FncCreatePECEnquiryNotification_Scope : NavMethodScope<Codeunit50006>
        {
          public static UInt32 \u03b1scopeId;
          [NavName(@"ptblPECSearchEnquiry")]
          public INavRecordHandle ptblPECSearchEnquiry;
          
          protected override UInt32 RawScopeId 
          {
            get
            {
              return (FncCreatePECEnquiryNotification_Scope.\u03b1scopeId);
            }
            set
            {
              FncCreatePECEnquiryNotification_Scope.\u03b1scopeId = value;
            }
          }
          
          internal FncCreatePECEnquiryNotification_Scope(Codeunit50006 \u03b2parent,[NavObjectId(ObjectId = 50118)]INavRecordHandle ptblPECSearchEnquiry) : base(\u03b2parent)
          {
            ptblPECSearchEnquiry = ptblPECSearchEnquiry.ALByValue(this, false);
            this.ptblPECSearchEnquiry = ptblPECSearchEnquiry;
          }
          
          
          
          protected override void OnRun()
          {
          }
          
        }
        [SourceSpans(281483566710794, 562949953552384)]
        private class OnRun_Scope : NavTriggerMethodScope<Codeunit50006>
        {
          public static UInt32 \u03b1scopeId;
          public INavRecordHandle rec;
          [NavName(@"tblInstructionHeader")]
          public NavRecordHandle tblInstructionHeader;
          
          protected override UInt32 RawScopeId 
          {
            get
            {
              return (OnRun_Scope.\u03b1scopeId);
            }
            set
            {
              OnRun_Scope.\u03b1scopeId = value;
            }
          }
          
          internal OnRun_Scope(Codeunit50006 \u03b2parent,[NavObjectId(ObjectId = 0)]INavRecordHandle \u03b5rec) : base(\u03b2parent)
          {
            this.rec = \u03b5rec;
            tblInstructionHeader = new NavRecordHandle(this, 50000, false, SecurityFiltering.Validated);
          }
          
          
          
          protected override void OnRun()
          {
            StmtHit(0);
            NavDialog.ALError(new Guid(50006, 0, 39167, 8, 5, 0, 0, 131, 107, 210, 210), @"");
          }
          
        }
        
      }
    }
    
  • ScottJonesScottJones Member Posts: 44
    This is the CAL code. Written for V5 in 2009 by a colleague and cut/pasted into same codeunit 50006 in NAV2013R2. Forms turned to pages etc.

    Hope this helps! You can see the RunModals which I believe are called from the factbox...
    fncWFCockpit(poptMode : ' ,Count,View';poptType : ' ,Unassigned,Assigned Team,Assigned User,Queried Team,Queried User,Failed Team,Failed User,Pending,Searches to Come,Assigned by Team,Assigned by Me,Returned to Team,Returned to Me,Assigned Team UQ,Ass
    //fncWFCockpit - RW - 23/02/2007 - PES010
    
    tblInstructionLine.RESET;
    tblInstructionRoutingLine.RESET;
    tblRequest.RESET;
    
    CASE poptType OF
      poptType::Unassigned:                                      //1
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Current User","In Workflow");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETFILTER("Current User",'%1','');
          tblInstructionLine.SETRANGE("In Workflow",TRUE);
        END;
      poptType::"Assigned Team":                                 //2
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Current User","In Workflow");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETFILTER("Current User",'>%1','');
          tblInstructionLine.SETRANGE("In Workflow",TRUE);
        END;
      poptType::"Assigned User":                                 //3
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current User","In Workflow");
          tblInstructionLine.SETRANGE("Current User",UPPERCASE(USERID));
          tblInstructionLine.SETRANGE("In Workflow",TRUE);
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
        END;
      poptType::"Queried Team":                                  //4
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Under Query","Current User");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE("Under Query",TRUE);
          tblInstructionLine.SETFILTER("Current User",'%1','');
        END;
      poptType::"Queried User":                                  //5
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Under Query","Current User");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE("Under Query",TRUE);
          tblInstructionLine.SETRANGE("Current User",UPPERCASE(USERID));
        END;
      poptType::"Failed Team":                                   //6
        BEGIN
          tblRequest.SETCURRENTKEY("Team Code",Status);
          tblRequest.SETFILTER("Team Code",ptxtTeamFilter);
          tblRequest.SETRANGE(Status,tblRequest.Status::Failed);
        END;
      poptType::"Failed User":                                   //7
        BEGIN
          tblRequest.SETCURRENTKEY("Team Code",Status);
          tblRequest.SETFILTER("Team Code",ptxtTeamFilter);
          tblRequest.SETRANGE(Status,tblRequest.Status::Failed);
          tblRequest.SETRANGE("User ID",UPPERCASE(USERID));
        END;
      poptType::Pending:                                         //8
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team",Pending);
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE(Pending,TRUE);
        END;
      poptType::"Searches to Come":                              //9
        BEGIN
          tblInstructionRoutingLine.SETCURRENTKEY("Team Code","Active Line",Completed,Cancelled);
          tblInstructionRoutingLine.SETFILTER("Team Code",'%1',ptxtTeamFilter);
          tblInstructionRoutingLine.SETRANGE("Active Line",FALSE);
          tblInstructionRoutingLine.SETRANGE(Completed,FALSE);
          tblInstructionRoutingLine.SETRANGE(Cancelled,FALSE);
        END;
      poptType::"Assigned by Team":                              //10
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Assigned by Team");
          tblInstructionLine.SETRANGE("Assigned by Team",ptxtTeamFilter);
        END;
      poptType::"Assigned by Me":                                //11
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Assigned by User");
          tblInstructionLine.SETRANGE("Assigned by User",UPPERCASE(USERID));
        END;
      poptType::"Returned to Team":                              //12
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Last Assigned by Team");
          tblInstructionLine.SETRANGE("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE("Last Assigned by Team",ptxtTeamFilter);
        END;
      poptType::"Returned to Me":                                //13
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Current User","Last Assigned by User");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE("Current User",UPPERCASE(USERID));
          tblInstructionLine.SETRANGE("Last Assigned by User",UPPERCASE(USERID));
        END;
      poptType::"Assigned Team UQ":                              //14
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Under Query");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE("Under Query",TRUE);
        END;
      poptType::"Assigned Me UQ":                                //15
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Under Query","Current User");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE("Under Query",TRUE);
          tblInstructionLine.SETRANGE("Current User",UPPERCASE(USERID));
        END;
      poptType::"Queried Total":                                 //16
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Under Query");
          tblInstructionLine.SETRANGE("Under Query",TRUE);
        END;
      poptType::"Assigned Team IO":                              //17
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","In Workflow");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE("In Workflow",TRUE);
        END;
      poptType::"Assigned Me IO":                                //18
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current User","In Workflow");
          tblInstructionLine.SETRANGE("Current User",UPPERCASE(USERID));
          tblInstructionLine.SETRANGE("In Workflow",TRUE);
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
        END;
      poptType::"Queried Team Assigned":                         //19
        BEGIN
          tblInstructionLine.SETCURRENTKEY("Current Team","Under Query","Current User");
          tblInstructionLine.SETFILTER("Current Team",ptxtTeamFilter);
          tblInstructionLine.SETRANGE("Under Query",TRUE);
          tblInstructionLine.SETFILTER("Current User",'>%1','');
        END;
    END;
    
    IF poptType <> poptType::"Searches to Come" THEN BEGIN
      tblInstructionLine.SETRANGE(Cancelled,FALSE);
      tblInstructionLine.SETFILTER(Quantity,'>%1',0);
    END;
    
    CASE poptMode OF
      poptMode::Count:
        CASE poptType OF
          poptType::"Failed Team",poptType::"Failed User":
            EXIT(tblRequest.COUNT);
          poptType::"Searches to Come":
            EXIT(tblInstructionRoutingLine.COUNT);
          ELSE
            EXIT(tblInstructionLine.COUNT);
        END;
      poptMode::View:
        BEGIN
          tblInstructionLine.FILTERGROUP(2);
          CASE poptType OF
            poptType::Unassigned,poptType::"Assigned Team",poptType::"Assigned User",poptType::Pending,poptType::"Assigned Team IO",
            poptType::"Assigned Me IO":
              BEGIN
                pgInstructionLineView.SETTABLEVIEW(tblInstructionLine);
                IF poptType IN [poptType::"Assigned Team",poptType::"Assigned Team IO",poptType::Pending] THEN
                  pgInstructionLineView.fncSetManagerMode;
                IF poptType IN [poptType::"Assigned Team IO",poptType::"Assigned Me IO"] THEN
                  pgInstructionLineView.fncSetRunWorkflow;
                pgInstructionLineView.RUNMODAL;
              END;
            poptType::"Queried Team",poptType::"Queried User",poptType::"Assigned by Team",poptType::"Assigned by Me",
            poptType::"Returned to Team",poptType::"Returned to Me",poptType::"Assigned Team UQ",poptType::"Assigned Me UQ",
            poptType::"Queried Total",poptType::"Queried Team Assigned":
              PAGE.RUNMODAL(PAGE::"Under Query",tblInstructionLine);
            poptType::"Searches to Come":
              PAGE.RUNMODAL(PAGE::"Instruction Routing Line",tblInstructionRoutingLine);
            poptType::"Failed Team",poptType::"Failed User":
              PAGE.RUNMODAL(PAGE::"Request List",tblRequest);
          END;
          tblInstructionLine.FILTERGROUP(0);
        END;
    END;
    
  • ScottJonesScottJones Member Posts: 44
    The plot thickens... The error occurred last night, a session was left logged in at 01:12.55 in the morning something created the following call stack errors.

    The test user was not using the system. The error occurred on a Factbox. There is a count of the number of instructions assigned to a user. Something somehow triggered the drilldown on the text box that caused CU50006.FncWFCockpit to trigger. (Well this is what the call stack indicates!)

    FSSSError_zpswukyvb9b-1.jpg

    Thoughts pls... I have been out for 2-3 days... Testing has reduced so the error has not occurred as often so I cannot confirm if it only occurs in custom objects....
  • ScottJonesScottJones Member Posts: 44
    This error also occurred at exactly the same instance for the same user who was asleep at the time... (Again the call stack indicates the action ActOpen was triggered on page 50013... The page was left open overnight)

    FSSSError2_zpsogpidfvy-1.jpg

    Thoughts pls...
  • WojtekmWojtekm Member Posts: 123
    Hi ScottJones,

    I have similar issue after upgrading NAV 2013 r2 form CU4 to CU13.

    Errors occurs randomly for only few users when NAV fire code:
    IF Page.RUNMODAL(60001, TmpRec) = ACTION::LookupOK THEN BEGIN
    ....
    

    I`ve checked everything twice, every user use correct NAV client version. But still don't find solution.
    ](*,) ](*,) ](*,)

    Regards,
  • ScottJonesScottJones Member Posts: 44
    Interesting, is this in standard code or something you have written? We would like to raise a support ticket with Microsoft but need something more concrete and easy to demonstrate. Our system is far from standard.
  • ScottJonesScottJones Member Posts: 44
    OK... Little more information.. PROCDUMP detailed the following message from the middle tier service: System.ServiceModel.CommunicationException ("The sequence has been terminated by the remote endpoint. The inactivity timeout of (00:04:00) has been exceeded. The reliable session was faulted."). I assume this is a WCF (Windows Communication Foundation) error. Does anyone have experience with changing this timeout value with NAV using service tier config files?

    One thing that confused us is the stack trace detailed on the previous screen shot is because the user clicked an action on a page that ran a modal form... The modal form sat there until the timeout error was given. The error was then written to the event log containing the full stack track. It is not when the user clicked the action button. This explains why the error occurred at 1am on one occasion, because the users session was left logged in on the modal form.

    Pingpong is present on the underlying page, but our developer is adamant it is not ping-pong he removed it for 2 days and the error still appeared in the event log (Also ping pong does not seem to run when there is a modal page opened from the ping pong page).

    InactivityTimeout_zpsxm96jqmq.jpg
  • WojtekmWojtekm Member Posts: 123
    I get this error only once on standard functionality of NAV (dimension lookup function).

    And I still get this error on custom solution but only on few client machines - all time its the same machines.
    I rebuild my solution - my suspicious was temporary record on Page.RUNMODAL function. Now i am using buffer table but it doesnt help.
    Client IT guys said that this computers are exacly the same as rest of comuters - there is (propably) no network issues....
  • ScottJonesScottJones Member Posts: 44
    Interesting, are you on physical hardware or virtual environment? We are only getting the stack dump when a modal page is run because the underlying stack contains the action button that was pressed (This may have been pressed 1 seconds -> 10 minutes ago and the client remains on the modal form). If this wasn't a modal form then there would be no in memory stack to dump and possibly only the client receives the timeout?? The Modal forms seems to show error trace on server as the middle tier is waiting for the user to complete processing on the modal form.

    We have updated .NET framework on middle tier & the 4 Microsoft Remote Desktop Services servers. All servers have had updates applied. We are now on the point of building a physical middle tier machine and installing it in the data centre separate from the VMware server cluster. (Server is being transported in van tomorrow).

    The servers setup has worked fine for NAV2009 Classic for over a year and continues to work fine along side the new NAV2013R2 on VMware server cluster so unsure if replacing the middle tier with a physical machine will help....

    Thoughts pls...
  • WojtekmWojtekm Member Posts: 123
    We have this issue on virtual machines. Never check it on phisycal machines.

    We have make workaround for this issue using worksheet page type (in lookup mode) instead of using Page.Runmodal.
    Now its working like a charm.

    But still its only workaround....
  • ScottJonesScottJones Member Posts: 44
    I am wondering if it is to do with server time stamps and the client setting:

    <key="ClientServicesKeepAliveInterval" value="120" />

    Do you have services to update server time automatically? If I increment the server time by greater that 2minutes I get the timeout message and can reconnect to same session.

    If I reduce this setting to 1 second. I get the error if I increase the server time by > 1 second. This is repeatable but I am not sure if this is the reason for our timeouts... Onsite tomorrow so we will see..
  • vremeni4vremeni4 Member Posts: 323
    Hi,

    After some testing I managed to, kind of re-create, the same issue. The error message does not pop-up all the time so it is intermittent.
    The error message is:
    The Server stopped the session (ID:9903030) because of a stop session request.

    Wojtekm was right the error message happens when you have a structure
    IF Page.RUNMODAL = ACTION::OK THEN BEGIN
    ..
    END;
    When the page is run (it has to be runmodal ) there is a Dialogue that shows a progress of the action, If I click on "Cancel" to stop it, NAV crashes and the error message in the even viewer is
    The Server stopped the session (ID:9903030) because of a stop session request.
    For
    IF Page.RUN = ACTION::OK THEN BEGIN
    ..
    END;
    everything works fine.
    So in my opinion this is a bug that only Microsoft can fix.

    It looks like the RUNMODAL causes this issue, as it sends a wrong signal to the server when it is inactive.
    It sends a signal that session is closed but in fact only the page is closed.

    So I would rise a technical support call with Microsoft.

    I hope this helps.
    Thanks.
  • ScottJonesScottJones Member Posts: 44
    Hi vremeni4,

    Thank you for your research we have had an open technical support call with Microsoft for some weeks and they are helping us. Sounds extremely familiar I will pass on your findings I'm sure there are issues around this area.

    Microsoft have confirmed the client setting ClientServicesKeepAliveInterval is an additional setting that was introduced for Windows Azure...

    They state “In NAV 2013 R2 the ClientServicesKeepAliveInterval setting was added which overrides the WCF ReliableSession.InactivityTimeout Property. This makes the default NAV Client session inactivity timeout 2 minutes.”. This setting was also ported back to NAV 2013 via hotfix.

    The middle tier code uses this setting at various points, one of these points is when a MODAL PAGE closes to check for inactivity timeouts.

    There are issues there but I think they are being exacerbated by the client 'Windows Time' service receiving time updates from the active directory domain controller(s)... We've made some changes and users are testing the system today/tomorrow... Will keep you posted...
  • ScottJonesScottJones Member Posts: 44
    SOLVED: It was down to the configuration of the servers and VMWare. There are two active directory servers AD1 & AD2 running on VMs under VMWare with 'Windows Time' service configured as follows:

    *AD1 was setup as type NTP and configured to pickup the current time every 1024 seconds (Approx 17 mins) from NTP.ORG pool of servers on the internet.
    *AD2 was setup as type NT5DS configured to pickup the time from AD1 when available.

    All other servers/workstations including our middle tier then had 'Windows Time' client service running to pickup the time from the active directory server that they were authenticated by. Either AD1 or AD2. Thus every 1024 seconds (Approx 17mins) these would received time updates from the AD1/AD2.

    All fine except...

    Somehow, a Boolean had inadvertently been set in VMware on the AD1 VM to pickup the time from the physical 'HOST' it was running on. (This being a cluster of servers did not help either as 2 physical hosts in the server pool)

    VMware was updating the time on AD1 back to the HOST RTC every 60 seconds. So for 16 out of 17 minutes the time on AD1 was correct. It would then jump by 5 minutes. This is greater than the <"ClientServicesKeepAliveInterval"> setting of 120 seconds. So when the time jumps forward NAV middle tier times out, but only once in a long while as the middle tier server had to request it's time update in the exact 1 minute interval when the time was wrong on the AD1.

    All working now... Thank you everyone for your input... Increasing <"ClientServicesKeepAliveInterval"> did help but there was still the possibility 6-8 months down the line if the HOST RTC went out this would have re-occurred!

    I still believe there are issues around <"ClientServicesKeepAliveInterval"> setting and MODAL pages but more information is required...
Sign In or Register to comment.