SysQueryForm in Microsoft dynamics Axapta

Hi,

In the SYSQUERYFORM form there is a close() in that they called querybuild() of SYSQUERYFORM class.In that querybuild() we can able to find out the table id and field id of a corresponding datasource attached thru the sysqueryform form.For ex:-if u take GL->Inquiries->Voucher transactions.Ledger trans table id is 225 and voucher is 65539.So i wrote a validation by comparing these id’s and throwed the error.But it is closing the prompt dialog after clicking the ok button in the sysqueryform.