Search This Blog

Monday, February 20, 2012

AX2012 Call Query Service with Static Query


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using krishh_cosumeQueryService.QueryService;
using System.Data;

namespace krishh_cosumeQueryService
{
    class TestStaticQuery
    {
        static void Main(string[] args)
        {
            QueryServiceClient client = new QueryServiceClient();
            DataSet dataSet;
            Paging paging=null;

            dataSet = client.ExecuteStaticQuery("CustTable", ref paging);

        }
    }
}
Result-

When we execute the program we got the dataset with the 3tables -CustTable,CustTrans,CustTransOpen.
We can load these tables in the grid if we use the windowsformapplication.

1 comment:

  1. Hi krishh,

    I am new to AX,

    I need to apply date filters/range in the query service.

    Please, help me

    Thanks
    Balachandar G

    ReplyDelete

Thanks for visiting my blog,
I will reply for your comment within 48 hours.

Thanks,
krishna.