Page 1 of 1

HELP - SETVALUESET

Posted: April 12th, 2024, 9:54 am
by PHINOJOSA
hello

I need your help, I have 2 ROSTER:

1st ROSTER food list
Imagen_01.png
Imagen_01.png (14.35 KiB) Viewed 677 times
2° ROSTER, all the ingredients of each food must be listed, for which with the help of "setvalueset" (CPI_02) the values of ROSTER 1 are obtained, and in the variable (CPI_03) the name of the food of ROSTER 1 is assigned.

PROC CPI_02 // Aca se muestra la lista de preparaciones de la comda 1
// Estando en esta posición se ejecutara tando al avanzar como al retroceder
onfocus
preparaciones1.clear();

for CP_ROSTER where CP_01 > 0 do
preparaciones1.add(CP_02, CP_01);
enddo;
preparaciones1.sort(by code);
setvalueset (CPI_02, preparaciones1);

postproc
CPI_03 = getvaluelabel ($);

Imagen_02.png
Imagen_02.png (16.46 KiB) Viewed 677 times
Imagen_03.png
Imagen_03.png (22.88 KiB) Viewed 677 times
But I need the row number and name of the food from ROSTER 1 to be assigned in the variable (CPI_03), currently only the name of the food from ROSTER 1 is assigned.

Thank you for your time and support.

Atte. Paul Hinojosa

Re: HELP - SETVALUESET

Posted: April 12th, 2024, 3:09 pm
by justinlakier
Hello,

You are currently assigning the value of CPI_03 in CPI_02's postproc with "CPI_03 = getvaluelabel($)". This would for instance take CPI_02's value of "01" and assign CPI_03 the associated label of "POLLO". If you want CPI_03 to be "01 - POLLO" with both the value and the label, then in CPI_02's postproc you need to instead do something like

Code: Select all

CPI_03 = maketext("%v - %v", $, getvaluelabel($) );
This should create a text using maketext that has CPI_02's number followed by the label, then sets that new text as CPI_03's value.

Hope this helps,
Justin

Re: HELP - SETVALUESET

Posted: April 13th, 2024, 1:58 am
by PHINOJOSA
Thank you so much

It works just as she expected.
imagen 1.jpg
imagen 1.jpg (85.27 KiB) Viewed 663 times
Thanks for the support.

Atte.
Paul Hinojosa