AutoQuery Calls from another service  Topic is solved

Discussions relating to the REST API of Jiwa 7.

AutoQuery Calls from another service

Postby SBarnes » Fri Feb 03, 2023 4:07 pm

Is there a way to call an auto query route like the routes under queries from another service?

Similar to using base.ResolveService.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1646
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 182

Re: AutoQuery Calls from another service  Topic is solved

Postby SBarnes » Fri Feb 03, 2023 5:26 pm

Well I worked out the answer for myself its as simple as on your service class declare the AutoQuery property like this


Code: Select all
public IAutoQueryDb AutoQuery { get; set; }


then inside your method do this, which is based upon the documentation of doing a custom auto query.

Code: Select all
      var req =  new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_MainQuery();
                var q = AutoQuery.CreateQuery(req, base.Request, Db);
                var result = AutoQuery.Execute(req, q, base.Request, Db);
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1646
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 182


Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest