IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Custom validation in Business Console

  • 1.  Custom validation in Business Console

    Posted Wed October 17, 2018 07:03 AM

    Hello,

    We are in a process of developing the gadgets for some business requirements. As per documentation, we have to use the bc-validate directive for form validation. But how can we achieve some sort of custom validation like,

    1. Date Range Check
    2. Special character check etc. ?

    Is there any way to customize/overried the default validation framework ?

    Any help would be much appreciated.

    Regards,
    Anish


    #webMethods
    #webMethods-BPMS
    #BPM


  • 2.  RE: Custom validation in Business Console

    Posted Thu October 18, 2018 04:46 AM

    You can try to do something like this with a custom function to invoke it. Invoke your custom function on an event like ng-change

    have your validation rules in the function and bind a respective user friendly validation message. Let us know if its suffice.

    $scope.isValidDate = function(startDate,endDate) {
    $scope.errorMessage = ‘’;
    var curDate = new Date();

    if(new Date(startDate) > new Date(endDate)){
    $scope.errorMessage = 'End Date should be greater than start date';
    return false;
    }
    if(new Date(startDate) < curDate){
    $scope.errorMessage = 'Start date should not be before today.';
    return false;
    }
    

    };

    Start Date:

    End Date:

    {{errorMessage}}


    #BPM
    #webMethods
    #webMethods-BPMS