Topic: Filter table grid using a text field

I know I have seen it on this forum but I cannot find it anymore, I am looking for the correct syntax to use in the filter of a table grid if we want to use one of the existing form text field as a condition.

In my case, I want to use the field "form1.EditPCName.txt" as one of the condition to dig into a log table:

old_pc_name="{EditPCName}" or New_PC_Name="{EditPCName}" and src="Computers"

This does not return any results as it does not retrieve any value for {EditPCName}

Re: Filter table grid using a text field

Hi Thierry,
Is this the sort of thing you want? (see attached). 
I'm making the assumption you want to do it by script - if doing it by SQLQuery, the syntax is slightly different.
Regards
Derek.

Post's attachments

Attachment icon incremental search by script 2.zip 443.39 kb, 61 downloads since 2023-10-28 

Re: Filter table grid using a text field

No, Actually, I do not use incremental search by script on this one.

I am using the table grid auto query with a filter at the bottom but I want to use a text field as one of the filters. See attachment.

Post's attachments

Attachment icon auto_query_filter_by_edit.zip 335.68 kb, 47 downloads since 2023-10-28 

Re: Filter table grid using a text field

Hi,
As I understand it, using a filter in the way you describe will only work with a fixed condition (color = 'red' or sex = 'male' etc).
To filter according to the contents of a text field, I would use the 'search' option.
Derek.

Re: Filter table grid using a text field

tcoton wrote:

I know I have seen it on this forum but I cannot find it anymore, I am looking for the correct syntax to use in the filter of a table grid if we want to use one of the existing form text field as a condition.

In my case, I want to use the field "form1.EditPCName.txt" as one of the condition to dig into a log table:

old_pc_name="{EditPCName}" or New_PC_Name="{EditPCName}" and src="Computers"

This does not return any results as it does not retrieve any value for {EditPCName}

The names of the input fields are valid in the SQL request, which is written in the button with the SQL-query action.
In the filter, computational fields are written in curly braces.

Визуальное программирование: блог и телеграм-канал.

Re: Filter table grid using a text field

derek wrote:

Hi,
As I understand it, using a filter in the way you describe will only work with a fixed condition (color = 'red' or sex = 'male' etc).
To filter according to the contents of a text field, I would use the 'search' option.
Derek.

That would work if only I did not have another condition for my filter that cannot be set with the search, ideally I would need a mix of both the auto query and the search button all in one place smile

I currently use scripts but I want to actually remove as much SQL scripts as possible since they can easily be read in plain text in the .dcu file.