You would need to tell the script to go to a layout associated with the Agent Pay History table and then create a new record. Perhaps open a new window, go to the layout and then enter the information.
Im not sure how that section is supposed to work but if you are looking to have multiple entries in the payments tab you may be best served utilizing a portal?
Thank you for the reply. I am not sure I explained it properly, but I want to be able to hit "New" my cursor go right to the date section and enter in information, without leaving the screen.
I thought I need to : Go to Next Record and then have cursor Go to Date
I have a portal on the next tab that will show the commissions paid and the date paid. Simple two section portal, but that is all that is needed. I just want to creat a simple data entry section.
But I guess I am just not firing on all cylinders today.
Hope that makes more sense?
I don't think that will work, the entry fields are part of another table and if you have multiple related records than there is no way to differentiate.
You would need to be on a layout that is set to that table in order to be able to create a new record in that table.You would be better off creating a small data entry layout and have that new button launch that layout in a new window to input the information.
Make the data entry fields local to the agent information table. You can use them as temporary place holders for the data and have a "save" button that could take the information from those fields and set them as variables and you could construct a new record in the other table based on those variables and then clear the original fields so they are available for a new entry. Hope that makes sense.
One way to do this is to have the script atached to the button to the following:
1) Put the key information for the new record into variables
2) Open the record in a seperate window off screen. Change layouts to one that has the correct context for the new record.
3) Create the new record
4) Using the information in the variables set the fields to the correct value.
5) If at this point the user needs to edit the record, move the window in screen and have the desired fields on the layout.
Add a "Done Script" that commits the record and closes what has become a pop up window.