Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function for the 'Generate Next Record Name' #237

Closed
wibeasley opened this issue Sep 11, 2018 · 0 comments
Closed

New function for the 'Generate Next Record Name' #237

wibeasley opened this issue Sep 11, 2018 · 0 comments
Assignees

Comments

@wibeasley
Copy link
Member

wibeasley commented Sep 11, 2018

it returns the next available record_id. From the documentation


Method Name
Generate Next Record Name

Description
To be used by projects with record auto-numbering enabled, this method exports the next potential record ID for a project. It generates the next record name by determining the current maximum numerical record ID and then incrementing it by one.

Note: This method does not create a new record, but merely determines what the next record name would be.

If using Data Access Groups (DAGs) in the project, this method accounts for the special formatting of the record name for users in DAGs (e.g., DAG-ID); in this case, it only assigns the next value for ID for all numbers inside a DAG. For example, if a DAG has a corresponding DAG number of 223 wherein records 223-1 and 223-2 already exist, then the next record will be 223-3 if the API user belongs to the DAG that has DAG number 223. (The DAG number is auto-assigned by REDCap for each DAG when the DAG is first created.) When generating a new record name in a DAG, the method considers all records in the entire project when determining the maximum record ID, including those that might have been originally created in that DAG but then later reassigned to another DAG.

Note: This method functions the same even for projects that do not have record auto-numbering enabled.

@wibeasley wibeasley self-assigned this Sep 11, 2018
wibeasley added a commit that referenced this issue Sep 11, 2018
wibeasley added a commit that referenced this issue Sep 12, 2018
wibeasley added a commit that referenced this issue Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant