Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Friday, June 27, 2014

How to fetch the standard notes for concern module in Dynamic AX

Hi,

FormLetterRemarks::find(companyinfo::languageId(),
 FormTextType::PurchPurchaseOrder).Txt;
// Here I used to fetch the currecnt user language as 1st parameter
// and for the Purchase Order Notes as 2nd parameter

Regards,

Tuesday, June 24, 2014

Job to print all the roles in Dynamic AX

Hi,

static void AlfasithTotalRolesInAX(Args _args)
{
    SecurityRole        role;
   while select role order by Role.Name asc
    {
        info(strFmt("%1 --- %2",Role.Name,Role.RecId));
    }
    pause;

}

Regards,

Job to list out all roles to current user in Dynamic AX

Hi,

static void AlfasithListOutRoles2User(Args _args)
{
    SecurityRole        role;
    SecurityUserRole    userRole;
    boolean             added;
    UserInfo            userInfo;
    ;
    while select * from userRole
            where
                userRole.User == xUserInfo::find().id
    while select role where role.RecId == userRole.SecurityRole
    {
        info(strFmt("%1 --- %2",Role.Name,Role.RecId));
    }
}

Regards,

Job to assign the user role to all user in that instance in Dynamic AX

Hi,

static void AssignUserRights(Args _arg)
{
   SecurityRole        role;
    SecurityUserRole    userRole;
    boolean             added;
    UserInfo            userInfo;
    ;

    select role where role.Name == "Accountant";
    while select userInfo
    {
        select * from userRole
            where userRole.SecurityRole == role.RecId &&
                userRole.User == userInfo.id;
            if (!userRole || (userRole.AssignmentStatus != RoleAssignmentStatus::Enabled))
        {
            info(strFmt('Role %1 added to the user %2 successfully.', role.Name, userInfo.id));

            userRole.User = userInfo.id;
            userRole.SecurityRole = role.RecId;
            userRole.AssignmentMode = RoleAssignmentMode::Manual;
            userRole.AssignmentStatus = RoleAssignmentStatus::Enabled;
            SecuritySegregationOfDuties::assignUserToRole(userRole, null);
        }
        else
        {
            warning(strFmt('skipping – Role %1 to the user %2.', role.Name, userInfo.id));
        }
    }
    pause;
}

}

Thursday, June 19, 2014

Issue of refresh in form automatically record points to first potion in X++

Hi,
// use below code in datasource refresh of field modified or depends on your requirement
public void refresh()
{
    int i;
    //Alfasith to retain the cursor position by getting the position and setting the position
        i = dnSalaryCalculationTrans_ds.getposition();
  //  info(int2str(i));
   if(i != 1)  // Declare the k & m as int in global declaration
        m = i;
    if(!(k == m && k == i))
        k = m;
    if(k)
    {
        dnSalaryCalculationTrans_ds.research(); // Data source that I used
        dnSalaryCalculationTrans_ds.refresh();
        dnSalaryCalculationTrans_ds.setposition(k);        
    }
    super();
}

Regards,

Calculate SalesTotal class and related information in X++

Hi,

static void SalesTotalAlfasith(Args _args)
{
    SalesTotals   salesTotals;
    SalesTable   salesTable;
    container   displayFields;
    str    totalTax, amountWithoutTax, amountInclTax;

    salesTable = salesTable::find('SO-101269');
    salesTotals  =  SalesTotals::construct(salesTable, salesUpdate::All);
    salesTotals.calc();
    displayFields =  salesTotals.displayFieldsCurrency(salesTotals.currencyCode());

    print   conpeek(displayFields, TradeTotals::posBalance());
    print   conpeek(displayFields, TradeTotals::posEndDisc());
    print   conpeek(displayFields,TradeTotals::posTaxTotal());
    pause;
}

Regards,

Calculate PurchTotal class and its related information in X++

Hi,

static void PurchTotalAlfasith(Args _args)
{
    PurchTotals   purchTotals;
    PurchTable   purchTable;
    container   displayFields;
    PurchtotalsForm         totalsForm;
    purchTable = PurchTable::find('000396');          
    totalsForm   = PurchtotalsForm::newPurchTotalsForm(purchTable, 1);
    totalsForm.calctotals();
    print " Total quantity = %1", totalsForm.qtyValue();
    print " Total Discount = %1",totalsForm.endDiscValue();
    print " Total Chanrges = %1",totalsForm.sumMarkUpValue(); // this includes all the freight charges..
    print " Total Invoiced = %1",totalsForm.invoiceAmountValue();
    print " Sub total      = &1",totalsForm.sumLinesValue();
    pause;
}

Regards,

Wednesday, June 18, 2014

Expression to get the line no or Serial no in SSRS

Hi,

=RunningValue(Fields!ItemId.Value, CountDistinct, "Tablix9")
Here I used ItemId as unique and table name is Tablix9;

Regards,

Sunday, June 15, 2014

How to call job to another job in axapta using x++ code

Hi,

1. Create simple job Job2  and add it to action menu item.
2. Call Job2  in other Job1 using following code.

   Args                    args; 
    ; 
    
    args = new Args(); 
    args.name(identifierStr(Job2  )); 
    new menuFunction(menuItemActionStr(Job2 ), MenuItemType::Action).run(args);
//Here Job2 in last line is the name of the menu item and in above that is name of the job

Regards,

Wednesday, June 11, 2014

Job that fetched from the current company / companytInfo table records sample in Dynamic AX

Hi,

static void CompanyInformations(Args _args)
{
    CompanyInfo   companyInfo = CompanyInfo::find();

    print  "CompanyPhone                = " +companyInfo.phone();
    print  "CompanyTeleFax              =" +companyInfo.teleFax();
    print  "CompanyGiro                 =" +companyInfo.Giro;
    print  "CompanyCoRegNum             =" +companyInfo.CoRegNum;
    print  "CompanyEnterpriseNumber     =" +companyInfo.EnterpriseNumber;
    print  "CompanyName                 =" +companyInfo.name();
    print  "CompanyAddress              =" +companyInfo.postalAddress().Address;
    print  "standardCurrency            =" +CompanyInfo::standardCurrency();
    pause;
}

Regards,

Expression to get the page no as 1 of 2 in SSRS

Hi,

=Cstr(Globals!PageNumber) & Space(2) & Labels!@SYS26401 & space(2) & Cstr(Globals!TotalPages)

Regards,

How to change the language in POS in Retail Dynamic AX

Hi,

1. Change the en-us to
On the Store: (StoreName)/Retail/Common/Retail channels/Retail stores under the Regional settings -> Language
"ar"
On the Staff: (StoreName)/Retail/Common/Workers under Profile -> Language
"ar"

Then run the job : N-1060

Regards,

Error: 'The default Report Server Configuration ID could not be found in the SRSServers table.' in Dynamic AX

Hi,

Error: 'The default Report Server Configuration ID could not be found in the SRSServers table.'

Solution:
1. Config reporting service.
System administration> Setup> Business intelligence> Reporting services> Report servers>

change server name to <YourServerName>(here SystemName) as well as ensure that your Report Manager URL, Web service URL and Application Object Server information reflect this server as highlighted on the screenshot.
Then validate it as well make it default configuration

2. Deploy all the reports.
AOT> SSRS reports> Reports> find your report> right click> Deploy element
Then it works good.
Regards,


Error: The query could not be processed. The field(s) salesTableTmp.AddedFiled do not exist in the report provider table salesTableTmp. in Dynamic Reports.

Hi,

Error:
The query could not be processed. The field(s) salesTableTmp.AddedFiled do not exist in the report provider table salesTableTmp.

When opening the customized standards reports like SalesInvoice, PO etc. above error will be prompted sometimes.

Solution:
Synchronize the table used for DP tmp table and restart the reporting server.
The error will be cleared.

Regards,

Error: Parameter _reportName cannot be null or empty. SSRS in Dynamic AX

Hi,

"Parameter _reportName cannot be null or empty."
The AssetBasisRdlContract.getAttributes() reflection API could not create and return the SrsReportNameAttribute object. Please check the parameters."

This error will be prompted on opening any reports / it can be standard or customized.
Solution:
 Need to compile class AssetBasisRdlContract
 If compile some time it may again show some other class again so it will chain.
permanent solution is full compilation of all the class(standard).

Regards,

Expression in SSRS

Hi,

SSRS Expressions

