I wanna add a new record in portal, to be productive, hoping copy previous records in portal, how to do?
You need to write a script that captures the values from the previous record, store them as variables, then create the new record and populate the relevant fields with the values you stored in the varibles.
You can also make a carbon copy of the previous record by duplicating it and then either clear or edit any of the fields you want to have different values from the previous record.
auto-enter calculations using getNthRecord can also be used to copy from the previous record.
Yea, I'm thinking about using getNthRecord(), could you give me an simple example how to script it?
The following works as an auto-enter calculation. It will not work in a script step:
For "FieldA", you might set up the following to copy the value of "fieldA" from the previous record:
Let ( R = Get ( RecordNumber ) ; If ( R > 1 ; GetNthRecord ( FieldA ; R - 1 ) ) )
In a script, Get ( RecordNumber ) returns the record number of the layout's record, not the portal row.
If you're not familiar with scripting in general then philmodjunk had a better suggestion and use the auto fill feature. You can reach that under manage database.
If you use an auto enter calc keep in mind that it is always going to fire anytime you create a new row in a portal. Using a script would probably give you a little more flexibility. I've attached a sample file that will allow you to copy from any portal row to a new row. Another option is you can also use your keyboard to copy from the last visited row. Ctrl + ' (Win) or Cmd + ' (Mac)
Very useful sample and shortcut, thank you for your help!
Retrieving data ...