Voting: 
Vote up!
0 Votes
1 Replies
Unanswered

Object Services customVerb

Question asked by Robert Moiles on Jun 14, 2017 11:05 EDT

I created an Object Service with a custom verb:  getAvailabilityByDate under a Mapping: Availability.  When testing from the Object Services \ ParkingAvailability \ Mapping page, it works with the Request Payload {"AvailabilityDate": "2017-06-12", "Userid":"myuserid"}.  I don't understand how to run this from Visualizer.  Execution seems to stop and nothing is visible in the logs.  Also, I can't run this from "App Services" as it returns an error "service not configured for the operation". var dataObject = new kony.sdk.dto.DataObject("Availability"); dataObject.addField("AvailabilityDate","2017-06-12"); dataObject.addField("Userid","myuserid"); var options = {"dataObject":dataObject}; var objSvc = mfService.konySDK.getCurrentInstance().getObjectService("ParkingAvailability", {"access":"online"}); objSvc.customVerb("getAvailabilityByDate", options, function(res){alert("Custom operation performed");}, function(err){alert("Error in custom operation");} );  

Vote up!
0 votes
Vote down!

I was able to resolve calling the service by removing getCurrentInstance() from the line: 

var objSvc = mfService.konySDK.getCurrentInstance().getObjectService("ParkingAvailability", {"access":"online"});

It does still fail when I run this from "App Services" as it returns an error "service not configured for the operation".

Replied by: Jun 14, 2017 11:39 EDT