sc_lookup doesn't show values

Dear all,
I looked up three values and I got them correctly on echos messages (just to control if they are present or not).
Within on change (field artico_xid_id) I wrote this code:

sc_lookup(serial_number,“SELECT codice FROM warehouse_artico WHERE id = {artico_xid_id}”);
{inventario} = {serial_number}[0][0];
echo "Inventario ". {inventario};

sc_lookup(material_type,“SELECT tipoma_xid_id FROM warehouse_artico WHERE id = {artico_xid_id}”);
{artico_tma} = {material_type}[0][0];

echo " Tipo articolo ". {artico_tma};

sc_lookup(mat_type_desc,“SELECT warehouse_tma.descri FROM warehouse_tma, warehouse_artico WHERE warehouse_tma.id = warehouse_artico.tipoma_xid_id and warehouse_artico.id = {artico_xid_id}”);
{descri_tma} = {mat_type_desc}[0][0];

echo " Descrizione ". {descri_tma};

I also tried to use syntax {serial_number[0][0]}; {material_type[0][0]}; {mat_type_desc[0][0]}; but the result is always empty fields.

Now I have all correct data and with echo I can see them . Why nothing appears on field forms ?
Have I to make a kind of assign command to update the form’s fields contents ?
Bye
Giovannino

http://img843.imageshack.us/img843/854/appears.png

Re: sc_lookup doesn’t show values

In the image I see only the field names, not the field boxes. Why is that?

Possible causes I can think of:

  • label field property of field is set to “Yes” (Form -> Fields)
  • field is read-only (Form -> Read only)
  • sc_field_readonly is used on the fields

Re: sc_lookup doesn’t show values

Thanks,

These fields are only displayed for info (they were created from form “add new field”). They look values from another table (artico) and I want to only show them to user just for info.
If I use forward arrow and go through records it works nice and I can see the content using the standard grid lookup features. I also tryed to inhibit the grid lookup without success.
The problem rises if the user goes to modify the id field becouse other field remain connected to old value. I need a kind of refresh that update the value of this fields.

Possible causes I can think of:

  • label field property of field is set to “Yes” (Form -> Fields)
    OK. Why label can disturb ?
  • field is read-only (Form -> Read only)
    OK. I also tryed to insert “No” but nothing change.
  • sc_field_readonly is used on the fields
    NO

https://docs.google.com/leaf?id=0B_JC1r1rTYiLYjcyZmRlNTItNGM3Yy00ZTg4LTk0YjMtYjY4MjUyMTljZGM5&hl=it&authkey=CPfijbcO

http://img69.imageshack.us/img69/4796/figura1oy.png

http://img821.imageshack.us/img821/9185/figura2.png

http://img842.imageshack.us/img842/6950/figura3.png

Re: sc_lookup doesn’t show values

ok, that’s clear.

what happens when setting the 3 fields to:
label: no
read only: no

Re: sc_lookup doesn’t show values

Thanks Freezer,

I’ve just tryed to set all 3 fields but unfortunately the result is the same.

The only strange thing is that the 3rd field works as grid lookup also if do not use OnChange feature. On the 3rd field (description) I can see the text and always when I change the articole ID it works properly.

Why, on the other hand, the first two do not works . Select tehy do are simpler than 3rd field . ???
I also changed the type of field from numeric to text but always the same.
It’s becoming misterious behaviour …
Bye
Giovannino

Re: sc_lookup doesn’t show values

Ciao,
ti scrivo in italiano cosi ci capiamo meglio, io ho utilizzato questa funzione molte volte e confrontando i lcodice l’unica cosa che ho notato ? che io uso sempre un if per verificare che i dati che estraggo non siano vuoti. ti posto un pezzo di codice.

sc_lookup(loc,“SELECT capminimo, provinciacod FROM geomap
WHERE comunedes=’{locpdv}’”);

if({loc[0][0]} == 0) {

sc_error_message(“Localita non Codificata”);

}
else
{
{cappdv} = {loc[0][0]};
{provpdv} = {loc[0][1]};
}

Re: sc_lookup doesn’t show values

@marcov: I understand the word “ciao”, but the rest I don’t…

Re: sc_lookup doesn’t show values

Marcov grazie tante, cepprovo… ! Non ho ancora capito perch? usando la freccia di scorrimento records funziona tutto bene e anche l’ultimo campo descrizione funziona anche senza on-change.

Thanks so much Marcov. I will try it.

x Freezer: Marco is suggesting to use and try an “if” testing for null values.
I will try and then I’ll inform you both !
Bye
Giovannino

Re: sc_lookup doesn’t show values

You already echo’d the values, they were ok weren’t they?

Re: sc_lookup doesn’t show values

Yes , values are all available but not visible !