cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

error in validation service

Ru
14-Alexandrite
14-Alexandrite

error in validation service

hello,

i have one validation code which creates membership plans. This validation code is running personally but when i am running it using mashup it shows an error "unable to parse json request", when i clicked on Add button mashup is shows error, how i solve this error ?

below is the mashup view snapshot which helps you for better understanding:-

122_0-1614688009704.png

 

below is the validation code:-

 

var Priceresult = me.validateInteger({
number: Price /* STRING */
});

// result: INFOTABLE dataShape: ""
var result = me.checkPlanName({
plan_name: plan_name /* STRING */
});

if(result.length > 0){
result = 'Plan Name is already exists';
}
else if(plan_name == "" || plan_name == null){
result = 'Please enter Plan Name';
}
else if(Price == "" || Price == null){
result = 'Please enter Price';
}
else if(Priceresult == false){
result = 'Please enter price in number';
}

else if(plan_type_id == "" || plan_type_id == null){
result = 'Please select plan type';
}
else if(plan_type_id == 1){
result= '';
}
else if(plan_type_id == 2){
if(MembershipLength == '' || MembershipLength == null){
result = 'Please enter number of days';
}
else if(Dropdown == "" || Dropdown == null){
result = 'Please select membership length';
}
else{
result= '';
}
}


else if(plan_type_id == 3){

if(FromDate == '' || FromDate == null){
result = 'Please select From date';
}
else if(ToDate == "" || ToDate == null){
result = 'Please select To date';
}
else{
result= '';
}
}

 

 

1 REPLY 1

Hi @Ru ,

 

I think the issue here is that you are calling specific validation services in your code before you validate the specific input values from the mashup.  Does your validation service have default values defined on the input or in your testing in composer are you always providing values?

 

Thanks,

Top Tags