Focus on same Field

wwestendorpwwestendorp Member Posts: 178
edited 2013-09-16 in NAV Three Tier
Who can help me with the following Problem NAV2013 RTC

We have a page with a couple of "subpages", like General, Invoicing, Shipping etc. but also one Page called Barcode

If the User scans a Barcode in that Field on the "Subpage" then the Cursor should stay in that Barcode Field.

Now this only works if all other subbages are NOT enlarged.
If they are enlarged then the Cursor jumps automatically to the next Field

How can i Programm this so the Curso stays in that Field after validating the enterred Barcode

Is there a Function to say Next Field is the "BarkodeField" after Validation? In the Old NAV (3.7) it was Possible.

Or is there another solution to (before Validation of the Barcode Field) make all Subpages Small (So No Field is visseable) , validate the Value, The Cursor will stay at the Barcode Field because it is the only Field avvailable, and then open the "Subpages" again

The Subpages should be open so the User can see what they scanned in.

Who has a solution for this in NAV2013 RTC?

Regards,

Comments

  • thegunzothegunzo Member Posts: 274
    Have the barcode inserted with code by using USB-COM interface instead of a Keyboard interface then the cursor placement does not matter.
    OBJECT Codeunit 10017242 Store Serial Port Management
    {
      OBJECT-PROPERTIES
      {
        Date=31.05.13;
        Time=14:39:39;
        Modified=Yes;
        Version List=ST7.00;
      }
      PROPERTIES
      {
        TableNo=10017245;
        SingleInstance=Yes;
        OnRun=BEGIN
                IF "Serial Bar Code Reader Port" = "Serial Bar Code Reader Port"::"Hardware Hub" THEN BEGIN
                  TESTFIELD("Serial Port Hub Identifier");
                  TESTFIELD("Hardware Hub Path");
                  HostSetup := Rec;
                  Hub := Hub.Hub;
                  Hub.Url := "Hardware Hub Path";
                  Hub.ReceiveBarcode("Serial Port Hub Identifier"); // Clear buffer
                END ELSE BEGIN
                  IF "Serial Bar Code Reader Port" = 0 THEN ERROR('');
                  SerialPort := SerialPort.SerialPort(ComPortName("Serial Bar Code Reader Port"));
                  SerialPort.Open;
                  ClosePort;
                  CRLF[1] := 13;
                  CRLF[2] := 10;
                END;
              END;
    
      }
      CODE
      {
        VAR
          HostSetup@1000000006 : Record 10017245;
          Hub@1000000004 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.Hub";
          SerialPort@1000000000 : DotNet "'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Ports.SerialPort" RUNONCLIENT;
          SerialPortParity@1000000001 : DotNet "'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Ports.Parity" RUNONCLIENT;
          SerialPortStopBit@1000000002 : DotNet "'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Ports.StopBits" RUNONCLIENT;
          Buffer@1100408007 : Text[250];
          CRLF@1100408005 : Text[2];
          Ascii@1100408004 : Char;
          CharInt@1100408003 : Integer;
          CarNo@1100408002 : Integer;
    
        PROCEDURE OpenPort@1100409000(PortNo@1100409001 : Integer) : Boolean;
        BEGIN
          WITH HostSetup DO BEGIN
            IF "Serial Bar Code Reader Port" = "Serial Bar Code Reader Port"::"Hardware Hub" THEN EXIT(TRUE);
            ClosePort;
            SerialPort := SerialPort.SerialPort;
            SerialPort.PortName := ComPortName(PortNo);
            SerialPort.BaudRate := 9600;
            SerialPort.Parity := SerialPortParity.None;
            SerialPort.DataBits := 8;
            SerialPort.StopBits := SerialPortStopBit.One;
            SerialPort.ReadTimeout := 500;
            SerialPort.WriteTimeout := 500;
            SerialPort.Open;
            EXIT(SerialPort.IsOpen);
          END;
        END;
    
        PROCEDURE ClosePort@1100409001();
        BEGIN
          IF ISNULL(SerialPort) THEN EXIT;
          IF SerialPort.IsOpen THEN
            SerialPort.Close;
        END;
    
        PROCEDURE ReadInput@1100409002() LocalBuffer : Text[250];
        VAR
          InputString@1100409000 : Text[250];
        BEGIN
          WITH HostSetup DO BEGIN
            IF "Serial Bar Code Reader Port" = "Serial Bar Code Reader Port"::"Hardware Hub" THEN BEGIN
              LocalBuffer := Hub.ReceiveBarcode(HostSetup."Serial Port Hub Identifier");
            END ELSE IF SerialPort.BytesToRead > 0 THEN BEGIN
              Buffer := '';
              WHILE SerialPort.BytesToRead > 0 DO BEGIN
                InputString := SerialPort.ReadLine;
                Buffer := Buffer + InputString;
              END;
              IF STRLEN(Buffer) + STRLEN(InputString) > MAXSTRLEN(Buffer) THEN
                Buffer := COPYSTR(Buffer,1,MAXSTRLEN(Buffer) - STRLEN(InputString));
              Buffer := Buffer + InputString;
              IF STRLEN(Buffer) > 3 THEN
                IF COPYSTR(Buffer,STRLEN(Buffer) - 2,2) = CRLF THEN BEGIN
                  LocalBuffer := COPYSTR(Buffer,1,STRLEN(Buffer) - 3);
                  Buffer := '';
                END
            END;
          END;
        END;
    
        LOCAL PROCEDURE ComPortName@1000000000(ComPortNo@1000000000 : Integer) : Text;
        BEGIN
          IF ComPortNo = 0 THEN
            EXIT('')
          ELSE
            EXIT(STRSUBSTNO('COM%1',ComPortNo));
        END;
    
        EVENT SerialPort@1000000000::ErrorReceived@60(sender@1000000001 : Variant;e@1000000000 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Ports.SerialErrorReceivedEventArgs");
        BEGIN
        END;
    
        EVENT SerialPort@1000000000::PinChanged@61(sender@1000000001 : Variant;e@1000000000 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Ports.SerialPinChangedEventArgs");
        BEGIN
        END;
    
        EVENT SerialPort@1000000000::DataReceived@62(sender@1000000001 : Variant;e@1000000000 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Ports.SerialDataReceivedEventArgs");
        BEGIN
        END;
    
        EVENT SerialPort@1000000000::Disposed@63(sender@1000000001 : Variant;e@1000000000 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.EventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::SendCommandCompleted@57(sender@1000000001 : Variant;e@1000000000 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.SendCommandCompletedEventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::ReceiveCommandCompleted@58(sender@1000000001 : Variant;e@1000000000 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.ReceiveCommandCompletedEventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::SendBarcodeCompleted@59(sender@1000000001 : Variant;e@1000000000 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.SendBarcodeCompletedEventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::ReceiveBarcodeCompleted@60(sender@1000000001 : Variant;e@1000000000 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.ReceiveBarcodeCompletedEventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::SendImageCompleted@61(sender@1000000001 : Variant;e@1000000000 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.SendImageCompletedEventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::ReceiveImageCompleted@62(sender@1000000001 : Variant;e@1000000000 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.ReceiveImageCompletedEventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::SendXmlCompleted@63(sender@1000000001 : Variant;e@1000000000 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.SendXmlCompletedEventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::ReceiveXmlCompleted@64(sender@1000000001 : Variant;e@1000000000 : DotNet "'HardwareHubProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b1b040dde286b8b'.HardwareHubProxy.HardwareHub.ReceiveXmlCompletedEventArgs");
        BEGIN
        END;
    
        EVENT Hub@1000000004::Disposed@65(sender@1000000001 : Variant;e@1000000000 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.EventArgs");
        BEGIN
        END;
    
        BEGIN
        END.
      }
    }
    
    

    If you are not running NAV on the local host look at http://www.dynamics.is/?p=1324
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
Sign In or Register to comment.