In CF5 I used the action [DB Read]
- Table name: t_afo_mitgliederverwaltung
- Conditions: <? Php returnArray ('#mitglied' => $ form -> data ("suchbegriff1")); ?>
==> result: the form fields are filled automatically!
In CF6, I use the [Read Data]
- Model name: member
- Tabel name: t_afo_member administration
- Where conditions: <? Php return [["#mitglied", $ this-> data ("suchbegriff1")]]; ?>
- Select type: First matching record.
- Paging for multipe results: Enable
==> According to the debugger the data recorder is found and read out
==> the form fields are not filled.
Please, can you help me?
In v6 there is one extra step, the "Data provider" in the "display section" must take the data set of the "read data", e.g:
{var:read_data_action_name}
You could also set the conditions like this:
#mitglied:{data:suchbegriff1}
but its strange to have "#" at the table fields ?
Best regards,
Max
Many thanks for the answer.
The command {var: read_data_action_name} must, in my opinion, be supplemented by the module name:
{Var: read_dat_action_name.ModuleName}
example: {var: read_data6.Model}
-> read_data_action = name corresponds to the black folder: exampel [name: read_data6]
-> Module_name = name corresponds to the selected module name (if the module name is left blank, the system will automatically assigns the name 'Modules'.
Thanks also for the note regarding the where condition. A and / or condition is also possible
Example:
name: {data: keyword1}
first name: {data: keyword2}
or
mitgliednr: {data: keyword1}
In this context, I still have a connection question. Is it also possible to make a query using LIKE
for example: where name like '% xyz%'
What is the syntax?
Thank you in advance for your support.
Peter
Yes, its actually like you wrote:
{var:read_data6.Model} //no space after the :
The like can be done this way:
name/like:%{data:keyword1}%
Best regards,
Max
Thank you for your support. Accessing with «like» works perfectly. CF6 convinces me and I hope that in the near future a detailed description with examples regarding the new functions will be available. CF6 deserved this!
You're doing a good job - thank you!
Peter
Could you please say why the where condition syntax is different now?
<? Php return [["#mitglied", $ this-> data ("suchbegriff1")]]; ?> (CF6) works but
<? Php returnArray ('#mitglied' => $ form -> data ("suchbegriff1")); ?> (the CF5 syntax) doesn't work in CF6?
It seems like the CF5 condition is still valid for php code but is not correct for CF6.
Cheers
Tim
This has been improved, please use the new syntax, in most cases php is not needed:
field_name:{data:url_parameter}
Best regards,
Max
I use a hidden field to store the user id in the form. After I want to fill the form fields automatically by connecting to user table and using following condition:
id:{data:userid}But it's not working. If I remove the condition, the form loads the data of first user in database table.
Why does the condition not work?
Thank you.
Regards
Patrick
CF 6
Just use {user:id} each time you want to get and use the user id.
as in
id:{user:id}
id
name
surname
code
country
and display them into read-only field
Thanks
