4 Replies Latest reply on Jul 9, 2012 8:39 PM by BruceHerbach

    New Record Script


      Okay, I know my brain just isn't working but what I am trying to do is to create a "New" button in a tabbed section of the data base.


      See attached Picture.

      Agent Record copy.jpg


      The one section is where I will be adding in an Agent's commission, but I don't want the button to give me a "New" Agent record, I just want to be able to create a new record within the specific table. In this case: Agent Pay History table.


      For some reason I have tried scripting and also doing a simple set up of the button, but I always seem to be getting a screen that shows I am entering in an entirely new agent. When I want to do is enter in a new pay record for the particular agent I have on the screen.


      Thanks for the help,



        • 1. Re: New Record Script

          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?

          • 2. Re: New Record Script



            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?



            • 3. Re: New Record Script

              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.


              Another option:

              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.



              • 4. Re: New Record Script

                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.