LeaderBoard

How to: Open a Development Workspace [AX 2012]

Imparted from Here

 

In Microsoft Dynamics AX 2012, by default, the client opens in an Application Workspace. As a developer, you may prefer to open the Microsoft Dynamics AX client directly into a Development Workspace.

NoteNote

To open a Development Workspace, a developer license key is required, and the installation checklist must be completed. No more than eight workspaces per client can be opened at the same time.

This topic describes:

  • How to open a Development Workspace from the Application Workspace.

  • Three methods to directly start the client in a Development Workspace.

  • A code example to open a Development Workspace using X++.

To open a Development Workspace from the Application Workspace
  • Click Windows > New Development Workspace. A Development Workspace opens in a new window.

    TipTip

    You can also press CTRL+Shift+W to open a Development Workspace.

To open a Development Workspace by configuration
  1. Click Start > All Programs > Administrative Tools > Microsoft Dynamics AX 2012 Configuration. The Microsoft Dynamics AX Configuration Utility window opens.

  2. On the General tab, click Manage, and then click Create configuration.

  3. On the Create Configuration form, enter a name for the configuration in the Configuration name field, and then click OK. The Create Configuration form closes and you return to the Microsoft Dynamics AX Configuration Utility window.

  4. On the General tab, in the Command to run at application startup field, enter -development, and then click OK to save the new configuration. The settings will apply the next time you open the Microsoft Dynamics AX client.

To open a Development Workspace using the command line
  1. On the taskbar, click Start, and then click Run.

  2. In the Open field, enter cmd, and then click OK.

  3. At the command prompt, type the following: "C:\Program Files\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe" -development

To create a shortcut to open a Development Workspace
  1. In Windows Explorer, right-click the Ax32.exe file in your Microsoft Dynamics AX 2012 client installation, and then click Create Shortcut. By default, this file is located in the C:\Program Files\Microsoft Dynamics AX\60\Client\Bin directory. A new shortcut named Shortcut to Ax32.exe is created.

  2. Right-click Shortcut to Ax32.exe, and then click Properties. The Shortcut to Ax32.exe Properties window opens.

  3. On the Shortcut tab, in the Target field, enter -development after the path to the Ax32.exe file. The Target field should resemble "C:\Program Files\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe" -development.

  4. Click OK to save the shortcut. You can move and rename the shortcut as needed.

Example


You can also open a Development Workspace directly from X++ code. For example, you can add a customized button in the Application Workspace to open a Development Workspace. The following X++ code can be used to open a Development Workspace.

X++

static void OpenDevWorkspace(Args _args)
{     int hWorkspace;     hWorkspace = infolog.createDevelopmentWorkspaceWindow();
}

How to: Open a Development Workspace [AX 2012]

Imparted from Here

 

In Microsoft Dynamics AX 2012, by default, the client opens in an Application Workspace. As a developer, you may prefer to open the Microsoft Dynamics AX client directly into a Development Workspace.

NoteNote

To open a Development Workspace, a developer license key is required, and the installation checklist must be completed. No more than eight workspaces per client can be opened at the same time.

This topic describes:

  • How to open a Development Workspace from the Application Workspace.

  • Three methods to directly start the client in a Development Workspace.

  • A code example to open a Development Workspace using X++.

To open a Development Workspace from the Application Workspace
  • Click Windows > New Development Workspace. A Development Workspace opens in a new window.

    TipTip

    You can also press CTRL+Shift+W to open a Development Workspace.

To open a Development Workspace by configuration
  1. Click Start > All Programs > Administrative Tools > Microsoft Dynamics AX 2012 Configuration. The Microsoft Dynamics AX Configuration Utility window opens.

  2. On the General tab, click Manage, and then click Create configuration.

  3. On the Create Configuration form, enter a name for the configuration in the Configuration name field, and then click OK. The Create Configuration form closes and you return to the Microsoft Dynamics AX Configuration Utility window.

  4. On the General tab, in the Command to run at application startup field, enter -development, and then click OK to save the new configuration. The settings will apply the next time you open the Microsoft Dynamics AX client.

To open a Development Workspace using the command line
  1. On the taskbar, click Start, and then click Run.

  2. In the Open field, enter cmd, and then click OK.

  3. At the command prompt, type the following: "C:\Program Files\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe" -development

To create a shortcut to open a Development Workspace
  1. In Windows Explorer, right-click the Ax32.exe file in your Microsoft Dynamics AX 2012 client installation, and then click Create Shortcut. By default, this file is located in the C:\Program Files\Microsoft Dynamics AX\60\Client\Bin directory. A new shortcut named Shortcut to Ax32.exe is created.

  2. Right-click Shortcut to Ax32.exe, and then click Properties. The Shortcut to Ax32.exe Properties window opens.

  3. On the Shortcut tab, in the Target field, enter -development after the path to the Ax32.exe file. The Target field should resemble "C:\Program Files\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe" -development.

  4. Click OK to save the shortcut. You can move and rename the shortcut as needed.

