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

  • Suggested answer
    Alexander Ermakov Profile Picture
    28,094 on at
  • Suggested answer
    Suresh Kulla Profile Picture
    47,789 on at
    RE: RENAME primary key field

    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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans