web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

RENAME primary key field

(0) ShareShare
ReportReport
Posted on by

Hello,

         Ri8 nw I'm working on a page named 'Course'. I hv created an action named 'Modify' on page action. I hv declared two primary keys: Type(option) & Course Code(Code). But I can't modify my record by using those fields bcoz they are the part of the composite primary key. So, how can I modify records of those fields? I know that I need to use RENAME() function in the same code.So how would it be like? I wrote The following code:


Modify - OnAction()


RecCourseTable.RESET;
RecCourseTable.INIT;
IF RecCourseTable.FINDFIRST THEN
MESSAGE('record has been found')
ELSE
ERROR('record does not found in the table');

//RecCourseTable."Course Code":="Course Code";
//RecCourseTable.Type:=Type;
RecCourseTable."Course Name":="Course Name";
RecCourseTable.Duration:=Duration;
RecCourseTable.Price:=Price;
RecCourseTable."Passing Rate":="Passing Rate";
RecCourseTable.MODIFY;
MESSAGE('record has been modified successfully');

                                                     

                                                                                   Thank you,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Once again this looks like your exercise to learn, please use MSDN or search the google first and that will help you learn to self, before posting any kind of these course material questions.

    Anyhow check this link on MSDN for RENAME 

    https://msdn.microsoft.com/en-us/library/dd355313.aspx

    msdn.microsoft.com/.../dd355313.aspx

  • Suggested answer
    Alexander Ermakov Profile Picture
    28,096 on at

    Also, refer to this

    technet.microsoft.com/.../dd355313

    forum.mibuso.com/.../rename-records-on-tables

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans