# RTC

**URL:** <https://www.dynamicsuser.net/t/rtc/32798>\
**Category:** Developers Forum\
**Created:** [September 10, 2011, 12:13pm UTC](https://www.dynamicsuser.net/t/rtc/32798 "2011-09-10T12:13:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sivaramakrishna](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Sivaramakrishna](https://www.dynamicsuser.net/u/Sivaramakrishna)\
**Post date:** [September 10, 2011, 12:13pm UTC](https://www.dynamicsuser.net/t/rtc/32798/1 "2011-09-10T12:13:00Z")

</div>

hi Every One

i am New In RTC . my problem is Rename the Primary Keys with RENAME Function. but it is Not Working In RTC.

Error is Occurred in RTC

Error is :The number of field arguments does not match the primary key size.

Please help me.

---

<div class="post-metadata">

**Author:** ![Jinnis](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@Jinnis](https://www.dynamicsuser.net/u/Jinnis)\
**Post date:** [September 10, 2011, 1:21pm UTC](https://www.dynamicsuser.net/t/rtc/32798/2 "2011-09-10T13:21:41Z")

</div>

Does it really work in classic client?

It sounds as if you try to rename a record that has several fields in the primary key but you only give a few of the values.

For example Table 36 Sales Header has primary key Document type and No. To rename a record in this table you should have the active record in a record variable and then call Rename with values for all fields in primary key.

SH.RENAME(SH.“Document Type”::Order, ‘SO100000’); would rename the active record in variable SH.

Of what i know there should be no difference in this between Classic and RTC (Since code is written for this in C/Side inside Classic Client)

If you still have problem give us the code you have written to rename the record.

/Jinnis

---

<div class="post-metadata">

**Author:** ![mohana\_cse06](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mohana\_cse06](https://www.dynamicsuser.net/u/mohana_cse06)\
**Post date:** [September 10, 2011, 4:10pm UTC](https://www.dynamicsuser.net/t/rtc/32798/3 "2011-09-10T16:10:14Z")

</div>

Can you show us the code? and primary key of the table?

---

<div class="post-metadata">

**Author:** ![krupashah](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@krupashah](https://www.dynamicsuser.net/u/krupashah)\
**Post date:** [November 15, 2016, 7:23am UTC](https://www.dynamicsuser.net/t/rtc/32798/4 "2016-11-15T07:23:49Z")

</div>

i am also having the same problem that mentioned earlier can u please exlain briefly

---

<div class="post-metadata">

**Author:** ![amol\_salvi](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@amol\_salvi](https://www.dynamicsuser.net/u/amol_salvi)\
**Post date:** [November 15, 2016, 7:39am UTC](https://www.dynamicsuser.net/t/rtc/32798/5 "2016-11-15T07:39:47Z")

</div>

Check the code as well as check whether you are using all primary key fields during modificaiton

---

<div class="post-metadata">

**Author:** ![krupashah](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@krupashah](https://www.dynamicsuser.net/u/krupashah)\
**Post date:** [November 15, 2016, 7:51am UTC](https://www.dynamicsuser.net/t/rtc/32798/6 "2016-11-15T07:51:50Z")

</div>

here is my code  
where old value is the existance doc no  
and new value is the value that is to be rename

SalesInvoiceHeader.RESET;  
SalesInvoiceHeader.SETRANGE(SalesInvoiceHeader.“No.”,OldValue\_gTxt);  
IF SalesInvoiceHeader.FINDFIRST THEN BEGIN  
MESSAGE(‘ok’);  
SalesInvoiceHeader.“No.” := NewValue\_gTxt;  
SalesInvoiceHeader.RENAME(SalesInvoiceHeader.“No.”,NewValue\_gTxt);  
MESSAGE(‘done’);  
END;

---

<div class="post-metadata">

**Author:** ![krupashah](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@krupashah](https://www.dynamicsuser.net/u/krupashah)\
**Post date:** [November 15, 2016, 9:43am UTC](https://www.dynamicsuser.net/t/rtc/32798/7 "2016-11-15T09:43:59Z")

</div>

finally i got the solution i table field is primary key than always use rename instead of modify

SalesInvoiceHeader.RESET;  
SalesInvoiceHeader.GET(OldValue\_gTxt);  
SalesInvoiceHeader.RENAME(NewValue\_gTxt);
