Tell us what you are trying to do?
i am using Gravity Forms Post Creation to create a child post but can't get them to connect to parent.
Is there any documentation that you are following?
https://toolset.com/forums/topic/custom-field-for-relationship-using-gravity-forms-post-creation/
here is the code i used.
// Growth indicator to Company Relationship From GF Form Submit
add_filter( 'gform_advancedpostcreation_post_after_creation_6', 'apc_toolset_setparent', 10, 4 );
function apc_toolset_setparent( $post_id, $feed, $entry, $form ) {
toolset_connect_posts( 'customer-cut-order', $entry[9], $post_id );
}
Is there a similar example that we can see?
What is the link to your site?
hidden link
Hi,
Thank you for contacting us and I'd be happy to assist.
I've checked the form link that you shared and noticed that the field "Parent_post" is empty. Can you please test if the code for the relationship works, if you fill the value "600" in that field and then submit the form?
If it works, it would mean that the custom code is working as expected and you'll just need to pre-fill the value in the "Parent_post" field from the URL parameter "parent_post".
( ref: hidden link )
regards,
Waqar
Sorry I made changes to my page. Here is the correct address
hidden link
Still not working.
Thanks for writing back.
To troubleshoot this, I'll need to see how this relationship and the form are set up in the admin area.
Can you please share temporary admin login details, in reply to this message? I'll also need your permission to download a clone/snapshot of the website, in case it needs to be investigated on a different server.
Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.
The user access details work, but this user doesn't seem to have the "administrator" role.
Please change the role of this user to "administrator", so that I can access the website's important sections and settings.
sorry that was my fault. I have updated the user permission.
Thank you for enabling the admin access.
I noticed that the relationship slug used on your website is "company-growth-indicator-set", but in the custom code "customer-cut-order" is being used.
Please replace it with the correct slug and it should work:
// Growth indicator to Company Relationship From GF Form Submit
add_filter( 'gform_advancedpostcreation_post_after_creation_6', 'apc_toolset_setparent', 10, 4 );
function apc_toolset_setparent( $post_id, $feed, $entry, $form ) {
toolset_connect_posts( 'company-growth-indicator-set', $entry[9], $post_id );
}
Note: The example link that you shared uses the value "600" for the URL parameter "c_nameid". But there is no "Company" post with the ID '600' on the website. Please make sure that in the URL parameter, you use the ID of a correct and existing company post.
My issue is resolved now. Thank you!