Global : Global expressions executes/works in Page Header and Footer parts only.
ExecutionTime() shows date and time at when report executes
PageNumber() shows page number of each and every page but allowed only in page header and footer
ReportName() displays name of the active report what name we have assigned to the active report
UserId() shows current user name with domain name.
Language() displays language of execution

Arithmetic Operation
^ power of
* multiplication
/ divides two numbers and returns a floating point result
\ divides two numbers and returns a integer result
Mod(X,Y) divides two numbers and returns remainder only
+ adds the numbers and concatenates strings
- subtraction the numbers
Comparison
Known operators : 
< <= > >= <> 
Like compares two strings and return true if matched or else returns False. Ex: =Fields!Title.Value Like Fields!LoginID.Value
Is compare two object reference variables Ex: = Fields!Title.Value Is Null
Concatenation
+ and & symbols uses for concatenation
Logical
Known: 
And, Not, Or 
Xor SELECT * FROM users where firstname = 'Larry' XOR lastname = 'Smith'
AndAlso First condition will check first and if it is true only, goes to next or else it won't need to check. Because our execution time is saving in a logical operation in which more conditions is combined using AndAlso function.
OrElse same like above

Common Functions
Text
Asc, AscW returns an integer value represents character code corresponding to a character
Chr, chrw returns the character associated with the specified character code
Filter =Filter(Fields!Title.Value,"Pr",true,0)
Format
=Format(Fields!Price.Value, "#,##0.00"), Format(Fields!Date.Value, "yyyy-MM-dd")
FormatCurrency =formatcurrency(Fields!SickLeaveHours.Value,3)
FormatDateTime =FormatDateTime(Fields!BirthDate.Value,Integer)
Examples:
0 returns 6/3/1977
1 returns Friday, June 03, 1977
2 returns 6/3/1977
3 returns 12:00:00AM
4 returns 00:00
FormatNumber =FormatNumber(Fields!EmployeeID.Value,2)
Examples: 2.00
FormatPercent ="Percentage : " & formatpercent(Fields!SickLeaveHours.Value)
GetChar =GetChar(Fields!Title.Value,5)
InStr =InStr(Fields!Title.Value,"a")
InStrRev =Instrrev(Fields!Title.Value,"a")
LCase Change strings into lower case
=Lcase(Fields!Title.Value)
Left Returns left side characters from a string
=Left(Fields!Title.Value,4)
Len Finds length of a string
=Len(Fields!Title.Value)
LSet Returns some length of a string from left
=Lset(Fields!Title.Value,5)
LTrim Trim left side of a string
=Ltrim(" "&Fields!Title.Value)
Mid Returns characters from the mentioned starting position
=Mid(Fields!Title.Value,InSTrRev(Fields!Title.Value,"T"))
Replace Replaces one string with another
=Replace(Fields!Title.Value,"a","A")
Right Returns right side characters from a string
=Right(Fields!Title.Value,10)
RSet Returns some length of a string from left
=Rset(Fields!Title.Value,5)
RTrim Trim left side of a string
=Rtrim(Fields!Title.Value & " ")
Space Specifies some spaces within strings
=Fields!Title.Value & Space(5) & Fields!Title.Value
StrComp Returns a value indicating the result of a string comparison

vbBinaryCompare 0 Perform a binary comparison.
vbTextCompare 1 Perform a textual comparison.
string1 is less than string2 -1
string1 is equal to string2 0
string1 is greater than string2 1
string1 or string2 is Null Null
StrConv
=Strconv(Fields!Title.Value,vbProperCase)
=Strconv(Fields!Title.Value,vbLowerCase)
=Strconv(Fields!Title.Value,vbUpperCase)
StrDup Returns a string or object consisting of the specified character repeated the specified number of times.
=StrDup(3,"M")
StrReverse =StrReverse(Fields!Title.Value)
Trim =Trim(" "& Fields!Title.Value & " ")
UCase =Ucase(Fields!Title.Value)



Date & Time
CDate Converts a object into date format
=Format(CDate(Fields!BirthDate.Value),"MMMM yyyy")
DateAdd Returns a datetime that is the result of adding the specified number of time interval units to the original datetime.