Example


You can also open a Development Workspace directly from X++ code. For example, you can add a customized button in the Application Workspace to open a Development Workspace. The following X++ code can be used to open a Development Workspace.

X++

static void OpenDevWorkspace(Args _args)
{     int hWorkspace;     hWorkspace = infolog.createDevelopmentWorkspaceWindow();
}

Document Handling in AX – setup and Example

Imparted from Here

Some initial setups for enabling document handling in AX-

On the Tools menu, select Options.
Under Document handling, select Document handling active.
Select Update toolbar line button to highlight the Document handling icon on the toolbar when you select a record with documents references.

Documents are stored in a default document archive directory and before you start creating documents, you must select the location in theParameters form.

Click Basic > Setup > Document management > Parameters.
In Archive directory, type the path to the archive directory, or use the browse button (…) to select a folder on your network.
Select the Number sequences tab.
In the Number sequence code list, select the number sequence to use for naming your documents.

The document management system handles several types of documents including letters, worksheets, and simple notes. Before you can create documents of a certain type, the document type must be created in the Document type form.

By default, all documents are stored in the Archive directory selected on the Parameters form. However you can select alternative folders for the individual document types.

Also by default, all document types are available from all forms, but some document types are only relevant for certain tables, such as, if you only want to create customer letters for records in the Customers form. When you associate a document type with a specific table, it is not possible to create any documents of that type, in other tables.

Create new document type

Click Basic > Setup > Document management > Document types.
Press CTRL+N to create a new document type.
In Type, type a code for the document type.
In Name, type a descriptive name for the document type.
In the Job description list, select the type of document to create.
In the Group list, select a group for the document type.

Now, I would like to explain document handling with an example for sales orders form of DOC type.

Initially set the parameters for document handling.

Go to – >Basic -> setup -> Document Management – > Parameters form

set the archive diretory path ( where the document has to be stored like c:\AxDocuments). Remember when ever u create document for a record, the document gets stored in the above location specified.

Check – use Active document table checkbox.

In the number sequences tab - select the number sequence you would like to use for the documents.

Then, If you want to enable documents for salestable – Go to – > Basic -> setup -> Document Management – > Active document tables form . Then select the name of the table here as salestable and in enable the always enabled checkBox.

Now when you open the salestable form you can find the document handling enabled on the toolbar for the salestable form. Double click the document handling icon and create a new document for that record by clicking the new button and selecting the Document menuitem button.Now you can create documents for the salestable.Once you create documents the documents will be stored in the archive path selected in the parameters form.

When ever u create a document, it hits docuref and docuvalue tables.

In the docuref,it creates a record with the tableid of the salestable, the record id of the salestable and the dataareaid ..etc..and correspondingly a record gets generated in the docuvalue with all the filenames, extensions,path etc

To view the documents in the salestable from itself, i mean in the gird itself here is the way…

Open the salestable form, Then , I would like to use icons for every record in the salestable.So i will write a display method at the salestable level.

//BP Deviation Documented
display smmDocIconNum
showDocHandIcon()

{
#macrolib.resource
;
if ((select firstonly docuRef where
docuRef.RefCompanyId == this.DataAreaId && docuRef.RefTableId ==
this.TableId && docuRef.RefRecId == this.RecId).RecId)

{
return #RES_NODE_DOC;
}

return #RES_AM_NEW;
}

Now create a new window control in the gird. Add the datasource as salestable and datamethod as showDocHandIcon.

The main class where all the business logic is written is docuAction Class. Now i am going to use this class to open the documents for the records.

Now please override the Mouseup() method of the window control

public int
mouseUp(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)

{
int ret;
args args;
docuRef
docuRef;

;
ret =
super(_x, _y, _button, _Ctrl, _Shift);

element.showDocument();
// Method at form level

return ret;
}

Now add showDocument() method at form level

void showDocument()
{
args args;
docuref docuref;
;

args = new args();
docuRef =
docuref::find(salesTable.dataAreaId,tablenum(SalesTable),salesTable.RecId,today());

args.record(docuRef);
args.parmEnumType(enumnum(Docucode));
args.parmEnum(Docucode::Open);
docuaction::main(args);
}

NOW YOU CAN VIEW YOUR DOCUMENTS FROM THE GRID ITSELF BY DOUBLE CLICKING THE WINDOW CONTROL.