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
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
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