Wierd error in store database (LS retail in use)

DeepDeep Member Posts: 569
Hello all.
We are working with LS Retail.
I found a wierd error while updating sales prices in one of the store databases.
The error screenshot is attached here :
When I checked the Sales price table, I found some special character is inserted in the field Sales Code. The screenshot is here:

I am unable to update the sales prices, and unable to take a backup of the database even.
Please suggest a wayout.
Regards,

Deep
India

Comments

  • MalajloMalajlo Member Posts: 294
    You should repair that value. Try with this code, but you should make some changes.
    You can also delete that record wih Get...Delete (or Get.. tmp := rec, rec.delete, rec := tmp, rec.code :=... insert)
    OBJECT Report 99999 Repair corrupted CODE fields
    {
      OBJECT-PROPERTIES
      {
        Date=13.07.05;
        Time=22:32:56;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        ProcessingOnly=Yes;
        OnPreReport=BEGIN
    
                      RecRef.OPEN(CorrTable);
                      IF RecRef.FIND('-') THEN //for exact record, put GET here!!!
                        REPEAT
                          FOR i := 1 TO RecRef.FIELDCOUNT DO BEGIN
                            FldRef := RecRef.FIELDINDEX(i);
                            IF (UPPERCASE(FORMAT(FldRef.TYPE)) = 'CODE') AND (UPPERCASE(FORMAT(FldRef.CLASS)) = 'NORMAL') THEN BEGIN
                                FldRef.VALUE := UPPERCASE(FORMAT(FldRef.VALUE)) ;
                            END;
                          END;
                          RecRef.MODIFY;
                        UNTIL RecRef.NEXT = 0;
                    END;
    
      }
      DATAITEMS
      {
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=8250;
          Height=440;
        }
        CONTROLS
        {
          { 1000000000;TextBox;3410 ;0    ;4840 ;440  ;CaptionML=ENU=Corupted table name;
                                                       SourceExpr=TableName;
                                                       OnValidate=BEGIN
                                                                    IF NOT (COPYSTR(TableName,1,1) IN['0'..'9'])  THEN
                                                                    BEGIN
                                                                    Objects.SETFILTER(Objects.Name,'@'+TableName+'*') ;
                                                                    IF Objects.FIND('-') THEN CorrTable := Objects.ID ELSE ERROR('Enter TableID!') ;
                                                                    TableName := Objects.Name ;
                                                                    END
                                                                    ELSE EVALUATE(CorrTable,TableName) ;
                                                                  END;
                                                                   }
          { 1000000001;Label  ;0    ;0    ;3300 ;440  ;ParentControl=1000000000 }
        }
      }
      CODE
      {
        VAR
          RecRef@1000000000 : RecordRef;
          FldRef@1000000001 : FieldRef;
          i@1000000002 : Integer;
          CorrTable@1000000003 : Integer;
          Objects@1000000004 : Record 2000000001;
          TableName@1000000005 : Text[50];
    
        BEGIN
        END.
      }
    }
    
  • DeepDeep Member Posts: 569
    Hi Malajlo,

    I imported your object an ran it. Still I find the same error.
    ](*,)
    I have opened the Database locally and after I encounter the error, a message saying "The connection to the server was interrupted because of a communication error. Start the client again" appears.
    :?: :?:
    Regards,

    Deep
    India
  • MalajloMalajlo Member Posts: 294
    Instead FldRef.VALUE := UPPERCASE(FORMAT(FldRef.VALUE... do FldRef.VALUE := 'ABCDE' ;
    (but be careful to select only one record!)
    Then you can delete, modify that record normaly.
Sign In or Register to comment.