• Resolved macwinson

    (@macwinson)


    Hi Roland,

    I’m testing the plugin of the tutorial “Using a Custom Identifier Value for Participants Database Records”, described here:

    https://xnau.com/using-a-custom-identifier-value-for-participants-database-records/

    The plugin works fine for all the imported custom IDs. For a “static” database that will no longer need updates, are OK. But when you create a New Record, you must enter each custom ID manually (the custom ID are not created by default as the standard ID of Participants Database), and you won’t be able to access that record (the single record link will result on “No record was found” message.)
    There is any chance to modify this custom plugin to automatically add incremental new custom IDs? Or is as simple as changing the custom ID field as an “AUTO_INCREMENT” field in phpmyadmin? That will do the trick?

    Thanks for the tutorial and plugin!! It looks very useful and promising!

    Best regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Roland Barker

    (@xnau)

    The code in that tutorial is meant as a starting point for your own custom plugin that configures the plugin to use your own record ID scheme. It assumes that you have a database with your record IDs already set.

    To automate the process of adding IDs using your own scheme, you’ll need to add code that inserts the ID when a record is created. You can’t achieve this by altering the database column because the query that creates the new record is not set up to work with an additional AUTO_INCREMENT column.

    In the plugin API, there are two filters you can use to automate the process of adding an ID to a new record, the filters you would use are pdb-before_submit_add for new records added in the admin, and pdb-before_submit_signup for new records added on the frontend.

    • This reply was modified 4 years, 11 months ago by Roland Barker. Reason: added link
    Thread Starter macwinson

    (@macwinson)

    Hi Roland, sorry for the delay.
    OK, noted that. I will keep in mind the use of those filters.
    Many thanks for your kind response as usual !!!

    Best regards,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using a Custom Identifier Value’ is closed to new replies.