<?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 User Favorites: kadamwhite</title>
		<link><a href='https://legacy.forums.gravityhelp.com/profile/kadamwhite'>kadamwhite</a></link>
		<description>Gravity Support Forums User Favorites: kadamwhite</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 06:33:16 +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/profile/" rel="self" type="application/rss+xml" />

		<item>
			<title>Gil Namur on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-152375</link>
			<pubDate>Fri, 22 Feb 2013 12:09:22 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">152375@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi drawonline.&#60;/p&#62;
&#60;p&#62;This works perfectly!&#60;br /&#62;
Thank YOU!!!!! &#60;/p&#62;
&#60;p&#62;Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-151741</link>
			<pubDate>Thu, 21 Feb 2013 15:26:06 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">151741@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi drawonline :-)&#60;/p&#62;
&#60;p&#62;THANKS! I will try this today.&#60;br /&#62;
Just to be clear on the cases. If I only have 2 cases, do I need the  print_r('aaa');&#60;br /&#62;
statement before the last break? Like this below.&#60;/p&#62;
&#60;p&#62;case 1: //form ID&#60;br /&#62;
$uuid['field_id'] = 8; //field ID on the form&#60;br /&#62;
break;&#60;br /&#62;
case 2: //form ID&#60;br /&#62;
$uuid['field_id'] = 8; //field ID on the form&#60;br /&#62;
print_r('aaa');&#60;br /&#62;
break;&#60;/p&#62;
&#60;p&#62;Thanks and cheers,&#60;/p&#62;
&#60;p&#62;Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>drawonline on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-151432</link>
			<pubDate>Thu, 21 Feb 2013 07:15:22 +0000</pubDate>
			<dc:creator>drawonline</dc:creator>
			<guid isPermaLink="false">151432@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Gil,&#60;/p&#62;
