User bio
404 bio not found
Member since Apr 13, 2021
Posts:
Sami has not published any posts yet.
Replies:

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.