Tuesday, August 19, 2008

Transactional Analysis By UdhayAnand

Hi All !

In this article, I am going to discuss about Transactional Analysis. Transactional skills is essential for every person to shine in life. In TA, we have to understand the five ego states of human being.

They are

Critical Parent - In this ego state, man criticises as and when a person makes mistakes. This is more of assertive behaviour. Also, the person in this state never tolerates wrong things and urges to correct them immediately. He tries to command and influence people in an hard way.

Nurturing Parent - He encourages poeple with warmth. Accepts others as they way they are and try to correct them during the course of their interaction in a smooth way.

Adult - Exhibits strong analytical skills at this state. However, emotions will be absent in this state. He gives an un-biased opinion subsequent to lengthy investigations.

Natural Child - In this state, creativity of one's will come out maximum. They enjoy the work at this state.

Adopted Child - Tries to adjust / co-up with others. Accepts others judgement and proceed further as such.

Wednesday, June 4, 2008

Choose a Printer Tray in Dynamics AX

The PrintJobSettings Object allows you to choose from which tray to print. First ask for the Number of trays on the printer. Notice that the returned value may not correspond to reality. It may be much bigger than the number of trays on the printer itself. Once it returned 20 for a printer with 3 trays.

int trayNums = settings.getNumberOfTrays();

Next step is try and error. Open each tray on the printer and write the number on some sheet of papers. Than you have to try what Tray ID corresponds to which tray.

Args args;
ReportRun reportRun;
PrintJobSettings settings;
int trayId;
;

args = new Args();
args.name(reportStr(MyDummyReport));

reportRun = new ReportRun(args);
settings = reportRun.printJobSettings();
settings.clearTrayPageCopy();
trayId = settings.getTray(1); // maybe 261, etc.
settings.addTrayPageCopy(trayId,1); // try from 1 .. getNumberOfTrays()
reportRun.run();

Check out what trayID value leads to what printing behaviour. Now store the (trayID | real tray number) pair in a paramter table or further use. If the printer is exchanged make sure that your ID |Tray pairs still fit.

Calling a stored procedure

Here is a piece of code to execute a stored procedure thru Axapta

static void storedProcedure(Args _args)
{
LogInProperty Lp = new LogInProperty();
CCADOConnection myConnection;
Statement myStatement;
ResultSet myResult;
;

LP.setServer("SeverName");
LP.setDatabase("DataBaseName");
Lp.setUsername("sa");
Lp.setPassword("sa");

try
{
myConnection = new OdbcConnection(LP);
}
catch
{
info("Check username/password.");
return;
}

myStatement = myConnection.createStatement();
myResult = myStatement.executeQuery('EXEC [inventtablesp]');//stored procedure name
while (myResult.next())
{
print myResult.getString(1);
}
pause;
}

Accessing Parent Datasource

If you need access to the datasource() of the parent form. Parent form and child form being attached with dyna links you can use the following code snippet

element.args().record() to get the Datasource selected on the parent form.

For e.g. If you create a form named CustAdditions which is a child form to CustTable, and these two datasources are attached using dyna links and you want the selected CustTable record on child form you can write in the init method of CustAdditions

Code Snippet:
public void init()
{
CustTable custTable = element.args().record();
}

Getting number of recrods present in a query run

I want to get the total number of records from a query run object. I will use them to generate a progress bar (progress indication framework).

Use SysQuery::countloop(qr). this will return the total number of records in a query object.

using brackets in macro

Try using escape sequences

#define.ActiveDateCriteria("(\%1 == \%2)")

"Loss of precision" warning message

A question came up at today's webinar where a developer had a (presumably legitimate) reason to cast a real value into an integer value. The X++ language does not allow explicit casting (there's no support for it in the language), but the compiler will do its best to satisfy the user and do the conversion on its own. In this case, however, it issues a warning message, lest this is not what the user wanted.

One solution is to use the anytype type to hold the vaue for conversion and then using the any2int function, as shown below:static void Job47(Args _args)
{

real r = 3.13;
int i = r; // Warning is issued here
anytype a;

a = r; // Assign to an anytype variable...
i = any2int(a); // ... and back into an int

print r;
print i;
pause;
}

