SysQueryForm in Axapta

Hi,

Can anybody tell me how we are getting a table under structure group in the sysqueryform.For example you can see in General Ledger Module under inquiries menu of voucher transactions form.I want to know how it is displaying.

I got it.

Hi,

Can anybody tell me how to add a datasource and the controls runtime in the form

Some examples were given in Developers Help - Please go thorough them…

I have got the info from developers help but i want to fetch the form thru sysqueryform.for example:-The code is follows in the form

In class declaration:

Query query;
QueryRun queryRun;
NoYes fromMenu;

void promptVoucher()
{
;
queryRun = new QueryRun(query);

if (! queryRun.prompt())
{
if (fromMenu)
{
element.close();
}
}
iDMS_N_RM_BILLINGTRANS_ds.query(queryRun.query());

}

this prompt voucher is for executing the sysquery form.

Then in init()

public void init()
{
QueryBuildDataSource qbd;
QueryBuildRange qbr;
AllChosen allChosen;
QueryBuildDynalink queryBuildDynalink;
Counter dynalinks;
Counter counter;
super();
fromMenu = element.args().caller() ? NoYes::No : NoYes::Yes;
query = new Query();

if (fromMenu == NoYes::Yes)
{
query.addDataSource(tablenum(iDMS_N_RM_BILLINGTRANS));
query.dataSourceNo(1).addRange(fieldnum(iDMS_N_RM_BILLINGTRANS,sdcode));
query.dataSourceNo(1).addRange(fieldnum(iDMS_N_RM_BILLINGTRANS,CategoryCode));
query.dataSourceNo(1).addRange(fieldnum(iDMS_N_RM_BILLINGTRANS,cyclecode));
query.dataSourceNo(1).addRange(fieldnum(iDMS_N_RM_BILLINGTRANS,ledcode));
query.dataSourceNo(1).addRange(fieldnum(iDMS_N_RM_BILLINGTRANS,issuedate));
query.dataSourceNo(1).addRange(fieldnum(iDMS_N_RM_BILLINGTRANS,issuedate));
element.promptVoucher();
}

}

Then i dragged the datasource fields into the design.But my question is:-Since this table contains more data in future there will be performance pbm.So i thought to add a datasource dynamically and the design level also dynamically.Then in that how i will call a datasource dynamically.

In sysqueryform if we are giving one range values and if we are not giving another range values and pressing ok means it should throw the error.How we can check the condition in sysqueryform and throw the error.

Pls help in this also.

In sysqueryform if we are giving one range values and if we are not giving another range values and pressing ok means it should throw the error.How we can check the condition in sysqueryform and throw the error.

Pls help in this.It is very urgent

It is a Query.

The sysQueryForm will be called for all queries.

You can explain in detail what you are trying to achieve???

I have created a form using sysqueryform,like for example if u see General ledger–>inquiries–>voucher transactions.In my form if i didnt give any values in the prompt dialog of sysquery form so while clicking the button it should throw the error.So i dont know how to throw the error in the form which is thry sysqueryform.If any solutions pls tell me.

how to throw the error in the sysqueryform if we are not entering the range value in the prompt dialog by clicking the button.Meanwhile it should not go to another form while clicking and throwing the error.pls help me in this.

pls help in this

I have done the validation in sysqueryform after clicking the button if there is no range values then it is throwing the error as “Atleast one range should be filled in”.But after clicking that ok button in the sysqueryform it is closing the prompt dialog.I dont know how to resolve it.Can anybody help me in this.

HI Ramyasrilakshmi.

Can you tell how did you do the validation for it.

Hi,

In Sysqueryform form in that close() they called querybuild method of sysqueryform class.In that we are getting the corresponding table id and field id’s,So i have found the table id and fieldid thru debugging for my table(datasource) and wrote in the querybuild method of sysqueryform class.The code is as follows

//Ramya
if (tmpSysQuery.Table_Id == 30769)
{
if (tmpSysQuery.Field_Id == 95538)
{
if (tmpSysQuery.RangeValue == ‘’)
{
throw error(“Voucher should be filled in”);

}
}
}
//Ramya

So when we are not giving the range value in the prompt dialog in the sysqueryform it will throw error as(“Atleast one range should be filled in”).But it is closing the prompt dialog after throwing the error.I dont know how to resolve.I am trying to resolve it.If u can help pls help me in this.

Hi,

In sysqueryform form there is a close method in that we are calling querybuild() of sysqueryform class.In that we are getting the table id and field id of all the table attached as datasource thru sysqueryform.In that querybuild() i wrote a code as given below.

//Ramya
if (tmpSysQuery.Table_Id == 225)
{
if (tmpSysQuery.Field_Id == 65539)
{
if (tmpSysQuery.RangeValue == ‘’)
{
throw error(“Voucher should be filled in”);

}
}
}
//Ramya

Hi,

In sysqueryform form of close() querybuild() is called from sysqueryform class.In this querybuild() only we are getting the table id and fieldid which is attached as the datasource to a form thru sysqueryform formFor example:-check the gl->inquiries->voucher transactions.In that below code is as follows.

//Ramya
if (tmpSysQuery.Table_Id == 225)
{
if (tmpSysQuery.Field_Id == 65539)
{
if (tmpSysQuery.RangeValue == ‘’)
{
throw error(“Voucher should be filled in”);

}
}
}
//Ramya

Hi,

In SYSQUERYFORM form there is a close method in that they called querybuild method of SYSQUERYFORM class,thru this class we are getting the table id and field id’s which is attached to the datasource thru sysqueryform form.For example if you see GL->Inquiries->Voucher transactions.You will get the ledger trans table id as 225 and field id voucher as 65539.So i wrote a code in querybuild method by comparing these table id and field id and throwed the error.But after clicking and throwing the error it is closing the prompt dialog.But in my case it should not happen.