How to RENAME primary key field?

Rajat_MRajat_M Member Posts: 34
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,

Best Answer

  • swpoloswpolo Member Posts: 80
    Answer ✓
    Try this scenario
    If Record.get(Field1,Field2) THEN
    Record.rename('value1','Value2');
    Nav Upgrades and DEV outsourcing
    Reports transformation to RDLC
    List -1h , Complex List -3h, Document -4h (dev hours)
    navisionupgrade.com

Answers

  • Jan_VeenendaalJan_Veenendaal Member Posts: 206
    Same answer as yesterday:

    Check the help file from the development environment. Just search for the words as you typed them here.
    Or check msdn, start here: https://msdn.microsoft.com/en-us/library/dd355257(v=nav.90).aspx

    I think you will learn more if you find out yourself.
    Jan Veenendaal
  • swpoloswpolo Member Posts: 80
    Answer ✓
    Try this scenario
    If Record.get(Field1,Field2) THEN
    Record.rename('value1','Value2');
    Nav Upgrades and DEV outsourcing
    Reports transformation to RDLC
    List -1h , Complex List -3h, Document -4h (dev hours)
    navisionupgrade.com
Sign In or Register to comment.