February 10, 200916 yr I need a button to perform a task. I want it to create a new record but only have the content from a single field from the previous record be populated. It must be done from a button. Any advice on the way to accomplish this?
February 10, 200916 yr Where is the button, on every record? If so, you need to track the previous recordID. Will your user be creating a new record from any record or just the last record entered? Just a simple script if it is from the last record input: Go to layout (Layoutname) Sort Records Go to Record/Request (Last) Set Variable($Field; Field to be copied) New Record/Request Set Field(CopiedField,$Field) The problem is if the user clicks the button on a record that is not the last record input you're getting the wrong data. You could put in a trap: Go to layout (Layoutname) Set Variable($ID; RecordID Enter Find() Set Field(RecordID; $ID+1 Perform Find() If(Get(Foundcount)>=1 Show Custom Dialog(You cannot create a new record from the current record displayed.) Exit Script EndIf Sort Records Go to Record/Request (Last) Set Variable($Field; Field to be copied) New Record/Request Set Field(CopiedField,$Field) I haven't tried the script so it probably needs a little tweaking. I'm also sure someone else will have a much more elegant approach, but, I think this will work for you.
February 10, 200916 yr Author The button is used to create a new record that will end up being related by the field "Location" and the field I need filled automatically is the "case number" so if there are 5 different locations in the same case number, as you push the button you will create a new record with the case number being the same as the one you click the button from, but the other fields are blank. I will try to tweek this script and see if it does it. I thank you fir this, I was drawing a blank..lol
March 6, 200916 yr If my reply seems 1) too obvious and 2) wrong, then I've simply misunderstood what you said. There is an Auto-Enter field Option, "Value from previous record". Wouldn't that give you what you want? (In Scripts, it's under Fields - "Insert from last record"). As I say, I may have misunderstood what you asked.
March 6, 200916 yr "...related by the field 'Location' " say, it isn't so? I suggest using Location IDs. "..so if there are 5 different locations in the same case number" why aren't locations a portal off the case entry form related by CaseID? Edited March 6, 200916 yr by Guest
Create an account or sign in to comment