Use a record map instead. The record map object can be easily used to read a CSV file line by line.
I wonder why this is not working as i have called the service many times through custom tasks that i create.
You could, may be, put the code inside a Try/Catch to see what's the real problem.
Sample code from one of my tasks...
Class DisenrollMemberTask Extends %SYS.Task.Definition { Property MemberDisenrollService As %String [ InitialExpression = "MemberDisenrollService " ]; Method OnTask() As %Status { Set tStatus=$System.Status.OK() Try { #Dim tMemberDisenrollService As CUSTOM.Demo.Task.Service.DisenrollMember Set tStatus=##class(Ens.Director).CreateBusinessService(..MemberDisenrollService , .tMemberDisenrollService ) If ($System.Status.IsError(tStatus)){ $$$ThrowOnError(tStatus) } If ($Isobject(tMemberDisenrollService)) { Set tStatus=tMemberDisenrollService.DisenrollMember("xyz", "abc") If ($System.Status.IsError(tStatus)){ $$$ThrowOnError(tStatus) } } } Catch (ex){ Set tStatus=ex.AsStatus() } Quit tStatus } }
Certifications & Credly badges:
Sami has no Certifications & Credly badges yet.
Global Masters badges:
Sami has no Global Masters badges yet.
Followers:
Sami has no followers yet.
Following:
Sami has not followed anybody yet.
I see.. you need to may be declare the service class ...
#Dim tService As Service.class