Skip to main content

Posts

Showing posts with the label execute query

How to Filter Records in form from Combo box in Axapta

Lets you want to to Filter Records in form from Combo box in Axapta then this is sample example you need to create one method like this. WMSPickingRoute_ds.filter(fieldNum(WMSPickingRoute,ExpeditionStatus),queryValue(God_expeditionStatus.selection())); Then you can call that method in modified field method for that combo box. Like filter1 is method name then you can call it below way. public boolean modified() { boolean ret; ret = super(); this.filter1(); return ret; } I hope you get and Idea how to filter records for form in axapta.

Calling Sql Stored procedure through MSD axapta code

  Calling Sql Stored procedure through axapta code LogInProperty LogProp = new LogInProperty(); OdbcConnection Con1; Statement stmt1; ResultSet rs; ; LogProp.setServer("SeverName"); LogProp.setDatabase("DataBaseName"); LogProp.setUsername("sa"); LogProp.setPassword("123"); try { Con1 = new OdbcConnection(LogProp); } catch { info("Check username/password."); return; } stmt1 = Con1.createStatement(); rs = stmt1.executeQuery('EXEC [testSTRsp]'); while (rs.next()) { info(rs.getString(1)); }     

Update records and grid in MSD axapta x++ language

Update records and grid in axapta x++ language public void Update_test_Emp_Travel() { ; ttsbegin; Select forUpdate test_Emp_Travel where test_Emp_Travel.SrNo == str2num(rlSrNo_Update.valueStr()); test_Emp_Travel.Employee_Name = strEmployeeName_Update.valueStr(); test_Emp_Travel.Travelling_Through = str2enum(test_Travelling_Through,cmbTravellingThrough_Update.valueStr()); test_Emp_Travel.update(); ttscommit; test_Emp_Travel_ds.reread(); test_Emp_Travel_ds.refresh(); test_Emp_Travel_ds.research(true); test_Emp_Travel_ds.executeQuery(); element.ClearField_Update(); GridEmpTravel.update(); GridEmpTravelDetails.update(); }

Common Form Methods in MSD Axapta

Common Form Methods in Axapta Only few of the form methods are needed in daily use. Having a basic knowledge of the execution order of these methods will help you a lot when starting making your modifications. The following methods are executed in the listed order when a form is opened and closed: init() ► ds init() ► run() ► ds executeQuery() ► canClose() ► close() 1. FormRun.init() is the first method called. The super() call in FormRun.init() will call FormDataSource.init() for each data source used in the form query. 2. The super() call in FormRun.run() will call FormDataSource.executeQuery() for every data sources. 3. When closing the form FormRun.canClose() will validate whether the form may be closed, and if true FormRun.close() is called. These are the most important methods executed when a form is opened and closed. Other methods are executed in the opening and closing sequences such as loading application user settings. However normally you will only need to override