Renaming record

SamsonSamson Member Posts: 42
Hi all,
I have created new table with following fields

FIELDS
{
{ 10 ; ;Customer No. ;Code20
;TableRelation=Customer }
{ 20 ; ;CRM Company Contact No.;Code20
;TableRelation=Contact }
{ 30 ; ;Type ;Option
;OptionCaptionML=ENU=" ,AE,AM,Buyer";
OptionString=[
,AE,AM,Buyer] }
{ 40 ; ;Global Dimension 1 Code;Code20
;TableRelation="Dimension Value".Code WHERE (Global Dimension
No.=CONST(1));
CaptionClass='1,1,1'


}


{ 50 ; ;Code ;Code10
;TableRelation=Salesperson/Purchaser.Code WHERE (Type=FIELD(Type)) }
{ 60 ; ;Name ;Text30
;FieldClass=FlowField;

CalcFormula=Lookup(Salesperson/Purchaser.Name WHERE (Code=FIELD(Code)))



}


and with following Primary Key
{Customer No.,CRM Company Contact No.,Type,Global Dimension 1
Code,Code}

I have existing records with blank in field "Code"
When I want to change value of Code Field from blank to other(for ex.
JR) I have got confirmation message Do you want to Rename record? , and
when I select Yes following Error message is appear


###################################################
Microsoft Business Solutions-Navision
You cannot rename a record because the old value of the field below is
'',


Field: Code
Table: Salesperson Assignment by Vendare Company


OK
###################################################


Any assistance?


Thanks,
Samson

Comments

  • ara3nara3n Member Posts: 9,257
    You have to write a routine that deletes the record and inserts with the correct info. Or do it manually. Delete the record and insert again.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SamsonSamson Member Posts: 42
    I knew about delete-insert, but not wanted to use that way.

    BUT now as there isn't any other way, necessarily I'll be use delete/insert

    Thanks for your helps.

    Samson
  • thaugthaug Member Posts: 106
    Assuming this is a one time thing, I can see two possible scenarios:

    Depending on how many records you have, you could set this up as a dataport, export the recs, work on them outside of Navision, and import back to the table (after deleting the recs that you exported).

    You could also create another field called EntryNo, fill it in with a unique integer for each record, then change the primary key for the table to EntryNo, make your changes, set the primary key back to the default, and delete and remove the EntryNo field.
    There is no data, only bool!
Sign In or Register to comment.