&#60;p&#62; Sorry took long to respond&#60;/p&#62;
&#60;p&#62;here is the full code i had and its working.&#60;/p&#62;
&#60;p&#62;the problem is need to do the switch code inside the do while loop&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_pre_render&#38;quot;, &#38;quot;process_unique&#38;quot;);
function process_unique($form) {
    global $uuid;
    $uuid[&#38;#39;form_id&#38;#39;] = $form[&#38;#39;id&#38;#39;];

	switch($form[&#38;#39;id&#38;#39;]) {
	case 6:							//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 60;		//field ID on the form
        break;
	case 14:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 158;	//field ID on the form
        break;
	case 12:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 158;	//field ID on the form
        break;
    case 11:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 34;		//field ID on the form
        break;

    case 13:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 28;		//field ID on the form
        break;

	case 16:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 2;		//field ID on the form
        break;

    case 10:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 49;		//field ID on the form
        break;
    case 4:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 30;		//field ID on the form
        break;

    case 1:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 34;		//field ID on the form
        break;
	case 5:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 49;		//field ID on the form
        break;
	case 7:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 60;		//field ID on the form
        break;
	case 8:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 33;		//field ID on the form
        break;
	case 3:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 29;		//field ID on the form
        break;
	case 2:						//form ID
        $uuid[&#38;#39;field_id&#38;#39;] = 5;		//field ID on the form
		print_r(&#38;#39;aaa&#38;#39;);
        break;

    }

    add_filter(&#38;quot;gform_field_value_uuid&#38;quot;, &#38;quot;get_unique&#38;quot;);
    return $form;
}

function get_unique(){
    global $uuid;

	$form_id = $uuid[&#38;#39;form_id&#38;#39;];
    $field_id = $uuid[&#38;#39;field_id&#38;#39;];

	global $wpdb;

    do {
		$formid = $form_id; //get ID of the form

		    switch($form_id) {

			case 6:
				$prefixs = &#38;quot;FOHSRF # - &#38;quot;;	//prefixs for different forms
				break;
			case 14:
				$prefixs = &#38;quot;VSRF # - &#38;quot;;		//prefixs for different forms
				break;
			case 12:
				$prefixs = &#38;quot;VSRF # - &#38;quot;;		//prefixs for different forms
				break;
			case 11:
				$prefixs = &#38;quot;VSDEIF # - &#38;quot;;	//prefixs for different forms
				//print_r($prefixs);
				break;
			case 13:
				$prefixs = &#38;quot;FOHSRLR # - &#38;quot;;	//prefixs for different forms
				break;
			case 10:
				$prefixs = &#38;quot;SMRF # - &#38;quot;;	//prefixs for different forms
				break;
			case 4:
				$prefixs = &#38;quot;VTTCF # - &#38;quot;;	//prefixs for different forms
				break;
			case 1:
				$prefixs = &#38;quot;EHF # - &#38;quot;;	//prefixs for different forms
				break;
			case 5:
				$prefixs = &#38;quot;ELA # - &#38;quot;;	//prefixs for different forms
				break;
			case 7:
				$prefixs = &#38;quot;IRF # - &#38;quot;;	//prefixs for different forms
				break;
			case 8:
				$prefixs = &#38;quot;SIF # - &#38;quot;;	//prefixs for different forms
				break;
			case 3:
				$prefixs = &#38;quot;RIF # - &#38;quot;;	//prefixs for different forms
				break;

			case 16:
				$prefixs = &#38;quot;GHIRA # - &#38;quot;;	//prefixs for different forms

				break;
			case 2:
				$prefixs = &#38;quot;CSF wewwe# - &#38;quot;;	//prefix for different forms
				break;

			}
		$tables = $wpdb-&#38;gt;prefix . &#38;#39;rg_lead&#38;#39;;
		$form_count = $wpdb-&#38;gt;get_var(&#38;quot;SELECT COUNT(*) FROM $tables WHERE form_id = &#38;#39;$formid&#38;#39;&#38;quot;);
		//$date = date(&#38;quot;d/m/Y&#38;quot;);
		//$form_count = RGFormsModel::get_form_counts($formid);

        $unique = $form_count + 1; // count of the lead form entries incremented by one
		$unique = str_pad($unique, 3, &#38;#39;0&#38;#39;, STR_PAD_LEFT); // padding for number format 001,002...015 so 3 digit number format
		$date = date(&#38;#39;m-d-Y&#38;#39;);

		//print_r($date);
        $unique = $prefixs . $unique . &#38;#39; - &#38;#39; . $date; // prefixs and the unique number	//	

    } while (!check_unique($unique, $form_id, $field_id));
	//print_r($unique);
    return $unique;
}

function check_unique($unique, $form_id, $field_id) {
    global $wpdb;

    $table = $wpdb-&#38;gt;prefix . &#38;#39;rg_lead_detail&#38;#39;;
    $result = $wpdb-&#38;gt;get_var(&#38;quot;SELECT value FROM $table WHERE form_id = &#38;#39;$form_id&#38;#39; AND field_number = &#38;#39;$field_id&#38;#39; AND value = &#38;#39;$unique&#38;#39;&#38;quot;);

    if(empty($result))
        return true;

    return false;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-150328</link>
			<pubDate>Tue, 19 Feb 2013 14:10:19 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">150328@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Chris,&#60;br /&#62;
I DID try that code. Exactly as you have it there. ( I referred to it as the last bit of code).&#60;br /&#62;
It returns a prefix, but no number. I just tried it again. Same result.&#60;br /&#62;
I am assuming that all I need to enter in the hidden field for Parameter Name is uuid - correct?&#60;br /&#62;
Cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-150305</link>
			<pubDate>Tue, 19 Feb 2013 13:30:34 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">150305@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Gil, I revised the code a little bit later in that topic:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/send-confirmation-number#post-145509&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/send-confirmation-number#post-145509&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The $prefix was not working correctly, so I hard coded it.  Please try this code.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-150267</link>
			<pubDate>Tue, 19 Feb 2013 12:59:53 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">150267@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Chris,&#60;br /&#62;
Further to my note yesterday - using the code you have at - &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/send-confirmation-number#post-145386&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/send-confirmation-number#post-145386&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;If I use your fist example, it faithfully returns a number, but no prefix.&#60;br /&#62;
If I use the last bit of code in that thread, it returns the prefix, but no number.&#60;br /&#62;
Just doing this on one form, using your exact code.&#60;br /&#62;
Cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-149415</link>
			<pubDate>Mon, 18 Feb 2013 14:05:56 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">149415@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Chris,&#60;br /&#62;
Indeed ... one prefix (which becomes part of a unique PO#) for each form.&#60;br /&#62;
Order Form 1 - PayPal sales) prefix PP-#####&#60;br /&#62;
Order From 2 - COD sales) prefix COD-#####&#60;br /&#62;
etc&#60;br /&#62;
I thought that if I used the code you show here - &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/send-confirmation-number#post-145386&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/send-confirmation-number#post-145386&#60;/a&#62; - and used uuid as the parameter for form 1 and uuid2 as the parameter for form 2 that would get me there?&#60;br /&#62;
Cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-149385</link>
			<pubDate>Mon, 18 Feb 2013 13:26:25 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">149385@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That approach would populate a different parameter in the same form, the parameter names uuid2.  Is that what you want, or do you want a one prefix tied to one form, and each prefix will be different (one prefix for each form)?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Gil Namur on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-149370</link>
			<pubDate>Mon, 18 Feb 2013 12:49:47 +0000</pubDate>
			<dc:creator>Gil Namur</dc:creator>
			<guid isPermaLink="false">149370@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Chris,&#60;/p&#62;
&#60;p&#62;Nope. I'm stuck. Mind you, I have had a plethora of other things to do as well.&#60;br /&#62;
Will leave you a question at the post you pointed me to. Oh wait! I cant ... it's closed.&#60;br /&#62;
Question is - as you know I need multiple prefixes.&#60;br /&#62;
If i added a second filter - same code but changed the value to uuid2 and then changed the prefix, would that work? (gform_field_value_uuid2)&#60;br /&#62;
THANKS and cheers,&#60;br /&#62;
Gil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Unique reference number for submissions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/unique-reference-number-for-submissions#post-148206</link>
			<pubDate>Sun, 17 Feb 2013 01:58:17 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">148206@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Did you make any more progress with this Gil?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
