Posts:
Sachin has not published any posts yet.
Replies:

I see.. you need to may be declare the service class ...

#Dim tService As Service.class

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
}

}
Followers:
Sachin has no followers yet.
Following:
Sachin has not followed anybody yet.
Global Masters badges:
Sachin has no Global Masters badges yet.