<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Tag: save - Recent Posts</title>
		<link>https://legacy.forums.gravityhelp.com/tags/save</link>
		<description>Gravity Support Forums Tag: save - Recent Posts</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:18:02 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/tags/save" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "Updating an existing lead"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/updating-an-existing-lead#post-376075</link>
			<pubDate>Thu, 25 Jul 2013 09:40:58 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">376075@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the code. The issue I have with this hook is that it kind of implies that you would be able to change the $lead array and your data would be saved. I think it would create some confusion.&#60;br /&#62;
How about something more specific to your scenario? Something like &#34;gform_lead_id_pre_save&#34;, which would filter just the lead id?&#60;/p&#62;
&#60;p&#62;As you know, we are in the process of closing this forum for support, so can you please reply by submitting the &#60;a href='http://www.gravityhelp.com/request-support/' rel=&#34;nofollow&#34;&#62;support form&#60;/a&#62;? Please add a link to this topic.&#60;/p&#62;
&#60;p&#62;Cheers,
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Lowtone on "Updating an existing lead"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/updating-an-existing-lead#post-370197</link>
			<pubDate>Tue, 09 Jul 2013 04:47:21 +0000</pubDate>
			<dc:creator>Lowtone</dc:creator>
			<guid isPermaLink="false">370197@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Alex,&#60;br /&#62;
