Issue with Search

Issue with Search

  
I am trying to fix the issues with my search. It says that their is incompatible data types:('Pawn Identifier', 'Text').

The First line is:
Pawn.Ticket like "%" + SearchKeyword + "%" or

and the next one that give me that same issue is,expet that it is ('Customer Identifier', 'Text'):

Pawn.SSN like "%" + SearchKeyword + "%"

Thanks for any Help that you could provide.

Seems like "SearchKeyword" is of type "Pawn Identifier".

J.Ja

I have tried adding a condition, but the last statment seems to be fine, but the first changed the error:

Pawn.Ticket like SearchKeyword "%" + SearchKeyword + "%" or


I will upload my .oml so you could see a little bit better of the issue.
Michael -

* Pawn.SSN is NOT a "Social Security Number", it is a reference to the "Customers" entity, which is why "like" won't work on it.
* Customers.SSN is NOT a "Social Security Number" either, it is a reference to the "Menu Items" entity, which is why "like" won't work on it.
* Pawn.Ticket is the ID for the Pawn entity, not a ticket number than users can (or if they *can*, *should*) actually edit or enter. To search on it, you need to use "EntityRefIntegerToInteger(Pawn.Ticket) = SearchKeyword".
* The "Items" entity has no reference to "Pawn" or "Customers", so the GetItemsById query is going to make a cross join and deliver the wrong results.

My suggestion is to take a little bit of time and get your entities and attributes straightened out. You never want users generating the IDs for your entities, for example, so if you want the users entering in the ticket number, rename the "Ticket" attribute of "Pawn" to be "Id" again, and create a separate "Ticket" attribute for the user to type into. Look at the relationship between "Items" and "Customers" and "Pawn" and put in the proper reference as needed. Get your "SSN" fields fixed; for one thing, SSN is *definitely* user supplied data, so it should *not* by the ID field for "Customers". Secondly, you want to tie "Customers" to "Pawn" by the Customer.Id, not Customer.SSN. And fix the "SSN" in "Customers" so that it is an actual field, not a reference to the MenuItem entity.

Hope this helps!

J.Ja