HELP - SETVALUESET

Discussions about CSEntry
Post Reply
PHINOJOSA
Posts: 58
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
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_03.png
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
You do not have the required permissions to view the files attached to this post.
justinlakier
Posts: 238
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: 58
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
Thanks for the support.

Atte.
Paul Hinojosa
You do not have the required permissions to view the files attached to this post.
Post Reply