=dateadd("m",12,Fields!BirthDate.Value)
DateDiff Find number of days, months and years between two dates
=datediff("d",Fields!BirthDate.Value,Now)
DatePart DatePart(DateInterval.Weekday, CDate("2009/11/13"), FirstDayOfWeek.Monday) returns 5 (Friday)
DateSerial for first day of the month
=DateSerial(Year(Now), Month(Now), 1)
for the last day of the month
=DateSerial(Year(Now), Month(Now)+1, 0)
DateString Returns string value of system date
=datestring()
DateValue Returns current date
Day Returns day value from date
=day(Fields!BirthDate.Value)
FormatDateTime =FormatDateTime(Fields!BirthDate.Value,Integer)
Examples:
0 returns 6/3/1977
1 returns Friday, June 03, 1977
2 returns 6/3/1977
3 returns 12:00:00AM
4 returns 00:00
Hour =Hour(Fields!BirthDate.Value)
Minute =Minute(Fields!BirthDate.Value)
Month =Month(Fields!BirthDate.Value)
MonthName =MonthName(Month(Fields!BirthDate.Value))
Now Indicates current month
=Now() or =Now
Second =Second(Fields!BirthDate.Value)
TimeOfDay =TimeOfDay()
Returns a date value containing the current time of day according to your system
Timer =Timer()
Returns number of seconds elapsed since midnight
TimeSerial =TimeSerial(24,60,60)
Returns a date value representing a specified hour, minute and second
TimeString =TimeString()
Returns string value representing the current time of day according to your system
TimeValue Returns a date value set to jan 1 of year 1
=TimeValue(Fields!BirthDate.Value)
Today Returns Current date
Weekday Returns an integer value representing day of week
=WeekDay(Fields!BirthDate.Value)
WeekdayName =WeekdayName(Weekday(Fields!BirthDate.Value))
Returns name of the day of week
Year =year(Fields!BirthDate.Value)
Returns year of specified date
Math

Abs Returns the absolute value
=Abs(-2.36)
BigMul Returns multiplication value of two specified numbers
=BigMul(2,3)
Ceiling Returns next highest value
=Ceiling(2.67)
Cos
=Cos(2.33)
Returns cos value for specified number
Cosh
Returns hyperbolic cos value
=Cosh(2.33)
DivRem
=DivRem(23,2,5)
Fix
=Fix(23.89)
Returns integer portion
Floor
=Floor(24.54)
Returns largest integer
Int
=Int(24.78)
Returns integer portion of a number
Log
=Log(24.78)
Returns logarithm value
Log10
=Log10(24.78)
Returns the base 10 logaritm value
Max
=Max(Fields!EmployeeID.Value)
Returns larger value in the specified values
Min
=Min(Fields!EmployeeID.Value)
Returns smaller value in the specified values
Pow
=Pow(Fields!EmployeeID.Value,2)
Returns power of value for specified number
Rnd
=Rnd()
Returns a random number
Round
=Round(43.16)
Returns rounded value to the nearest integer
Sign
=Sign(-34534543)
Sin
=Sin(Fields!EmployeeID.Value)
Returns the sin value
Sinh
=Sinh(Fields!EmployeeID.Value)
Returns the hyperbolic sin value
Sqrt
=Sqrt(Fields!EmployeeID.Value)
Returns square root value
Tan
=Tan(Fields!EmployeeID.Value)
Returns the tan value
Tanh
=Tanh(Fields!EmployeeID.Value)
Returns the hyperbolic tan value
Inspection
IsArray
=IsArray(Fields!EmployeeID.Value)
Returns a boolean value indicating whether the specified object is array or not
IsDate
=IsDate(Fields!BirthDate.Value)
Returns a boolean value indicating whether the specified object is Date or not
IsNothing
=IsNothing(Fields!EmployeeID.Value)
Returns a boolean value depends on specified object is Nothing or not
IsNumeric
=IsNumeric(Fields!EmployeeID.Value)
Returns a boolean value depends on specified object is Numeric value or not
Program Flow
Choose
=CHOOSE(3, "Red", "Yellow", "Green", "White")
Returns a specific value using index in a list of arguments
IIf
=IIF(Fields!EmployeeID.Value>10,"Yes","No")
Returns any one value depends on condition
Switch
=Switch(Fields!EmployeeID.Value<10,"Red",
Fields!EmployeeID.Value>10,"Green")
Evaluates list of expressions
Aggregate
Avg
=Avg(Fields!EmployeeID.Value)
Returns average value for all specified values
Count
=Count(Fields!EmployeeID.Value)
Returns count of all specified values
CountDistinct
=CountDistinct(Fields!EmployeeID.Value)
Returns count of all distinct values
CountRows
=CountRows()
Returns count of rows
First
=First(Fields!EmployeeID.Value)
Returns first for all specified values
Last
=Last(Fields!EmployeeID.Value)
Returns last for all specified values
Max
=Max(Fields!EmployeeID.Value)
Returns max for all specified values
Min
=Min(Fields!EmployeeID.Value)
Returns min for all specified values
StDev
=StDev(Fields!EmployeeID.Value)
Returns standard deviation value
StDevP
=StDevP(Fields!EmployeeID.Value)
Returns Population standard deviation value
Sum
=Sum(Fields!EmployeeID.Value)
Returns sum of all values
Var
=Var(Fields!EmployeeID.Value)
Returns variance of all values
VarP
=Var(Fields!EmployeeID.Value)
Returns population variance of all values
RunningValue
=RunningValue(Fields!EmployeeID.Value,sum,nothing)
Returns running aggregate of the specified
expression
Financial
DDB DDB (Double Declining Balance) method computes depreciation of an asset for a specified period.
Syntax: DDB (Cost, Salvage, life, period, factor)
FV FV (Future Value) of an investment based on periodic, constant payments and a constant interest rate.
Syntax: FV (rate, nper, pmt, pv, type)
IPmt IPmt (Interest Payment) for a given period for an investment based on periodic, constant payment and a constant interest rate
IPMT (rate, per, nper, pv, fv, type)
IRR IRR (Interest Rate of Return) for a series of cash flows represented by the numbers in values.
IRR(values,guess)
MIRR MIRR ( Modified internal rate of return ) for a series of periodic cash flows
MIRR(values,finance_rate,reinvest_rate)
NPer Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.
NPER (rate, pmt, pv, fv, type)
NPV Calculates the net present value of an investment by using a discount rate and a series of future payments (negative values) and income (positive values).
Syntax: NPV(rate,value1,value2, ...)
Pmt Calculates the payment for a loan based on constant payments and a constant interest rate.
PMT(rate,nper,pv,fv,type)

