Skip to main content

Posts

Showing posts from January, 2014

How to get the current company(Legal Entity) address in Axapta 2012 based on the Address Type

How to get the current company(Legal Entity) address in Axapta 2012 based on the Address Type?: In single line of code:   static void getAddressBasedOnPurposeForLegalEntity(Args _args) {     LogisticsAddressing  address;     ;          address = DirParty::findPostalAddressByRole(CompanyInfo::current(), LogisticsLocationRoleType::RemitTo).Address;     info(address);      }

Group By and Aggregation (Sum) in RunTime Query:

Group By and aggregation as Sum in RunTime Query:     Query query;     QueryRun queryRun;     QueryBuildDataSource ds;     QueryBuildRange range1;     CustAccount     accountNum;     CustTrans custTrans;         query = new Query();     ds = query.addDataSource(tableNum(CustTrans));     ds.addGroupByField(fieldNum(CustTrans, AccountNum));        range1 = SysQuery::findOrCreateRange(ds, fieldNum(CustTrans, AccountNum));     range1.value(queryValue(accountNum));        ds.addSelectionField(fieldNum(CustTrans, AmountMST),SelectionField::Sum);

How to Store an image in container in axapta

how to store image in container : Create a field in table of Type contianer which must extend EDT:Bitmap code: public Bitmap getImage() {     Bitmap bitmap;     Bindata     binData ;     FileIOPermission perm;     FilePath _filepath = "c:\\sample.jpg"     ;     perm = new FileIOPermission(_filePath, 'r');     perm.assert();     binData = new BinData();     if (binData.loadFile(_filepath))     {         bitmap = binData.getData();     }     CodeAccessPermission::revertAssert();     return bitmap; } after that you assign this method to contianer  = > table.Field = class.getImage()