Support » Plugin: WP Data Access » Editable single record access

  • Hi,

    I’m trying to use WPDA to manage course enrolment on my school. We use a CRM inside WordPress to manage contacts. WPDA lets us extend that CRM to manage courses, classes and other student data.

    I need a way to access a single student record, to edit enrolment details. Instead of having a table with students in rows, I need that edit screen just for one student (based on an ID field in the table), to edit the data.

    Is there an easy way to do it? A shortcode with specific parameters using a variable?

    Thanks.

    Álvaro

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter Alvaro Gois dos Santos

    (@alvarogois)

    Hi Peter,

    the plugin supports primary keys over multiple columns as well and handles them transparently.

    OK, so I’m yet to understand why EDIT is not working with this table.

    If I change the URL to this:
    /wp-admin/admin.php?page=wpda&table_name=crmwp_srm_student_discount&action=search&wpda_search_column_ID=4068
    it finds the existing record.

    Any more ideas what I’m missing here?

    What if you could add an argument to your url which can be used to add a default value to any column?

    To my specific use case, I believe it would be a welcome solution to add a default value based on my CRM contact record values.

    We deal with a lot of data, as you know since you’re also managing classes and students. Everything that reduces errors within the workflow is much welcome.

    Thanks.

    Álvaro

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Alvaro,

    It looks like the edit URL is working now. Is that correct?

    You can use a similar URL to direct to your own project. Just replace the page argument:
    /wp-admin/admin.php?page=wpda_wpdp_1_8&action=edit&table_name=crmwp_zbs_contacts&ID=7676

    >>> To my specific use case, I believe it would be a welcome solution to add a default value based on my CRM contact record values.

    You can use action hook wpda_after_simple_form to do that. See:
    https://wpdataaccess.com/2020/01/29/action-hook-wpda-after-simple-form-to-add-custom-elements-to-end-of-data-entry-forms/

    This hook allows you to read data from your CRM system using PHP and overwrite specific column values using javascript. Make sure you check the page! To prevent this running on every page.

    Does this help?
    Peter

    Thread Starter Alvaro Gois dos Santos

    (@alvarogois)

    Hi Peter,

    No, I can’t get the Edit URL to work with the crmwp_srm_student_discount table. I wonder if that Primary key that combines ID field and course_id field isn’t the culprit. I’ll try with a similar table but with a unique column Primary key, that doesn’t include the related tables columns.

    Unless you have any new ideas…

    I’m going to take a look at the docs you sent me.

    Thanks.
    Álvaro

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Editable single record access’ is closed to new replies.