PPmt Returns the payment on the principal for a given period for an investment based on periodic, constant payments and a constant interest rate.
PPMT(rate,per,nper,pv,fv,type)
PV Returns the present value of an investment. The present value is the total amount that a series of future payments is worth now. For example, when you borrow money, the loan amount is the present value to the lender.
PV(rate,nper,pmt,fv,type)
Rate Returns the interest rate per period of an annuity. RATE is calculated by iteration and can have zero or more solutions.
RATE(nper,pmt,pv,fv,type,guess)

SLN Returns the straight-line depreciation of an asset for one period.
SLN(cost,salvage,life)
SYD Returns the sum-of-years' digits depreciation of an asset for a specified period.
SYD(cost,salvage,life,per)
Conversion
CBool Convert to boolean
=CBool(fields!EmployeeID.Value)
CByte Convert to byte
CChar Convert to char
CDate Convert to date
CDbl Convert to double
CDec Convert to decimal
CInt Convert to integer
CLng Convert to long
CObj Convert to object
CShort Convert to short
CSng Convert to single
CStr Convert to string
Fix =Fix(32.342143)
Returns integer portion of a number
Hex =Hex(Fields!EmployeeID.Value)
Returns a hexadecimal value of a number
Int =Int(43.44)
Returns integer portion of a number
Oct =Oct(Fields!EmployeeID.Value)
Returns a octal value of a number
Str =Str(Fields!EmployeeID.Value)
Returns string value of a number
Val =Val("32.43")
Returns numeric value in string format
Miscellaneous
Previous =Previous(Fields!EmployeeID.Value)
Returns the previous value

REF: http://krishhdax.blogspot.in
Regards,

Monday, June 9, 2014

Basic RunBaseClass and debugger flow in Dynamic AX

Hi,

1.Main class for declaration of fields.

class CustCreateRunBaseClass extends RunBase
{
    DialogField fieldAccount;
    DialogField fieldName;
    DialogField fieldGroup;
    DialogField fieldCurrency;
    DialogField fieldPaymTermId;
    DialogField fieldPaymMode;
    CustAccount custAccount;
    CustName custName;
    CustGroupId custGroupId;
    CurrencyCode currencyCode;
    CustPaymTermId paymTermId;
    CustPaymMode paymMode;
}

2. Main class - Code starts from here.
public static void main(Args _args)
{
    CustCreateRunBaseClass CustCreateRunBaseClass = new CustCreateRunBaseClass();
    if (CustCreateRunBaseClass.prompt())
    {
        CustCreateRunBaseClass.run();
        CustCreateRunBaseClass.insertTable();
    }
}

3. One constructor created it calls the class prompt.
protected Object dialog()
{
    Dialog dialog;
    DialogGroup groupCustomer;
    DialogGroup groupPayment;
    dialog = super();
    dialog.caption("Customer information"); // Name to the dialog
    fieldAccount = dialog.addField(extendedTypeStr(CustVendAC),"Customer account");
    fieldName =  dialog.addField(extendedTypeStr(CustName));
    dialog.addTabPage("Details"); // Adding tab page
    groupCustomer = dialog.addGroup("Setup");
    fieldGroup = dialog.addField(extendedTypeStr(CustGroupId));
    fieldCurrency = dialog.addField(extendedTypeStr(CurrencyCode));
    groupPayment = dialog.addGroup("Payment");
    fieldPaymTermId = dialog.addField(extendedTypeStr(CustPaymTermId));
    fieldPaymMode = dialog.addField(extendedTypeStr(CustPaymMode));
    return dialog;
}

4. Debugger will not passes over but this following method is mound the fields into container.
It is the standard to convert or considering the fields in dialog as container but no use, so just return true.

public container pack()
{
    return conNull();
}

public boolean unpack(container _packedClass)
{
    return true;
}

5.Once the OK button clicks it calls the run() but just before click ie before super() following getFromDialog() will be called.

public boolean getFromDialog()
{
    custAccount = fieldAccount.value();
    custName = fieldName.value();
    custGroupId = fieldGroup.value();
    currencyCode = fieldCurrency.value();
    paymTermId = fieldPaymTermId.value();
    paymMode = fieldPaymMode.value();
    return super();
}

6. After click action following run() method will be called.

public void run()
{
    info("You have entered customer information:");
    info(strFmt("Account: %1", custAccount));
    info(strFmt("Name: %1", custName));
    info(strFmt("Group: %1", custGroupId));
    info(strFmt("Currency: %1", currencyCode));
    info(strFmt("Terms of payment: %1", paymTermId));
    info(strFmt("Method of payment: %1", paymMode));
}

7. Here I added user defined set of code for inserting my field values in to table
Here I called next to run()

private void insertTable ()
{
    MyTable     MyTable;
    MyTable.Addressing = custName;
    MyTable.HcmPersonnelNumberId = custAccount;
    MyTable.insert();
}


Regards,

Sunday, June 8, 2014

To duplicate a record in the same table in Dynamic AX

Hi,

static void ToDuplicate1RecordIntoSameTable(Args _args)
{
MyTable MyTable1;
MyTable MyTable2;
MyTable1 = myTable::find('0000526');
ttsBegin;
MyTable2.data(MyTable1);
MyTable2.HcmPersonnelNumberId = '000555'; // Index fileds needs to changed else it throws error
if (!MyTable2.validateWrite())
{
    throw Exception::Error;
}
MyTable2.insert();
ttsCommit;
    info("Duplicate record inserted");
}

Regards,

Customization or completed development of SalesInvoice report in Dynamic AX 2012

Hi,

DP - SalesInvoiceDP
Contract - SalesInvoiceContract
Conttroller - SalesInvoiceController
Temporary Header table - salesInvoiceHeaderFooterTmp
Temporary Header table - salesInvoiceLocalizationTmp
Temporary lines table - salesInvoiceTmp
(Its not tempDB but the records will be deleted once the transaction completes)

Details about DP and explaination of few method
(Not all the method I explaied only mandrantry method)
I added few fields in the lines table and inserted values.


Methods Description Country
generateInvoiceHeaderLocalizationData Populates a SalesInvoiceHeaderFooterTmp record for the Eastern Europe countries. EA
getDataFromContract Initializes data from the contract class. (Overrides the getDataFromContract Method.)  
getInvoiceCount_IN Calculates the invoice count. For line count  
insertCreditNoteSummaryLine_PL Insert the credit note summary line. (Overrides the insertCreditNoteSummaryLine_PL Method.)  
insertDataInSalesInvoiceTmp_IN Inserts data into SalesInvoiceTmp_IN table. Only for India
insertIntoSalesInvoiceHeaderFooterTmp Inserts the invoice header information.  
insertIntoSalesInvoiceLocalizationTmp Inserts the invoice detail information.  
insertIntoSalesInvoiceTmp Inserts the invoice detail information.  
processReport Processes the report business logic. (Overrides the processReport Method.)  
Regards,

Saturday, June 7, 2014

Customization or complete development of Purchase order report in Dynamic AX 2012

Hi,

DP - PurchPurchseOrderDP
Contract - PurchPurchaseOrderContract
Controller - PurchPurchaseOrderController.
Temporary Header table - PurchPurchaseOrderHeader
(Its not tempDB but the records will be deleted once the transaction completes)
Temporary lines table - PurchPurchaseOrderTmp

Details about DP and uses of main method
(Not all the method I explained only mandatory methods)

Method Description
setPurchPurchaseOrderDetails Inserts the record field data into the temporary table. (Here I added my customized line fields in to the table)
setPurchPurchaseOrderHeader Inserts common data into the template table buffer.
in lines table standard passes the values by 1 to 1 relation where as in header by insert_recordset technique fetching from PurchTable

Regards,

Thursday, June 5, 2014

Getting String value for the Amount in Dynamic AX

Hi,

// By fasith for getting the string value of amount
   SalesInvoiceTmp.StrTotAmount = numeralsToTxt_in(_custInvoiceJour.InvoiceAmount);

Regards,

Wednesday, June 4, 2014

Opening the table through x++ code - Dynamic AX

Hi,

static void OpenTableAlfasith(Args _args)
{
SysTableBrowser sysTableBrowser = new SysTableBrowser();
;

sysTableBrowser.run(tablenum(HCMWorker));// Table I selected is HCMWorker
}

Regards,

Tuesday, June 3, 2014

Code to get the customer city by customer ID in dynamic AX - Relation between CustTable, Dirparty table, logisticAddress table in dynamic AX

Hi,

static void GetCustCityAlfasith(Args _args)
{
    Custtable    Custtable;
    Str Description;
    Str    address;
    ;
    Custtable = Custtable::find("1101");
    info(strfmt("Location : %1",Dirparty::PrimarypostalAddress(Custtable.Party).displayLocationDescription()));
    info(strfmt("City     : %1",Dirparty::primaryPOstalAddress(Custtable.Party).City));
    info(strfmt("Country  : %1",Dirparty::primaryPOstalAddress(Custtable.Party).CountryRegionId));
}

Regards,

Sunday, June 1, 2014

Appreciate to Microsoft developers for un-imaginable very easy concept in Dynamic AX - Complete intitialization, condition & incrementation as datasource in Dynamic AX

Hi,

Ref:
Form vendInvoiceJournal
method:printTaxUnrealizedInvoice


Here initialization as first record in the data source;
condition as complete data source;
increment as next record in the data source;

    for (vendInvoiceJourLocal = getFirstSelection(vendInvoiceJour_ds);
         vendInvoiceJourLocal;
         vendInvoiceJourLocal = vendInvoiceJour_ds.getNext())

//Brilliant Microsoft developer developed above syntax- but very simple which we cant imagine on normal

Regards,

Job to creating Employee / or upload employee in Dynamic AX

Hi,

Use below code as method to your class that fetches the workbook and pass the values as container to the below method.

private void  EmployeeImportOrCreate(container _c)
        {
            HcmWorkerImportService                      hcmWorkerImportService;
            HcmWorkerImport                             hcmWorkerImport;
            HcmWorkerImport_HcmWorker                   hcmWorkerImport_HcmWorker;
            HcmWorkerImport_DirPerson_DirPerson         hcmWorkerImport_DirPerson_DirPerson;
            HcmWorkerImport_HcmPersonPrivateDetails     hcmWorkerImport_HcmPersonPrivateDetails;
            HcmWorkerImport_DirPersonName               hcmWorkerImport_DirPersonName;
            HcmWorkerImport_DirPartyPostalAddressVie    hcmWorkerImport_DirPartyPostalAddressVie;

            HcmWorkerImport_HcmEmployment               hcmWorkerImport_HcmEmployment;
            HcmWorkerImport_HcmEmploymentDetail         hcmWorkerImport_HcmEmploymentDetail;
            HcmWorkerImport_HcmWorkerTitle              hcmWorkerImport_HcmWorkerTitle;
            ;
            // Create EMP ID personnel Number ...
            hcmWorkerImportService          = HcmWorkerImportService::construct();
            hcmWorkerImport                 = new HcmWorkerImport();
            hcmWorkerImport_HcmWorker       = hcmWorkerImport.createHcmWorker().addNew();
            hcmWorkerImport_HcmWorker.parmPersonnelNumber(conpeek(_c, EmployeeNumber));

            hcmWorkerImport_DirPerson_DirPerson = hcmWorkerImport_HcmWorker.createDirPerson().addNew();
            hcmWorkerImport_DirPerson_DirPerson.parmInitials(conpeek(_c, Initials));
            hcmWorkerImport_DirPerson_DirPerson.parmProfessionalTitle(conpeek(_c, Position));
            // For his name first / middle / last name...
            hcmWorkerImport_DirPersonName       = hcmWorkerImport_DirPerson_DirPerson.createDirPersonName().addNew();
            hcmWorkerImport_DirPersonName.parmFirstName(conpeek(_c, FirstName));
            hcmWorkerImport_DirPersonName.parmMiddleName(conpeek(_c, MiddleName));
            hcmWorkerImport_DirPersonName.parmLastName(conpeek(_c, LastName));
            //For his Birth date and Gender...
            hcmWorkerImport_HcmPersonPrivateDetails = hcmWorkerImport_DirPerson_DirPerson.createHcmPersonPrivateDetails().addNew();
            hcmWorkerImport_HcmPersonPrivateDetails.parmBirthDate(HrmImportEmployeeMasterdata::convDate(conpeek(_c, BirthDate)));
            hcmWorkerImport_HcmPersonPrivateDetails.parmGender(HrmImportEmployeeMasterdata::convGender(conpeek(_c, Gender)));
            //Address pf the worker related information...
            hcmWorkerImport_DirPartyPostalAddressVie = hcmWorkerImport_DirPerson_DirPerson.createDirPartyPostalAddressView().addNew();
            hcmWorkerImport_DirPartyPostalAddressVie.parmCountryRegionId(HrmImportEmployeeMasterdata::defaultCountryRegionId());
            hcmWorkerImport_DirPartyPostalAddressVie.parmRoles(HrmImportEmployeeMasterdata::defaultRole());
            hcmWorkerImport_DirPartyPostalAddressVie.parmStreet(conpeek(_c, Address));
            hcmWorkerImport_DirPartyPostalAddressVie.parmStreetNumber(conpeek(_c, streetnum)));
            hcmWorkerImport_DirPartyPostalAddressVie.parmZipCode(conpeek(_c, PostalCode));
            // Releasin to company address book but here this code add the cur3eest worker to current address book
            hcmWorkerImport_HcmEmployment   = hcmWorkerImport_HcmWorker.createHcmEmployment().addNew();
            hcmWorkerImport_HcmEmployment.parmLegalEntity(curext());

            hcmWorkerImport_HcmEmploymentDetail = hcmWorkerImport_HcmEmployment.createHcmEmploymentDetail().addNew();
            hcmWorkerImport_HcmEmploymentDetail.parmWorkerStartDate(
                                            datetobeginUtcDateTime(
                                            HrmImportEmployeeMasterdata::convDate(conpeek(_c, DateOfHiring)),
                                            DateTimeUtil::getUserPreferredTimeZone()));
            //Creation completion
            hcmWorkerImportService.create(hcmWorkerImport);

        }

Regards,

Basic table information in Dynamic AX

Hi,

Table name Information
HcmWorker Employee information
CustTable Customer information
PurchTable Purchase related information
EcoresProduct  Product information
InventTable Item information (released products)
SalesTable Sales information
VendTable  Vendor information
ProjTable Project information
Retail* All the retail related information table starts with retail as prefix
UserInfo User information
All the above tables are master table so the bears lines table / multiple lines tables

Regards,

Dimension Lookup for both standard and Custom dimension in D365

Hi,  /// <summary>     /// Provides the look-up interaction for the individual dimension value lookup controls.     /// </summary&g...