I would like to change the effective date for some records in the Employee Rate table, I am using the following code: EmployeeRate.SETRANGE(“Effective Date”,070504D); EmployeeRate.MODIFYALL(“Effective Date”,071104D); This returns a error that says I can’t use MODIFYALL because “Effective Date” is included in the Primary Key of the Employee Rate Table. (Employee No.,Payroll Rate Code,Effective Date) Any ideas on how to modify this date.
You have to go through the records and issue a RENAME for each of them. However, do not RENAME the Record variable you are looping through, use a second Record variable. CLEAR(EmployeeRate); EmployeeRate.SETRANGE("Effective Date",070504D); IF EmployeeRate.FIND('-') THEN REPEAT EmployeeRate2 := EmployeeRate; EmployeeRate2.RENAME(EmployeeRate2."Key Field 1?",071104D,EmployeeRate2."Key Field 3?"); UNTIL EmployeeRate.NEXT = 0;
You have to check what fields make up the Primary Key of the Employee Rate Table and specify them in proper order on the RENAME statement (I can’t tell you this because I’ve never seen this Table before, I suppose it’s from the US Payroll module).
Thanks for the response, Nelson. This works perfectly. Great to have guys like you out there who are willing to help. Thanks again.
Stop it [:I] [:D] [8D] of course I would be much happier if Portugal had won the Euro 2004, but that’s life…