AnsweredAssumed Answered

Script to duplicate current portal row and then set cursor in specific field

Question asked by vicioustruth on Mar 8, 2010
Latest reply on Mar 8, 2010 by JoshO.

Title

Script to duplicate current portal row and then set cursor in specific field

Post

I have 3 tables: SoldJobs, Labor, and Employees.

These 3 tables are related:

 

SoldJobs----------->(Allow/Delete)Labor<----------------Employees

 

On the SoldJobs layout, I have a portal using the SoldJobs_Labor relationship. 

The portal fields are as follows:

 

Date - EmployeeID - EmployeeName - HourlyRate - Hours - TotalLaborCost - CostedTo

 

When the user enters data in this portal, most of the time there will be quite a few rows where only the date and hours data will change. 

 

I want to create a scripted button that does the following: 

 

Duplicate highlighted portal row

In the newly created row, I'd like to delete the data in the Hours field, and then set the cursor so that the user can type in new data into the Hours field. 

 

Currently, my script looks like this:

Go To Portal Row [Next] (Select Entire Contents)

Duplicate Record/Request

 

When I run the script, it creates a new portal row, but all the fields are blank.... 

 

Where have I gone astray?

Outcomes