Hi, i have a question about the forms and loading data for multiple Tables
I need to create a ProductCode in my form, in this form there are 3 fields of 3 diferent tables, the Category, Client and Brand, you can set the value through a combo box, linked to their respective tables.
The ProductCode would be something like this:
###-CatCode-#-ClientCode-BrandCode-xxxx
where:
CatCode is the code for the selected Category
ClientCode is the code for the selected Client
BrandCode is the code for the selected Brand
The # is introduced in a text field
The xxxx are the consecutive for each client
A preview
I tried with the option to reload With AjaxI but I can not make this work properly
Thanks for help
Hi all, I solved my problem after lot trying, put an Ajax event ONChange on each field than i need to monitored, something like this:
sc_lookup(dataset, "SELECT catcode FROM tabla1 WHERE catid = '{category}'");
[catcode] = {dataset[0][0]};
{productcode} = [code1].[catcodet].[code2]...;
with the consecutive, i put this code on clien onChange event:
sc_lookup(conset,
"SELECT COUNT(cliente) FROM tabla2
WHERE client = '{client}'");
$aux = {conset[0][0]} + 1;
{C_CodOrden} = [C_CodOrden]."-"."$aux";
i hope this help someone, bye