Lookup field Add page filter

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
covecove1
User
Posts: 3

Lookup field Add page filter

Post by covecove1 »

Hello,

I am trying to hide options from select list which are already present in that table,
and it's working fine:

Filter:
"f_function(`id`) = 0"

However,
that filter hides name in List page and I can only see ID in that column.

When I try to use function only on add page it's not working:

CurrentPageID() == 'list' || ("f_function(`id`) = 0" && CurrentPageID() == 'add')

Please help, how can I limit lookup field in filter with my db function only in Add page,
but keep column correct in list page.

Thanks!


mobhar
User
Posts: 11660

Post by mobhar »

Just remove this part:

CurrentPageID() == 'list' ||


covecove1
User
Posts: 3

Post by covecove1 »

mobhar wrote:

Just remove this part:

CurrentPageID() == 'list' ||

i tried that before and now. filter is not removing options from list when i write it like
("f_function('id') = 0" && CurrentPageID() == 'add')

but if i write
"f_function('id') = 0"
then filter is removing options as it should in Add page.

pls help, thanks!


arbei
User
Posts: 9284

Post by arbei »

You may try:

CurrentPageID() == "add" ? "f_function(`id`) = 0" : ""


covecove1
User
Posts: 3

Post by covecove1 »

arbei wrote:

You may try:

CurrentPageID() == "add" ? "f_function(`id`) = 0" :
""

Your solution is working, thank youuu!

Can you explain why my filter "f_function('id') = 0" && CurrentPageID() == "add" is not working?


mobhar
User
Posts: 11660

Post by mobhar »

covecove1 wrote:

Can you explain why my filter "f_function('id') = 0" && CurrentPageID() == "add" is not working?

Because you include the function in the if condition block, and not in execution block.


Post Reply