Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

syntaxe of a validation with reference to a userdata in a validation context

Highlighted
dokhelar
Occasional Contributor

syntaxe of a validation with reference to a userdata in a validation context

Hi

we have 2 validations  for which we have created some user data fields:

- validation named ''SIGC - Numero de ligne par operation' with 1 userdata P_OPERATION (stored in user data1 field)

this validation =  list of lines; a line belongs to 1 operation (we use the userdata1 to manage the link)

- validation named ' SIGC - Numero de ligne par Operation et Sous Tronçon' = list of sections with 2 userdata = P_OPERATION and P_LINE

   a section belongs to 1 operation + 1 line; the line must belong to the selected operation

For  the userdata P_LINE, we want to control the values to allow only the lines belonging to the input operation = records of the 1st validation with userdata1  = value of the input operation = userdata P_OPERATION

Query we have written =

SELECT lookup_code, meaning

FROM knta_lookups

WHERE lookup_type='SIGC - Numero de ligne par operation'

AND user_data1 = '[VAL="SIGC - Numero de ligne par Operation et Sous Tronçon".UD.P_OPERATION]'

AND enabled_flag = 'Y'

ORDER BY seq

 

But we execute this validation, we have 1 error = KNTA-10073 indicating the a token cannot be parsed

Where is the mistake in the syntax of the token  '[VAL="SIGC - Numero de ligne par Operation et Sous Tronçon".UD.P_OPERATION]' ?

we use the prefix 'VAL' + the context = name of the validation + UD. + name of the token (P_OPERATION)

 

regards

 F.Dokhelar

5 REPLIES
Sascha_1
Member

Re: syntaxe of a validation with reference to a userdata in a validation context

Hi dokhelar,

 

first of all, what kind of validation you are using? Is it a drop down list or a other validation?

The problem of your sql query is, if you are using a drop down list, the system could not know about the value you try to select.

 

Example:

You have a drop down list with 3 values (A,B,C). You define a user data for this validation with a field P_OPERATION.

 

Now you try to select the data where P_OPERATION has a unique value. But the problem is, that the system does not know which value you want to select from the drop down list (A,B,C???).

Maybe this will cause your error.

 

Regards,

Sascha

 

dokhelar
Occasional Contributor

Re: syntaxe of a validation with reference to a userdata in a validation context

 

I wil try to explain better my case =
- I have 3 list of values to manage with a hierarchy between the 3 entities =
 1 section belongs to 1 operation + 1 line
 1 line belongs to 1 operation

==> I create 3 validations = 3 drop-down list
- drop-down list A = the list of operations

ex: O1, O2, O3 ...
- drop-down list B = the list of lines with 1 userdata = the Operation (stored on field user_data1)
    to control this userdata field I create 1 validation A1 = autocomplete list selecting records from validation A

ex: L1 with Operation = O1; L2 with Operation = O1; L3 with Operation = O2 ...

- drop-down list C = the list of sections with 2 userdata = the Operation (with token P_OPERATION) + the Line (with token P_LINE)
    to control the userdata Operation I use the validation A1 = autocomplete list mentionned above
    to control the userdata Line I create a validation B1 = autocomplete list selecting records from validation B 

   but limited to the Operation that has been input in the userdata Operation 

ex: S1 with Operation=O1 and Line=L1; S2 with Operation=O1 and Line=L2 ...

  when we create the record S1,  if we enter Operation=O1, validation B1 must display only lines L1 and L2

 
query of this validation B1 =
SELECT lookup_code, meaning
FROM knta_lookups
WHERE lookup_type='B'
AND user_data1 = '[VAL="C".UD.P_OPERATION]'
AND enabled_flag = 'Y'
ORDER BY seq

but syntax of the token '[VAL="C".UD.P_OPERATION]' is not parsed by PPM
I use the prefix 'VAL' + the context = name of the drop-down list ( = "C")
+ 'UD.'  for the hidden value of a userdata
+ name of the token of the userdata Operation in the drop-down list C (token name = P_OPERATION)

 

