This topic is locked
[SOLVED]

 Search value substitute

5/28/2014 1:06:16 PM
PHPRunner General questions
A
almonddgr8 author

Hello all,
I have already looked for 6 hours on somehow to find a solution to my problem. Let me put it this way:
I have a column named in_out (int), that identifies if a given record is an incoming or outgoing document; (1 = incoming & 2 = outgoing). I have already modified some to my needs like view as setting (for the list page):
if ($data["in_out"] == 1) $value = "Incoming";

if ($data["in_out"] == 2) $value = "Outgoing";
and before add/edit page events:
if ($values['in_out'] == "Incoming") $values['in_out']=1;

if ($values['in_out'] == "Outgoing") $values['in_out']=2;
and many other things, but a problem halted me in continuing.
In the way when we do a advance search panel or advance search, which btw I set them as a lookup list, so that they show Incoming and Outgoing as selection.
So there goes the problem I don't know to where to change the submitted search value and substitute it, where "Incoming" will be 1 and "Outgoing" will be 2 before the search happens.
Please help. Thanks for reading.

Sergey Kornilov admin 5/28/2014

You need to create an additional lookup table with the following content:

ID Value

---------

1 Incoming

2 Outgoing


Then setup your in_out field as a Lookup Wizard using this lookup table. Choose ID as a link field, Name as a display field. This is it.

A
almonddgr8 author 5/29/2014

Ok thanks for the reply. I'll try that.

A
almonddgr8 author 5/29/2014

Admin,
OMG, why I didn't think of that on the first place. I even don't have to bother about the before add/edit value and view as settings on the list page. Thank you very much admin.
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=74912&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />