In Ax2009 EmplTable now replaced with hcmWorker Table. To get emplid and emplname below is the lookup code:
public void lookup()
{
HcmWorker hcmWorker;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(hcmWorker.TableId, this);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource = query.addDataSource(hcmWorker.TableId);
queryBuildDataSource.addSortField(fieldNum(HcmWorker, PersonnelNumber));
sysTableLookup.addLookupfield(fieldNum(HcmWorker, PersonnelNumber));
sysTableLookup.addLookupfield(fieldNum(HcmWorker, Person));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
Happy - Daxing :)-
Sunday, August 11, 2013
Monday, August 5, 2013
AX 2012: Enabling Allow Check Reuse for Canadian Environments & India also....!!
Per TechNet article (CAN, USA) Reuse a check number [AX 2012] environments that are on AX 2012 with the Feature Pack have the ability to enable the Allow Check Reuse feature in Cash and Bank Management Parameter for US and Canadian Companies. I wanted to provide information that will allow you to enable the Allow Check Reuse feature for Canadian Companies if you have updated to AX 2012 Feature Pack and do not see the option to enable Allow Check Reuse in Cash and Bank Management Parameters for your Canadian company.
In order to enable the Allow Check Reuse for Canadian Companies the CountryRegionCodes that are part of the BankParameters table may need to be updated via the AOT. Please note that this is not a documented/tested HotFix so making the below changes will be at you own risk and testing should be done in a Sandbox environment prior to applying to a production environment.
Already there are US,CA pls add IN (India) also.
Daxing :)
In order to enable the Allow Check Reuse for Canadian Companies the CountryRegionCodes that are part of the BankParameters table may need to be updated via the AOT. Please note that this is not a documented/tested HotFix so making the below changes will be at you own risk and testing should be done in a Sandbox environment prior to applying to a production environment.
- Open the AOT (Ctrl+D).
- Expand Data Dictionary
- Expand Tables.
- Locate the BankParameters table.
- Expand the BankParameters table.
- Expand Fields.
- Click on AllowCheckReuse
- In the Properties pane locate CountryRegionCodes (US should be listed by default)
- Add IN to the CountryRegionCodes along with US,CA (US, CA,IN).
- Compile to bring the changes into the environment.
Already there are US,CA pls add IN (India) also.
Daxing :)
Thursday, August 1, 2013
fetch data and time from UTCDateTime control in Ax2012
public static void testDateTimeConversion()
{
utcDateTime dateTime;
date dateInUserTimeZone;
TimeOfDay timeInUserTimeZone;
dateTime = DateTimeUtil::utcNow();
dateInUserTimeZone = DateTimeUtil::date(DateTimeUtil::applyTimeZoneOffset(dateTime, DateTimeUtil::getUserPreferredTimeZone()));
timeInUserTimeZone = DateTimeUtil::time(DateTimeUtil::applyTimeZoneOffset(dateTime, DateTimeUtil::getUserPreferredTimeZone()));
dateTime = DateTimeUtil::newDateTime(dateInUserTimeZone, timeInUserTimeZone, DateTimeUtil::getUserPreferredTimeZone());
}
Happy Daxing :)
{
utcDateTime dateTime;
date dateInUserTimeZone;
TimeOfDay timeInUserTimeZone;
dateTime = DateTimeUtil::utcNow();
dateInUserTimeZone = DateTimeUtil::date(DateTimeUtil::applyTimeZoneOffset(dateTime, DateTimeUtil::getUserPreferredTimeZone()));
timeInUserTimeZone = DateTimeUtil::time(DateTimeUtil::applyTimeZoneOffset(dateTime, DateTimeUtil::getUserPreferredTimeZone()));
dateTime = DateTimeUtil::newDateTime(dateInUserTimeZone, timeInUserTimeZone, DateTimeUtil::getUserPreferredTimeZone());
}
Happy Daxing :)
Convert Number to string in Ax 2012
Examples
Num2Str(12345.6,10,2,2,1)
returns "12.345,60".
Num2Str(12345.6,1,0,1,0)
returns "12346".
Num2Str(12345.6,10,2,2,1)
returns "12.345,60".
Num2Str(12345.6,1,0,1,0)
returns "12346".
Convert Between utcdatetime and System.DateTime in AX 2012
static void JobDateTimeGlobalMarshal(Args _args)
{
System.DateTime netDttm;
utcdatetime xppDttm;
str xppString;
;
xppDttm = 2007-06-05T23:22:21; // ISO standard format.
// Convert X++ to .NET.
netDttm = Global::utcDateTime2SystemDateTime(xppDttm);
// Convert .NET to X++.
xppDttm = Global::CLRSystemDateTime2UtcDateTime(netDttm);
xppString = DateTimeUtil::toStr(xppDttm);
info("xppDttm: " + xppString);
}
{
System.DateTime netDttm;
utcdatetime xppDttm;
str xppString;
;
xppDttm = 2007-06-05T23:22:21; // ISO standard format.
// Convert X++ to .NET.
netDttm = Global::utcDateTime2SystemDateTime(xppDttm);
// Convert .NET to X++.
xppDttm = Global::CLRSystemDateTime2UtcDateTime(netDttm);
xppString = DateTimeUtil::toStr(xppDttm);
info("xppDttm: " + xppString);
}
Subscribe to:
Posts (Atom)