# Gift Certificates search doesn't work

**URL:** <https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472>\
**Category:** V5 Question\
**Created:** [December 10, 2015, 2:26am UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472 "2015-12-10T02:26:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 2:26am UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/1 "2015-12-10T02:26:37Z")

</div>

I am following @QMcKay [tutorials](http://forum.sambapos.com/t/gift-certificate-sales-redemption/1539) for gift certificates, after entered a gift certificate name started by GC20 and entered a balance, when i am searching at the “Gift Certificates” Entity screen i could not found a match for the gift certificate that i have entered before

 ![](https://forum.sambapos.com/uploads/default/original/3X/0/a/0ac11d2720ad123534d739aeac0234c05657a06d.gif)

My Gift Certificates Entity screen :

 ![](https://forum.sambapos.com/uploads/default/original/3X/2/b/2b9df167c3224c6aa22d3cbc4cf17934225ee8e6.png)  
 ![](https://forum.sambapos.com/uploads/default/original/3X/5/3/539f5c338bb56f75eb49ef890bfed3470fdd7a9e.png)

The created Gift Certficates already appear when iam restarting sambapos :

 ![](https://forum.sambapos.com/uploads/default/original/3X/0/c/0c6c84ad095209e2bf21407871069d04f32ed03c.png)

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 9:41am UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/2 "2015-12-10T09:41:46Z")

</div>

Purchasing Gift Certificate through a ticket also doesn’t create automatically the Gift Certificate and yet also not searchable nor an entity is created.

Looks like “RU GC Purchased & Printed” doesn’t get called when a customer purchased Gift Certificate through a ticket because there is no file created or updated eventough i have setup “AC GC Add Line to Text File”

My “RU GC Purchased & Printed” :

 ![](https://forum.sambapos.com/uploads/default/original/3X/c/5/c5176ccccef80642fc593f6481a5c0f43c72d5ec.png)

My “AC GC Create” :

 ![](https://forum.sambapos.com/uploads/default/original/3X/2/7/275843bd2ab99716e67142c0e5ff2cdc142dbdb6.png)

---

<div class="post-metadata">

**Author:** ![gsreddy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/g/e9c0ed/32.png) [@gsreddy](https://forum.sambapos.com/u/gsreddy)\
**Post date:** [December 10, 2015, 10:31am UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/3 "2015-12-10T10:31:42Z")

</div>

I think the GC number you entered is dummy .are you creating a gc from menu? do you have a product called gift certificate?if so try to add and settle the payment try that way the GC number will create automatically , not sure if you can create a gc from the entity screen as you showed.

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 10:54am UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/4 "2015-12-10T10:54:54Z")

</div>

gsreddy,

Yes, what i have meant by through a ticket is ordered a Gift Certificate through the Tables, added gift certificate, change price to the amount that i wanted for gift certificate balance, and settled, but still there is no gift certificate entity automatically created, thus making it not searchable as from my understanding “Purchased” GCStatus only available through manual purchasing through settled ticket.

I have re-followed the tutorial dosen of times, but still cannot figuring out on why the gift certificate doesn’t automatically created.

Other question is how to make Gift Certificates manually through the entity screen?

[Edit]  
“RU GC Purchased & Printed” never get called because when ordering a gift certificate, it never reaches “Order State Updated” (found out using Rule Debugger), eventough ticket has reached settled.

 ![](https://forum.sambapos.com/uploads/default/original/3X/1/7/17a78accc7e0b722821af2a0835a8adf4eacae15.png)  
@QMcKay  
What is the correct way ordering a gift certificate?, so “Order State Updated” get called.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 1:20pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/5 "2015-12-10T13:20:13Z")

</div>

You buy a GC as a Product. You don’t create them manually.

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 1:30pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/6 "2015-12-10T13:30:35Z")

</div>

@QMcKay  
I already did buy it through a ticket and settled but the gift certificate entity still did not get created.

I am on V5.56 if it’s make any differences, from my rule debugging somehow “Order State Updated” doesn’t get called when buying through a ticket.

 ![](https://forum.sambapos.com/uploads/default/original/3X/e/b/ebb5727776a9f471daff568d5a03950a77829bf3.gif)

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 1:31pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/7 "2015-12-10T13:31:44Z")

</div>

I just tested GC Pruchase (v5.1.56) and it works fine.

Check this Action and Rule…

 ![](https://forum.sambapos.com/uploads/default/original/3X/9/8/98f4a30dcb4e83df61fba62ce5a3d79015d7b45d.png)

If you want to issue a GC without taking payment for it, you can add an automation command button for this and add this Rule…

 ![](https://forum.sambapos.com/uploads/default/original/3X/6/f/6f6d7761b0bf29638996e02b8313c6ed6721a1c5.png)

> ##GC Manual Create##

| **Rule Name:** | `GC Manual Create` |
| **Event Name:** | `Automation Command Executed` |

_Custom Constraint List:_

| **Execute Rule if:** | `Matches` |

| `Automation Command Name` | **_Equal_** | `GC Manual Create` |

##Actions:##

> **GC Update Order State**
>
> **Constraint:** _(none)_
> 
> | **Current State:** | `Ordered` |
> | **State:** | `Printed` |

* * *

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 1:39pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/8 "2015-12-10T13:39:05Z")

</div>

@QMcKay  
Re-Checked “RU GC Update Order States” rule, yes it’s the same as instructed on the tutorial.

Already followed your tutorial on “GC Manual Create” in the original thread but still no gift certificate entity being created ☹.

Do you want my database dumps?.

---

<div class="post-metadata">

**Author:** ![pauln](https://forum.sambapos.com/user_avatar/forum.sambapos.com/pauln/32/12698_2.png) [@pauln](https://forum.sambapos.com/u/pauln)\
**Post date:** [December 10, 2015, 1:49pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/9 "2015-12-10T13:49:53Z")

</div>

Hey Q - I scanned over that early V4 Tutorial and there is no Primary Key Defined? Is that correct… just saying?  
Tutorial back in John’s days.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 1:53pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/10 "2015-12-10T13:53:04Z")

</div>

What does this Rule look like?

![](https://forum.sambapos.com/uploads/default/original/3X/b/0/b096cf0996d328f14049fbe8f54bf0ef8e09023b.png)

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 1:56pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/11 "2015-12-10T13:56:34Z")

</div>

> [@pauln](#):
>
> there is no Primary Key Defined? Is that correct… just saying?

Not necessary.

 ![](https://forum.sambapos.com/uploads/default/original/3X/f/0/f0a6fa556bd44ee83eb40254316c494e32315bdf.png)

![](https://forum.sambapos.com/uploads/default/original/3X/2/e/2e9498d28c32b56925bd263457e93f02a310c7ad.png)

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 2:11pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/12 "2015-12-10T14:11:33Z")

</div>

@QMcKay  
Here we go :

 ![](https://forum.sambapos.com/uploads/default/original/3X/0/1/01dc80562ae630e5a86e8dec8f8385878db1b3f6.png)

Changing “Menu Item Name” Equals “Gift Certificate” also still doesn’t work ☹.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 2:21pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/13 "2015-12-10T14:21:54Z")

</div>

If you added the manual create button, show what happens when you click that button… we should see the Order State change from Ordered to Printed.

When that happens, it should trigger the event for Order State Updated (GC Purchased & Printed), which is where the GC Entity and Account are created…

 ![](https://forum.sambapos.com/uploads/default/original/3X/0/f/0fb126184728968552598505fa5ca04ce14356dd.png)

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 2:36pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/14 "2015-12-10T14:36:30Z")

</div>

@QMcKay  
It doing nothing, after clicked “GC Create” on the Gift Certificate, the button will disappear after clicked the button :

 ![](https://forum.sambapos.com/uploads/default/original/3X/4/d/4d34412fc6e6a51335acc83d948999304e2ab327.gif)

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 2:42pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/15 "2015-12-10T14:42:03Z")

</div>

It looks like the state is being updated properly. But for some reason, the Entity and Account are not being created. Is the Rule not firing?

In the Rule for GC Purchased & Printed, add a Show Message Action to the top of the Rule, and put this in there:

`DT:[=Helper.GetUniqueString()] P:[=Order.Price]`

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 2:46pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/16 "2015-12-10T14:46:30Z")

</div>

@QMcKay  
The Show Message Action never get displayed, i have debugged the rules, and it seems somehow it never reaches “Order State Updated”, so “RU GC Purchased & Printed” never get executed ☹.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 2:50pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/17 "2015-12-10T14:50:48Z")

</div>

Need to find the reason that Rule does not fire. Either the State Name (Certificate) does not match, or the State (Printed) does not match. It needs to match both for the Rule to fire.

Show your Action for GC Update Order State.

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 2:53pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/18 "2015-12-10T14:53:42Z")

</div>

@QMcKay  
Exactly, Here is it :  
 ![](https://forum.sambapos.com/uploads/default/original/3X/8/c/8c87b016cf0e11fa7fa8d7ae24cc3c3f17626b7c.png)

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 3:01pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/19 "2015-12-10T15:01:51Z")

</div>

:stumped:

Something is stuck. You might need to recreate the Rule from scratch (not cloned).

Try creating a new Rule containing only the Show message action, and set up the same constraints as this:

 ![](https://forum.sambapos.com/uploads/default/original/3X/7/a/7af3324ac61318c4add3d1a6d6dbb990dc26508a.png)

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 10, 2015, 3:23pm UTC](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472/20 "2015-12-10T15:23:41Z")

</div>

@QMcKay  
Doh 😱, After re-created the rules and found out there is a blank space both in-front “State Name” Equal and “State” Equal, sorry for the false alarm!. Really thanks for spending your valuable time debugging it 😂.

Is there anyway to create gift certificate through the entity screen?

[Next page](https://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472.md?page=2)
