VMware Cloud Community
IBMChakresh
Contributor
Contributor
Jump to solution

How to use custom validation in composite array

We are working on a workflow, where we have Additional Disk fields

This field is of Type "Array/Composite Type" with following values

Label: string

Capacity: number

DriveLetter: string

We have to validate this field for no duplicate Labels or DriveLetter should not be equal to C drive

and  an action with the following code Array/Composite Type The validation takes place in the user presentation, via Custom Validation, where the input is executed:

if (winVolumeDetails != null) {
    for (var i = 0; i < winVolumeDetails.length; i++)
    {

          if (winVolumeDetails[i]["DriveLetter_OR_MountPath"] == 'C') {
           
            return "C is a primary drive";

        } else if ((winVolumeDetails[i]["Label"]) == "data") {
            return "Select label other than SQL specific data, logs or temp";
        }

}

    }       

Issues :

1. the code is executed only for first disk entry and will not be executed on the second entry

2. On error, the form will be frozen even if the user updates the valid values the form is not reloaded

errorDetails.jpg

Need help to understand how to use custom validation on the composite array and how to ensure that action is called everytime new entry is made (on click ) event

Reply
0 Kudos
1 Solution

Accepted Solutions
IBMChakresh
Contributor
Contributor
Jump to solution

XAAS rebuild has helped and it worked after that.

View solution in original post

Reply
0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

The validation code seems ok to me (ignoring the difference 'DriveLetter' vs 'DriveLetter_OR_MountPath') so I'd expect it to work properly in vRO client. Could you try that?

These problems look like a vRA-specific issues so you may want to crossport this thread also to their VMTN forum at https://communities.vmware.com/community/vmtn/vcloud-automation-center

Reply
0 Kudos
IBMChakresh
Contributor
Contributor
Jump to solution

XAAS rebuild has helped and it worked after that.

Reply
0 Kudos