Search code examples
microsoft-dynamicsnavisiondynamics-nav

Record being modified but can't find where even exporting all objects to txt


In Dynamics Nav 2018, I'm using the selected action in this page rows, when I click "Validar", all selected rows will change it's status to "Pendiente".

enter image description here

After some time, the row will change to status "Error":

enter image description here

I can see in debugger when it changes from "Registrando" to "Pendiente". But I can't see when it's changing to "Error" and when it's inserting data to column "Descripción Estado":

Validar - OnAction()
  UserSetup.GET(USERID);
  UserSetup.TESTFIELD("Superusuario SII",TRUE);
  
  //++SII V.08
  CurrPage.SETSELECTIONFILTER(SII);
  WITH SII DO BEGIN
    IF FINDSET(TRUE,TRUE) THEN
    REPEAT
    //--SII V.08
      //++SII JUL-2018
      IF SII."Pendiente de validar" THEN BEGIN
        TempHistSII.RESET;
        TempHistSII.SETCURRENTKEY("N Doc NAV","Fecha Registro");
        TempHistSII.SETRANGE("N Doc NAV",SII."N Doc NAV");
        TempHistSII.SETRANGE("Fecha Registro",SII."Fecha Registro");
        TempHistSII.SETRANGE(TempHistSII."Nº Mov",SII."Nº Mov");
        //++SII JUL-2018 12/06/18
        //IF TempHistSII.FINDFIRST THEN BEGIN
        IF TempHistSII.FINDLAST THEN BEGIN
        //--SII JUL-2018 12/06/18
          HistRegSII.INIT;
          HistRegSII.TRANSFERFIELDS(TempHistSII);
          HistRegSII."Usuario modificación" := USERID;
          HistRegSII."Fecha modificación" := TODAY;
          HistRegSII."Hora modificación" := TIME;
          HistRegSII.INSERT;
  
          //++SII JUL-2018 12/06/18
          //Inserto en tabla temporal
          TempHistSII.INIT;
          TempHistSII.TRANSFERFIELDS(SII);
          TempHistSII."Nº línea registro" := HistRegSII."Nº línea registro" + 10000;
          TempHistSII.INSERT;
          //--SII JUL-2018 12/06/18
        END;
        SII."Pendiente de validar" := FALSE;
      END;
      //--SII JUL-2018
  
      CASE Estado OF
        //++SII JUL-2018
        //Estado::"Registrada con error",Estado::Registrada:  //++SII V.07
        Estado::"Registrada con error",Estado::Registrada,Estado::"Error por inmuebles adicionales":
        //--SII JUL-2018
          BEGIN
            "Tipo comunicacion" := "Tipo comunicacion"::A1;
            Estado := Estado::Pendiente;
            "Descripción Estado" := '';
          END;
        //++SII V.06
        //Estado::Error:
        Estado::Error,Estado::"Error configuración":
        //--SII V.06
          BEGIN
            Estado := Estado::Pendiente;
            "Descripción Estado" := '';
          END;
        //++SII V.07
        Estado::Pendiente,Estado::"Pendiente Devengo":
          "Descripción Estado" := '';
        //--SII V.07
        ELSE
          ERROR(Text001,Estado);
      END;
      MODIFY;
  //++SII V.08
    UNTIL NEXT = 0;
  END;
  //--SII V.08

So I can see there when it's changing the status when clicking "Validar" button... but I can't find the process that is changing later the status to "Error"...

I'm checking the Job Queue Entries and I don't see anything that affects this columns.

Using the tool whereused I can't find anything.

I've also checked the table triggers and there's nothing, all empty.

I don't know how it's possible that I can't find anything exporting all objects to txt... I should be able to search "Descripción Estado" := or No existe el Registro

What could write to this column that it's not displayed in txt objects and not triggering the debugger?


Solution

    1. Table can still be modified through SQL. This you will only find using SQL Server Profiler.
    2. THEORETICALLY your version supports extensions v1, which you will not see when exporting objects to txt. So check if you have any extensions installed.
    3. Maybe you just searching wrong. Try using Statical Prism. This is a greater tool for code exploring.
    4. There is a trick I like to use. Your version supports subscriptions. Create a codeunit, put a subscriber function to it, subscribe to table's OnModify event and just throw an error when record is being modified and the value of the field is error. This will break some processes so do this on test DB. Then reproduce the behavior. Then check windows logs on server where nav instance is installed. Find your error in the log. Along with the error you will find stack trace. By stack trace you will see which object caused record modification.