I've added the code below. The original method comes from Gravity Forms v1.7.6. I made two other modifications in this version to prevent problems with the value returned by the filter.&#60;/p&#62;
&#60;p&#62;Instead of checking the $lead value to be NULL I've made it to check if the $lead value has an ID. To do so I had to cast $lead to an array (isset($lead[&#34;id&#34;]) would have worked on any type except for objects which would have caused a fatal error for using them as an array).&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;public static function save_lead($form, &#38;amp;$lead){
    global $wpdb;

    GFCommon::log_debug(&#38;quot;Saving entry.&#38;quot;);

    if(IS_ADMIN &#38;amp;&#38;amp; !GFCommon::current_user_can_any(&#38;quot;gravityforms_edit_entries&#38;quot;))
        die(__(&#38;quot;You don&#38;#39;t have adequate permission to edit entries.&#38;quot;, &#38;quot;gravityforms&#38;quot;));

    $lead = apply_filters(&#38;quot;gform_pre_save_lead&#38;quot;, $lead);

    $lead_detail_table = self::get_lead_details_table_name();

    $lead = (array) $lead;

    //Inserting lead if null
    if(!isset($lead[&#38;quot;id&#38;quot;])) {
        global $current_user;
        $user_id = $current_user &#38;amp;&#38;amp; $current_user-&#38;gt;ID ? $current_user-&#38;gt;ID : &#38;#39;NULL&#38;#39;;

        $lead_table = RGFormsModel::get_lead_table_name();
        $user_agent = strlen($_SERVER[&#38;quot;HTTP_USER_AGENT&#38;quot;]) &#38;gt; 250 ? substr($_SERVER[&#38;quot;HTTP_USER_AGENT&#38;quot;], 0, 250) : $_SERVER[&#38;quot;HTTP_USER_AGENT&#38;quot;];
        $currency = GFCommon::get_currency();
        $wpdb-&#38;gt;query($wpdb-&#38;gt;prepare(&#38;quot;INSERT INTO $lead_table(form_id, ip, source_url, date_created, user_agent, currency, created_by) VALUES(%d, %s, %s, utc_timestamp(), %s, %s, {$user_id})&#38;quot;, $form[&#38;quot;id&#38;quot;], self::get_ip(), self::get_current_page_url(), $user_agent, $currency));

        //reading newly created lead id
        $lead_id = $wpdb-&#38;gt;insert_id;
        $lead = array(&#38;quot;id&#38;quot; =&#38;gt; $lead_id);

        GFCommon::log_debug(&#38;quot;Entry record created in the database. ID: {$lead_id}&#38;quot;);
    }

    $current_fields = $wpdb-&#38;gt;get_results($wpdb-&#38;gt;prepare(&#38;quot;SELECT id, field_number FROM $lead_detail_table WHERE lead_id=%d&#38;quot;, $lead[&#38;quot;id&#38;quot;]));
    $original_post_id = rgget(&#38;quot;post_id&#38;quot;, $lead);

    $total_field = null;
    $calculation_fields = array();
    $recalculate_total = false;

    GFCommon::log_debug(&#38;quot;Saving entry fields.&#38;quot;);

    foreach($form[&#38;quot;fields&#38;quot;] as $field){

        //Ignore fields that are marked as display only
        if(rgget(&#38;quot;displayOnly&#38;quot;, $field) &#38;amp;&#38;amp; $field[&#38;quot;type&#38;quot;] != &#38;quot;password&#38;quot;){
            continue;
        }

        //ignore pricing fields in the entry detail
        if(RG_CURRENT_VIEW == &#38;quot;entry&#38;quot; &#38;amp;&#38;amp; GFCommon::is_pricing_field($field[&#38;quot;type&#38;quot;])){
            continue;
        }

        //process total field after all fields have been saved
        if($field[&#38;quot;type&#38;quot;] == &#38;quot;total&#38;quot;){
            $total_field = $field;
            continue;
        }

        //only save fields that are not hidden (except on entry screen)
        if(RG_CURRENT_VIEW == &#38;quot;entry&#38;quot; &#124;&#124; !RGFormsModel::is_field_hidden($form, $field, array()) ){

            // process calculation fields after all fields have been saved (moved after the is hidden check)
            if( GFCommon::has_field_calculation($field) ) {
                $calculation_fields[] = $field;
                continue;
            }

            GFCommon::log_debug(&#38;quot;Saving field {$field[&#38;quot;label&#38;quot;]}&#38;quot;);

            if($field[&#38;#39;type&#38;#39;] == &#38;#39;post_category&#38;#39;)
                $field = GFCommon::add_categories_as_choices($field, &#38;#39;&#38;#39;);

            if(isset($field[&#38;quot;inputs&#38;quot;]) &#38;amp;&#38;amp; is_array($field[&#38;quot;inputs&#38;quot;])){

                foreach($field[&#38;quot;inputs&#38;quot;] as $input)
                    self::save_input($form, $field, $lead, $current_fields, $input[&#38;quot;id&#38;quot;]);
            }
            else{
                self::save_input($form, $field, $lead, $current_fields, $field[&#38;quot;id&#38;quot;]);
            }
        }
    }

    if(!empty($calculation_fields)) {
        foreach($calculation_fields as $calculation_field) {

            GFCommon::log_debug(&#38;quot;Saving calculated field {$calculation_field[&#38;quot;label&#38;quot;]}&#38;quot;);

            if(isset($calculation_field[&#38;quot;inputs&#38;quot;]) &#38;amp;&#38;amp; is_array($calculation_field[&#38;quot;inputs&#38;quot;])){
                foreach($calculation_field[&#38;quot;inputs&#38;quot;] as $input) {
                    self::save_input($form, $calculation_field, $lead, $current_fields, $input[&#38;quot;id&#38;quot;]);
                    self::refresh_lead_field_value($lead[&#38;quot;id&#38;quot;], $input[&#38;quot;id&#38;quot;]);
                }
            }
            else{
                self::save_input($form, $calculation_field, $lead, $current_fields, $calculation_field[&#38;quot;id&#38;quot;]);
                self::refresh_lead_field_value($lead[&#38;quot;id&#38;quot;], $calculation_field[&#38;quot;id&#38;quot;]);
            }

        }
        self::refresh_product_cache($form, $lead = RGFormsModel::get_lead($lead[&#38;#39;id&#38;#39;]));
    }

    //saving total field as the last field of the form.
    if($total_field) {
        GFCommon::log_debug(&#38;quot;Saving total field.&#38;quot;);
        self::save_input($form, $total_field, $lead, $current_fields, $total_field[&#38;quot;id&#38;quot;]);
    }

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Updating an existing lead"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/updating-an-existing-lead#post-368748</link>
			<pubDate>Mon, 08 Jul 2013 15:38:58 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">368748@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the suggestion. Would you mind sending me the entire save_lead() function so that I can look into adding this hook for you?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Updating an existing lead"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/updating-an-existing-lead#post-368156</link>
			<pubDate>Mon, 08 Jul 2013 10:37:45 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">368156@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have asked our developers to take a look at this and give any suggestions or opinions they may have. You are right though that updating core files is not the way to go.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Lowtone on "Updating an existing lead"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/updating-an-existing-lead#post-367962</link>
			<pubDate>Mon, 08 Jul 2013 08:41:19 +0000</pubDate>
			<dc:creator>Lowtone</dc:creator>
			<guid isPermaLink="false">367962@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;br /&#62;
I'm looking for a way to update an existing lead instead of creating a new one on each submission.&#60;/p&#62;
&#60;p&#62;Using existing action hooks I figured this would be possible using the &#34;gform_after_submission&#34; action since this is the first hook with access to the lead used for the submission. This would however require a new lead to be created (by GFFormDisplay::handle_submission()) and then using the hook to either remove the earlier lead and update the new one with the ID from the earlier lead or update the values for the earlier lead with the new ones and remove the newly created lead. Besides being a bit complicated I could imagine that the lead ID jugling might cause other problems.&#60;/p&#62;
&#60;p&#62;Another solution would require the ability to access the lead data before a new one is created. I couldn't find such a hook so I've tried it by creating my own filter in GFFormsModel::save_lead() by adding this line after line 996:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$lead = apply_filters(&#38;quot;gform_pre_save_lead&#38;quot;, $lead);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Using this filter to inject the lead ID for an existing lead into the lead data worked perfectly.&#60;/p&#62;
&#60;p&#62;Since I'm not a supporter of making modifications to existing plugins I am still wondering if I missed something and that there might be a better solution to the problem.&#60;/p&#62;
&#60;p&#62;Any suggestions?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Save and return for member users"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save-and-return-for-member-users#post-328617</link>
			<pubDate>Mon, 17 Jun 2013 09:21:44 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">328617@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for your messages. I'll make sure our development team makes a note of this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>eliza on "Save and return for member users"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save-and-return-for-member-users#post-328187</link>
			<pubDate>Mon, 17 Jun 2013 04:14:08 +0000</pubDate>
			<dc:creator>eliza</dc:creator>
			<guid isPermaLink="false">328187@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I would love this feature I used Ninja forms for a client and didn't have a good experience but like Gravity forms so would really love this incorporated into the plugin :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>DHopkins on "Update a meta form field after a form is submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/update-a-meta-form-field-after-a-form-is-submitted#post-306703</link>
			<pubDate>Thu, 06 Jun 2013 18:47:15 +0000</pubDate>
			<dc:creator>DHopkins</dc:creator>
			<guid isPermaLink="false">306703@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sorry, I'm in a rush and here is how I did it.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/8016825&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/8016825&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I would test it out on specific forms as  I needed something fast.&#60;/p&#62;
&#60;p&#62;I'm basically using Gravity Forms to do an auction and that is how I'm incrementing the rangeMin. Hopefully I'll get a chance to clean it up in a couple weeks.&#60;/p&#62;
&#60;p&#62;If anyone has better recommendations, please let me know.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>DHopkins on "Update a meta form field after a form is submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/update-a-meta-form-field-after-a-form-is-submitted#post-306651</link>
			<pubDate>Thu, 06 Jun 2013 17:58:50 +0000</pubDate>
			<dc:creator>DHopkins</dc:creator>
			<guid isPermaLink="false">306651@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm looking to update a meta form field after an entry is made. So after someone submits the form I would like to use a value in that entry to then set the rangeMin of the form.&#60;/p&#62;
&#60;p&#62;I'm looking to hook into gform_after_submission.&#60;/p&#62;
&#60;p&#62;I'm looking through the docs, but am having a difficult time finding something. Most seem to be fore the entry not the form.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jawes on "Form save issue"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-save-issue#post-296706</link>
			<pubDate>Sun, 02 Jun 2013 10:26:32 +0000</pubDate>
			<dc:creator>jawes</dc:creator>
			<guid isPermaLink="false">296706@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;New fields or duplicated fields are not added to the form after save.&#60;br /&#62;
I see an error message which says to contact support about this.&#60;br /&#62;
I am using version 1.7.5
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