What is wrong in this syntax ?

regards

 François

Cat_2
Regular Collector

Re: syntaxe of a validation with reference to a userdata in a validation context

I'm still a bit confused by what you are trying to accomplish.

 

Validation A - drop down list of operations

Validation B - list of line options based on the selected value of Validation A

Validation C - list of section options based on both Validation A and Validation B

 

My first thought is why would Validation C need to be based on both Validation A and B if Validation B is already dependent on Validation A. I'm sure there's something I'm not getting just yet. But just to continue the thought I modeled it something like...

 

Val A value > Alpha

    Val  B option > AlphaSub1

    Val  B option > AlphaSub2

    Val  B option > AlphaSub3

Val A value> Beta

   Val  B option > BetaSub1

   Val  B option > BetaSub2

Val A value > Omega

   Val  B option >OmegaSub1

 

Val C > Depending on Val A and Val B selections

For example: Val A = Alpha and Val B = AlphaSub2 so Val C = Combo1

                      Val A = Alpha and Val B = AlphaSub3 so Val C = Combo2

 

Validation A comprised of... I have 1 Drop Down List Validation Object.

 

Validation B comprised of... 1 Drop Down List Validation Object + Validation User Data (with 1 user data option) + 1 Auto Complete List Validation.

 

The SQL for the Auto Complete Validation B looks like...
SELECT lookup_code, meaning
FROM knta_lookups
WHERE lookup_type = 'Validation B'
AND user_data1 = '[REQD.P.P_VAL_A]'
AND UPPER(meaning) LIKE UPPER('?%')
AND (meaning LIKE UPPER(SUBSTR('?',1,1)) || '%'
     OR meaning LIKE LOWER(SUBSTR('?',1,1)) || '%')
AND enabled_flag = 'Y'
ORDER BY UPPER(meaning)

 

where 'REQD.P.P_VAL_A' is made up of... REQD (request detail notation) + P (customized parameter notation) + P_VAL_A (the parameter name as listed in the request type form field)

 

Validation C comprised of... 1 Drop Down List Validation Object + Validation User Data (with 2 user data options) + 1 Auto Complete List Validation.

 

The SQL for the Auto Complete Validation C looks like...
SELECT lookup_code, meaning
FROM knta_lookups
WHERE lookup_type = 'Validation C'
AND user_data1 = '[REQD.P.P_VAL_A]'
AND user_data2 = '[REQD.P.P_VAL_B]'
AND UPPER(meaning) LIKE UPPER('?%')
AND (meaning LIKE UPPER(SUBSTR('?',1,1)) || '%'
     OR meaning LIKE LOWER(SUBSTR('?',1,1)) || '%')
AND enabled_flag = 'Y'
ORDER BY UPPER(meaning)

 

 Am I going down the right road here? I'm on PPM 8.01

 

dokhelar
Occasional Contributor

Re: syntaxe of a validation with reference to a userdata in a validation context

Hi

I'm not customizing a request type, I'm customizing a drop-down list validation (= list of sections) for which 1 have defined 2 userdata fields (since a section belongs to 1 Operation and 1 Line).

To control the 1st userdata field (Operation) I have created 1 validation = autocomplete list displaying rows from validation A.

I'm trying to create another validation (autocomplete list) to control values for the 2nd userdata field = Line.

I want to display all Lines (that means rows of validation B) but limited to the lines having userdata1 = the Operation code input in the 1st userdata field = Operation.

I remember that in validation B, I customized 1 userdata field = the Operation linked to each Line.

ex: I create in validation C a row  with code S1 and meaning = 'XXXX' and in userdata tab, I have 2 fields :

- Operation : I input the value 'O1'

- Line : I want that the validation I associate to this field displays rows from validation B having userdata1 = the value 'O1' I have just input.

What is the syntax  to use to parse this token in the query of the autocomplete list ?

François

T_Marsh
Acclaimed Contributor

Re: syntaxe of a validation with reference to a userdata in a validation context

François, did you ever get an answer to this question?

 

Tom

//Add this to "OnDomLoad" event