[beta 4.0.4.] Hierarchy Field Validation still doesn't perform validation correctly - Forum - Rollbase - Progress Community

[beta 4.0.4.] Hierarchy Field Validation still doesn't perform validation correctly

 Forum

[beta 4.0.4.] Hierarchy Field Validation still doesn't perform validation correctly

This question is answered

Hello,

I was just trying out the validation on a hierarchy field and the validation doesn't go away even if I make sure that the value I select is correct. See the attached screenshot.

Original Post: community.progress.com/.../74771

Cheers.

Best Regards,

Iram

Verified Answer
  • Iram, for hierarchical relationships to identify the parent-side value, you need to define the token as given below:

    if({!RB188966#P.id} !== 30277){

      return 'Parent Account is not Microsoft!';

    }

    //RB188966 is the Relationship integration name

    //#P token signifies fetch parent-side value of this hierarchical relation

    //id is the Object ID token.

    Regards,
    Siraj.
All Replies
  • Iram, irrespective of the client-side validation messge, now you should be able to submit the form. That is, unlike earlier, we will not prevent the form from submitting in case of client-side validation errors on server re-direct.

    Regards,
    Siraj.
  • Yes but I still can't submit, it keeps giving me that error.

  • Iram, just to be very sure.

    Are you seeing issues with server-side validation after form submit (as per the forum thread that you have referenced) or is it client-side issue with submitting forms if it has server-side validation message.

    In the first case, on form submit, it will refresh page but may re-direct user back to the same page if server-side validation has reported failure.

    In second case, after first form submit with server-side validation failures, user is being prevented from saving the form that is page is not refreshing.

    Regards,
    Siraj.
  • Hello Siraj,

    I would like to say both I think. So this is what happens: I have a server-side field validation set on the Parent Account field to check if the Account is Microsoft or not.

    // 32077 is the ID of the Microsoft Account Record.

    if("{!Paccount}" != 30277)
    {
    return "Parent Account is not Microsoft!";
    }

    So basically 1) It is refreshing the page, however failing on the server-side validation (because I keep the field empty) and redirecting back to the same page.

    2) And now after the first form submit has failed validation, if I try to add Microsoft to the Parent Account, it doesn't allow me to save the record anymore but the page IS refreshing.

    Any suggestions?

    I have attached the XML file for your reference. Try to create a new Account to test it out.

    Cheers.

    CRM_v1.xml

  • Hi Iram,

    Thanks for the confirmation. Had initially thought that you are seeing the same issue as reported in this post:

    community.progress.com/.../76253

    However, this seems to be an issue wherein validation trigger is incorrectly flagging a field value as invalid. Thank you for sharing app, will get back to you on this shortly.

    Regards,
    Siraj.
  • Iram, for hierarchical relationships to identify the parent-side value, you need to define the token as given below:

    if({!RB188966#P.id} !== 30277){

      return 'Parent Account is not Microsoft!';

    }

    //RB188966 is the Relationship integration name

    //#P token signifies fetch parent-side value of this hierarchical relation

    //id is the Object ID token.

    Regards,
    Siraj.
  • Thanks Siraj. That's very interesting to know. Did not know you could do that. That does work now.

    Cheers.

    Iram

  • Also a quick question: Has this always worked? i.e. Does it currently work in 4.0.2. in the answer you described above?

  • Yes,  this is not a newly introduced 4.0 specific behavior.

    Also see:

    documentation.progress.com/.../index.html

    Regards,
    Siraj.