Hi there,
I have a form that accepts information from new members of my organisation, and then has them pay a membership fee, and then I want to write that data to a membership table as a new record.
The payment process goes off to a payment site so my process is:
1. Collect data into the fields
2. Save to a staging table
3. Go to the payment gateway to collect money
4. Return to another event in the form and if payment was made read the data back from the staging table
5. Write the data to the membership table as a new record.
OK all is working up to step 4. However when the staged data is read back in, it brings in the cf_id and then when I try to do the save to the other table I can't get it to clear the cf_id. I have tried setting it to '' but it seems always to want to do an update and not save a new record.
So I am wondering if there is a trick to this that I am missing.
Cheers
Tim
I have a form that accepts information from new members of my organisation, and then has them pay a membership fee, and then I want to write that data to a membership table as a new record.
The payment process goes off to a payment site so my process is:
1. Collect data into the fields
2. Save to a staging table
3. Go to the payment gateway to collect money
4. Return to another event in the form and if payment was made read the data back from the staging table
5. Write the data to the membership table as a new record.
OK all is working up to step 4. However when the staged data is read back in, it brings in the cf_id and then when I try to do the save to the other table I can't get it to clear the cf_id. I have tried setting it to '' but it seems always to want to do an update and not save a new record.
So I am wondering if there is a trick to this that I am missing.
Cheers
Tim
Hi Tim,
Please try a Custom Code action with
I prefer to do this without the staging table by using a 'status' column in the main table - that may not work for you though.
Bob
Please try a Custom Code action with
<?php
unset($form->data['cf_id']);
?>
I prefer to do this without the staging table by using a 'status' column in the main table - that may not work for you though.
Bob
Thanks Bob,
Yes, you are quite right that there is an easier way. I can use a status column to achieve the same result. In fact since I am passing the result to another application (Salesforce) I don'r even need that. I can simply bypass the Salesforce send, in the situation where the applicant's payment fails or is cancelled.
But also, thanks for the "unset" trick, I am a real novice in php and I was not aware of it.
Thanks as always.
Tim
Yes, you are quite right that there is an easier way. I can use a status column to achieve the same result. In fact since I am passing the result to another application (Salesforce) I don'r even need that. I can simply bypass the Salesforce send, in the situation where the applicant's payment fails or is cancelled.
But also, thanks for the "unset" trick, I am a real novice in php and I was not aware of it.
Thanks as always.
Tim
This topic is locked and no more replies can be posted.
