Showing posts with label ATTACHMENT. Show all posts
Showing posts with label ATTACHMENT. Show all posts

Wednesday, November 8, 2017

AX DEBUGGER NOT OPENING : DYNAMICS AX DEBUGGER IS BLANK BREAKPOINT

AX DEBUGGER NOT OPENING : DEBUGGER IS BLANK

Many a times we have faced a problem that, when we try to debug our X++ code, we simply put break points in our code and run the functionality, but it happens that the AX debugger opens but with a blank screen and the break point is not called.
So to overcome this issue,here are the few things that needs to be checked in order to properly run the debugger.

Make sure that enable breakpoint on server configuration as well as client configuration is checked.
On development environment, go to Tools--> Options--> Development. Make sure that the Debug mode is set to "When Breakpoint".
Make sure that the user must belong to the Microsoft Dynamics AX Debugging Users local group on the computer.

If not added, add the user to this group. After being added to the group, you'll need to logout of your windows session and log back in. Once you log back in, open AX, set your breakpoints, run your process and see if things work out for you.


Friday, June 16, 2017

ARRAYS :MICROSOFT DYNAMICS 365:DYNAMICS AX 2012 X++

ARRAYS

An array is a collection of variables that are all of the same type. The elements of an array are accessed with simple integer indexes. For example:
int myArray[10]; // Fixed-length array with 10 integers
myArray[4] = 1; // Accessing the 4th element in the array
You use a separate statement to initialize each element in an array.
Note
When you use a Container data type or an Array object to create a collection, you can initialize multiple elements by using a single statement.
There are three kinds of arrays:
·         Dynamic
·         Fixed-length
·         Partly on disk
X++ only supports one-dimensional arrays. It is possible, however, to mimic the behavior of multiple array indices.
Note
Variables in objects and tables can be declared as arrays (this is used in address lines in the standard application).
An Array collection class enables you to store objects in an array.

Declaring Arrays

Array declaration
=
datatype Variable { , Variable } ;
Variable
=
Identifier arrayoptions
Arrayoptions
=
[ [ Length ] [, Memory ] ]
If a Length is specified, the array is a fixed-length array with Length elements. Otherwise, it is a dynamic array.
If Memory is specified, it is a partly on disk array.
X++
static void Job1(Args _args)
{
    // A dynamic array of integers
    int i[]; 
 
    // A fixed-length real array with 100 elements
    real r[100]; 
 
    // A dynamic array of dates with only 10 elements in memory
    date d[,10]; 
 
    // A fixed length array of NoYes variables with
    // 100 elements and 10 in memory
    NoYes ny[100,10];
    
    print "Done.";
    pause;
}

Array Indices

Array indexes begin at 1. The first item in the array is called [1], the second [2], and so on.
The syntax for accessing an array element is:
ArrayItemReference = ArrayVariable [ Index ]
where ArrayVariable is the identifier of the array, and Index is the number of the array element. Index can be an integer expression.
For example, a[9] accesses item number 9 in array a.
In X++, item zero[0] is used to clear the array! Assigning a value to index 0 in an array resets all elements in the array to the default value. For example,
intArray[0] = 0; //Resets all elements in intArray

Dynamic Arrays

A dynamic array is declared with an empty array option (that is, only square brackets):
//Dynamic array of integers
int intArray[];
// Dynamic array of variables of type Datatype
Datatype arrayVariable[];

Fixed-length Arrays

A fixed-length array can hold the number of items that is specified in the declaration. Fixed-length arrays are declared like dynamic arrays but with a length option in the square brackets:
boolean boolArray[100]; //Fixed-length array of booleans with 100 items

Partly On Disk Arrays

Partly on disk arrays are declared either as dynamic or fixed-length arrays with an extra option that declares how many items should be held in memory. The other items are stored on disk and automatically loaded when referenced.
//Dynamic integer array with only 100 elements in memory.
 
int arrayVariable [ ,100];
//Fixed-length string array with 1000 elements, and only 200 in memory.
 
str arrayVariable [1000,200]

Multiple Array Indexes

Some languages, such as C++ and C#, allow you to declare arrays with more than one index; that is, to define "arrays of arrays." You cannot directly create multiple array indexes in X++ - only one-dimensional arrays are supported. However, you can implement multiple indexes by using the following scheme.
If you wanted to declare an array with two dimensions, for example, for holding an amount earned by country by dimension, and there were 10 countries and 3 dimensions, declare the following:
real earning[10, 3];
This is not possible in Microsoft Dynamics AX. Instead, you can define a one-dimensional array with the number of elements that is the product of the elements in each dimension:
real earnings[10*3];
To refer to earnings[i,j], write:
earnings[(i-1)*3 +j]
You could wrap this into a macro:
#localmacro.earningIndex
(%1-1)*3+%2
#endmacro
And then write:
earnings[#earningIndex(i,j)]
The previous scheme can be extended to any number of dimensions. The element a[i1, i2, ..., ik] can be accessed by computing the offset into an array containing (d1*d2*...*dk) elements:
(i1 - 1)*d2*d3*..*dk +
(i2 - 1)*d3*d4*...*dk + .... +
(ik-1 -1)*dk +

(ik-1)

Saturday, October 15, 2016

CREATE A BATCH JOB IN AX 2012 AND SEND THE REPORT AS EMAIL ATTACHMENT VIA BATCH JOB SCHEDULER

STEPS TO CREATE A BATCH JOB IN AX 2012  AND SEND THE REPORT AS EMAIL ATTACHMENT THROUGH BATCH JOB.

This document covers the creation of batch job for Customers Report as an example.
Go to Accounts Receivable > Reports > Customer > Customers Report
Select the Customers range using select button in the customers report dialog box


Click on Destinations button to specify the print destination of the report
Various Print Destinations are available in Print Destination Settings
Print destination as screen is not allowed for a report runs as batch.
Select the E-mail and enter the email addresses as shown in the screen shot below. Select the File format from the different file format options available in the lookup.

Click OK after selecting Print Destination.
In the Customers Dialog box Click on Batch Tab.


Select the Batch processing check box.

Set the following options:
Task Description – Enter a description for the job.

Batch group - Assign the job to a batch group.
Batch groups are designed to enable you to run specific types of jobs on a specific batch server, or to run jobs on batch servers that are available at specific times. Batch groups are created by system administrators.
Private – Select this check box to restrict other users from processing your batch job. A private job can be run only by the user who submitted it, from the Set up batch processing form, and only on the computer where the user is logged on.

Click Recurrence to configure a batch job to recur on a specific schedule.


Time zone: Select the time zone.
Starting time: Enter the time that the batch job starts at.
Starting date:  Enter the date that the batch job starts at.
No end date: select this option to make the job run forever.
End after: Select this option to make the batch job stop after some occurrences.
Count:   Enter the specific number of recurrences.
End by:  Select this option to make the batch job stop at specific date
End date: Enter the last date of the job run.
Minutes:  select this option to make the job run for every specified number of minutes.
Enter the number of minutes in the Count Field.
Hours:  select this option to make the job run for every specified number of hours.
Enter the number of hours in the Count Field.
Days: select this option to make the job run for every specified number of days.
Enter the number of days in the Per field.
To run the batch job daily from Monday to Friday, click Every weekday
Weeks: select this option to make the job run for every fixed weekly intervals.
Enter the number of weeks in the Fixed weekly interval field, and then select the days on which you want the job to run.
For example, if you type 2 in the Fixed weekly interval field, and then select Monday and Wednesday, the batch job runs every two weeks on Monday and Wednesday.

Months:  select this option to make the job run for every fixed monthly intervals.
To set the day of the month and the frequency of the batch job, select Repeat a specific day by a fixed interval.
For example, if you enter 1 in the Day field and 3 in the Per field, the batch job runs on the first of the month for every three months.
To set a particular day of the week and the frequency of the batch job, select Repeat a specific weekday by a fixed interval.
For example, if you select Last in the Week field and Friday in the Weekdays field, and then enter 6 in the Per field, the batch job runs for every six months on the last Friday of the month.

Years:  select this option to make the job run for every year.
Select Repeat once a year or Repeat a specific weekday a year, and then set the starting date.
For example, if you select First in the Week field, Monday in the Weekdays field, and June in the Month field, the batch job runs for every year on the first Monday in June.



Click Alerts button.





Configure alerts for a batch job as shown in the following screen and Click OK.


Once the recurrence and alerts configuration is done click OK on the Customers Report dialog box.







The below message box pops up after the batch is created and added to queue.



Presetup’s needs to be done before sending the report as Email attachment
Related Posts Plugin for WordPress, Blogger...