Skip to main content

Posts

Showing posts from June, 2010

Get item from combobox using axapta code

Get item from combo box using axapta code. This function will return selected value of combo box control. I hope it can help you to avoid combo box troubleshooting. display str telNo() { telNo=CustTable::find(Table1.ParentOffice).Phone; Table1.TelNo = telNo; rec = ComboBox1.selectionChange(); officeName = ComboBox1.getText(ComboBox1.selectionChange()); parentOffice1 = Table1.ParentOffice; return CustTable::find(CustTable.AccountNum).Phone; }

Fill combo box using axapta x++ code

You can fill combo box two way first you can use lookup method using extended data type second if you are not using EDT then you can fill combo box by using following code. public void fillCombo() { CustTable custTable2; ComboBox1.clear(); SaleCalls.ParentOffice = "Abc"; custTable2 = CustTable::find(saleCalls.ParentOffice,false) rec = custTable2.RecId; while select * from Address where Address.AddrRecId == custTable2.RecId && Address.AddrTableId == custTable2.TableId { // ComboBox1.add(int2str(Address.RecId)); ComboBox1.add(Address.Name); } ComboBox1.selection(0); }

Method to Get Day difference using axapta

This method will show how to get day difference in ax. You need to declare variable as date type or you can use date extended data types same as you need to declare other type variable first to avoid error. Public void DayDiff() { //check for days Different tmpfromdt1 = date2str(tmpfromdt, 123, 2, 4, 2, 4, 4); tmpdiffdays = str2int(substr(tmpfromdt1,1,2)); mm = str2int(substr(DateFrom.valueStr(), 4, 2)); mm1 = str2int(substr(tmpfromdt1, 4, 2)); if(mm == mm1) { if(tmpdiffdays != 1) { tmpdiffdays1 = tmpdiffdays-1; } else { tmpdiffdays1 = 0; } } else { tmpdiffdays1 =0; } }

Procedure to Creating Budget Models in Axapta

To create a budget model: 1. From the Navigation pane, click GENERAL LEDGER→SETUP→BUDGET MODEL. 2. Click Ctrl+N to create a new record. 3. In the Budget Model field, type the name. 4. In the Name field, type a description of the budget model. 5. Select the Cash flow forecasts check box to apply cash flow forecasts to this model Attaching Sub models To attach a submodel to a budget model: 1. From the Navigation pane, click GENERAL LEDGER → SETUP → BUDGET MODEL. 2. On the Overview tab, click the budget model to which the submodel will be attached. 3. Click the Submodel tab. 4. Click Ctrl+N to create a new record, click the arrow, and then click the submodel to be attached to this model.

Dialog and get value from dialog box using Axapta

Below is a Code how  to add dialog and get value from dialog box in dynamics Axapta. This is very simple you just need to create one method which is overridden method is dialog. Dialog method used to initialized dialog box for your form or report but without using get from dialog method you can not get value of dialog control. So both method is important dialog and getfromdialog. public Object dialog(Object _dialog) { DialogRunbase dialog = _dialog; DialogGroup dateGroup; ; dateGroup = dialog.addGroup(""); dateGroup.frameType(1); dateGroup.columns(2); fromdate = LedgerPeriod::findOpeningDate(systemdateget()); toDate= systemdateget(); dialog.addGroup("@SYS4083",dateGroup); dialogFromDate = dialog.addFieldValue(typeid(FromDate),fromDate,'',"@SYS67"); dialog.addGroup("@SYS8828",dateGroup) ; dialogToDate = dialog.addFieldValue(typeid(ToDate),toDate,'',"@SYS67"); dialog.addGroup