Page 1 of 1

Lookup file with memberId

Posted: 2022-02-03 09:22
by amyat
want to show lookup field by only created by user(user1 memberId)

Can't use memberId,groupId on Lookup field advanced... area?
table have id , name , created by (default createdby username).

Code: Select all

SELECT id.....From table WHERE `table`.`created_by`=%%memberID%% ORDER BY 2
that is not possible?
was this feature released?

If can't,please give me any other idea :(
just want to show lookup field by only created by him

Re: Lookup file with memberId

Posted: 2022-02-03 11:19
by jsetzer
I have just taken a quick look into ajax_combo.php which is responsible for returning lookup-options.

I can not find any resolving of placeholders in advanced queries' SQL of lookups (AKA: custom_query). So, I guess such a feature of replacing %%VARIABLENAME%% does not exists in standard generated AppGini apps.

There was another forum question here a couple of days ago. There was need for joining a different table and filering by a value of the current record. Also in that question, the answer was: no, but there was a workaround for creating a custom dropdownlist with custom options.

This is the post I am referring to:
viewtopic.php?p=18751&sid=3ae9e6a20c544 ... 476#p18701

This one (see screenshot below) looks like a lookup (because it uses the same Select2 options as all the other dropdowns do), but is a normal <input> field converted into a select box with custom options:

chrome_GSEHZ4asAa.png
chrome_GSEHZ4asAa.png (4.01 KiB) Viewed 1285 times
Maybe this helps.

Another option could be the "[x] Inherit access permissions" flag, but, honestly speaking, I'm not too familiar with this. I hope others can help.