baweld123 Posted February 22, 2017 Posted February 22, 2017 Hi guys you may have done this before but i cant find it so i was wondering if you can help. I wish to create a button that when pressed creates a new record in a portal . I then wanted to go to this new portal line and copy from the same field in the previous line to this new line and so on. I tried this and couldnt get it too work so i did this. I created fields in the customer layout with the names and serials of the equipment on that site. I then created the script to do a new portal row ( works fine) then copy from the customer field to the new portal row field . Basically im trying to duplicate the record . but with the new date. im probably going about this the wrong way hence my question. Please ignore the difference with the go to portal row last previous that was me experimenting . Thanks for help
comment Posted February 22, 2017 Posted February 22, 2017 (edited) 1 hour ago, baweld123 said: Basically im trying to duplicate the record . but with the new date. So why don't you do just that? Go to Portal Row [ Last ] Go to Portal Row [ Select; Previous ] Duplicate Record/Request Set Field [ Service::Service Date; Get ( CurrentDate ) ] This is assuming that: there are no other portals on the layout; the relationship is defined to allow creation of records in the Service table; the record you want to duplicate is shown in the last non-empty portal row. Note that if the Service Date field is defined to auto-enter the current date, you won't need the last step. --- Two unrelated notes: 1. As a general rule, you should avoid using copy/paste in your scripts, if only because it destroys the user's clipboard. 2. Your script reveals that you have numbered fields (Machine 1, Machine 2, Machine 3, etc.) fields in both tables. That's a symptom of poor structure. You should use multiple records in a related table. Edited February 22, 2017 by comment 1
baweld123 Posted February 22, 2017 Author Posted February 22, 2017 okay i take onboard what your saying ill give it a go. ill also rename the field correctly
baweld123 Posted February 22, 2017 Author Posted February 22, 2017 Hello, ok that works perfect but i must have my database setup wrong as it doesnt insert customer ID it starts a blank service but fills in all the data as required . service is connected by customer id match field . the portal is in the customer layout. Hope that makes sense
comment Posted February 22, 2017 Posted February 22, 2017 6 hours ago, baweld123 said: it doesnt insert customer ID How exactly is this field defined (in the Service table)?
Recommended Posts
This topic is 3102 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now