HELP - SETVALUESET

Discussions about CSEntry
Post Reply
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

HELP - SETVALUESET

Post 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 213 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 213 times
Imagen_03.png
Imagen_03.png (22.88 KiB) Viewed 213 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
justinlakier
Posts: 153
Joined: November 21st, 2022, 4:41 pm

Re: HELP - SETVALUESET

Post 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
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: HELP - SETVALUESET

Post by PHINOJOSA »

Thank you so much

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

Atte.
Paul Hinojosa
Post Reply