This should be packaged into a function, maybe called int RealToInt(real arg).

Another way would be doing the conversion in managed code (through the System.Convert::ToInt32(object) method), but the performance will not be as good because of the marshalling that needs to take place.

I hope this helps.

Hide an element from the combo box

Let say you you two forms where this enum is reflected, namely Form1 and Form2. In order to hide an element from Form1 and continue showing it on Form2 go to form design and then access that combo box control. Override the enter() method of that combo box and write this line to delete the element from it.

combobox:enter()
{
super();
this.delete(enum2str(BaseEnum::Element4));
}

Find out the string length of an extendedDataType

static void TestJob(Args _args)

{

Dictionary dict;

DictType dictType;

;

dict = new Dictionary();

dictType = dict.typeObject(dict.typeName2Id(extendedtypestr(AccountName)));

info(strfmt("Name : %1 \nId: %2 \nStringLength: %3 \nAdjustment: %4 \nLabel: %5 \nHelp: %6 \nBasetype: %7", dictType.name(), dictType.id(), dictType.stringLen(), dictType.stringRight() ? "Right" : "Left", dictType.label(), dictType.help(), int2str(dictType.baseType()) + " - " + enum2Value(dictType.baseType())));
}

eBook "Inside Dynamics AX 4.0" available for download

The great book "Inside Microsoft Dynamics AX 4.0" is available as a free download now.
You can go to: http://download.microsoft.com/download/2/5/8/258C8894-B94A-4A87-81EA-4DBB9776F8F2/622579eBook.pdf to download your copy.

When is my Label file updated in AX

When is my Label file updated in AX

If we look at our label files in the AOT we see 4 different extensions for our labels

· ALI Axapta Label Index

· ALC Axapta Label Comments

· ALT Axapta Label Temp, Store

· ALD Axapta Label Dictionary



The ALD file is readable/editable with a text editor. General speaking you only need the ALD file. When the AOS is restarted the ALI and ALC will be generated on the fly. (or update when the time stamp of the ALD file is bigger than the timestamp of the ALC or ALI file)

Next, a developer creates new labels. These labels will be stored in the ALT file. Not yet in the ALD file. When the final AOS will stop. AX will update the ALD file this way. It will copy the ALD file to an ALB file. Next the changes in the ALT file will be stored in the ALB file. Finally this ALB file is placed back in the ALD file and the ALB file will be deleted. (HINT: make the ALD file read only and you will see it your selfJ)

When your AOS has creased the changes are not stored in the ALD file. Even when you start and stop the AOS again the file is not updated. To solve this issue start an AX client search for the label in the Label editor. Next stop your client and the AOS. Now the label file is updated.

Friday, May 9, 2008

Where does AX not support Repetitive Manufacturing?

Microsoft Dynamics AX supports Discrete Manufacturing completely. However, there are some constraints in supporting Repetitive Manufacturing. There is no segregation between Repetitive Manufacturing & Discrete Manufacturing in AX. One must map the repetitive manufacturing process with respect to Discrete Manufacturing.


1. Non-existence of Production Line in AX. (Production line is defined as a group of work centers defined in linear fashion.)


2.AX does not support the Goods receipt of interim materials. (the material comes out of each production line.) Also, these interim materials can not be defined as BOM item, as they are not stored in between the process.



3.Since Repetitive manufacturing is a period-based/quantity based production method, the order quantity should be based on sales order/customer order. Set-up time of production line is common for varying order quantities.


4. Availability check of Rawmaterials, Capacity, Production Resource Tools (Cap,Mat,PRT) are not being carried by AX system before release of production order.

Thursday, May 8, 2008

Benefits of Master Planning in Microsoft Dynamics AX - Series I

1. Action message suggests whether or not you can retain the planned order. If stock is available in the ware house, it suggests for cancellation of the planned order.

2. Future message suggests about the possible date in future where a planned order can be firmed, simultaneously keeping the delivery date commitment & gives the planner to plan the orders lying in the next priority . Also, it suggests the earliest possible date, thereby, taking quick action on sales order and maintaining an increased customer satisfaction.

3. You can perform master scheduling on a single sales order and commit quickly a reliable delivery date to the customer.