Renaming of Customer No.

Thomas_Hviid_ThornThomas_Hviid_Thorn Member Posts: 92
Hej :)

For a customer we have 2 databases (both NAV 2009, SQL 2005), one for development and one for testing.
In both databases we have the following table:
OBJECT Table 99240 Customer DSL Status Log
{
  OBJECT-PROPERTIES
  {
    Date=22-10-09;
    Time=14:37:16;
    Version List=TB023;
  }
  PROPERTIES
  {
    LookupFormID=Form96700;
    DrillDownFormID=Form96700;
  }
  FIELDS
  {
    { 1   ;   ;Customer No.        ;Code20        ;TableRelation=Customer.No.;
                                                   Editable=No }
    { 2   ;   ;Entry No.           ;Integer       ;AutoIncrement=Yes;
                                                   Editable=No }
    { 4   ;   ;PFC No.             ;Code20        ;TableRelation=IF (Progress=FILTER(Initiated|Started)) "PFC Header"."PFC Nr."
                                                                 ELSE IF (Progress=CONST(Finished)) "Posted PFC Header"."PFC Nr.";
                                                   Editable=No }
    { 5   ;   ;Type                ;Option        ;OptionString=Suspended,Resumed,Terminated;
                                                   Editable=No }
    { 6   ;   ;Who                 ;Code20        ;Editable=No }
    { 7   ;   ;When                ;DateTime      ;Editable=No }
    { 8   ;   ;Progress            ;Option        ;OptionString=Initiated,Started,Finished,On Hold,Error }
    { 9   ;   ;Automatic           ;Boolean       ;Editable=No }
    { 10  ;   ;Closed              ;Boolean        }
    { 11  ;   ;Referring Entry No. ;Integer        }
    { 100 ;   ;Case No.            ;Integer        }
  }
  KEYS
  {
    {    ;Customer No.,Entry No.                  ;Clustered=Yes }
    {    ;Type,Progress,Closed,Automatic           }
    {    ;Progress                                 }
    {    ;Entry No.                                }
  }
  FIELDGROUPS
  {
  }
  CODE
  {

    BEGIN
    {
      ****************************************************
      New Created for Deb.-Management Reminder Solution
      ****************************************************
    }
    END.
  }
}


From the customer, we got the error, that they could not rename a customer.
To make a long story short, in Development we got everything working. No problem at all renameing customers.
I out Test-database the table above shows up with an error:
The following field must be included in the table's primary key.

Field: When
Table: Customer DSL Status Log

Do anyone have an idea, what is wrong in one database, but not in the other? ](*,)
With Kind Regards
Thoms Hviid Thorn

Comments

  • JedrzejTJedrzejT Member Posts: 267
    Sound like you have diffrent Primary key in both database but use the same Rename code. Did you debug it?
    What is your code for rename?
  • Thomas_Hviid_ThornThomas_Hviid_Thorn Member Posts: 92
    Thanks for the input: but no, it's the same object in both databases!

    The rename is done by opening the Customer Card (form 21) and changing the Customer."No." field
    - as simple as can be (Numberseries is setup to allow this).

    The code on the OnRename-trigger on T18 is the same in both databases, and does not include T99240, that causes the trouble.
    With Kind Regards
    Thoms Hviid Thorn
Sign In or Register to comment.