How to check configuration key in X++

Query:
How can i check if the configuration key is enabled through x++?

Answer:
if (isConfigurationKeyEnabled(configurationkeynum(keyname)))
{
//insert code here
}

Configuration Key Status Using X++ Code


As we are aware, Configuration key controls access to specific feature. To know about the status of a configuration key, the user has to traverse Administration->Setup->System-> Configuration.
Instead with the following job, a user can know the status of all the configuration keys that is being used in the system.

//Configuration key names and their enable state.
static void ConfigurationKey(Args _args)
{
    ConfigurationKeySet   configKeySet;
    DictConfigurationKey  dictConfigKey;
    Object                         formRun ;
    Map                             mapConfigKey;
    str                                strOutput;
    int                                i;
    ;

    mapConfigKey = new Map(Types::Integer, Types::String);
    configKeySet = new ConfigurationKeySet();
    configKeySet.loadSystemSetup();

    for (i=1; i <= configKeySet.cnt(); i++)
    {
        dictConfigKey = new DictConfigurationKey(configKeySet.cnt2Id(i));
        strOutput     = dictConfigKey.enabled() ? "enabled:" : "disabled:";
        strOutput    += " " + " " + dictConfigKey.name();
        mapConfigKey.insert(i, stroutput);
    }

    _args = new Args(formstr(SysPick));
    _args.parmObject(mapConfigKey);

    formRun = classfactory.formRunClass(_args);
    formRun.init();
    formRun.run();

    formRun.setCaption('ConfigurationKey Status');
    formRun.wait();
}
20851015.jpg
On executing this job, the output will be displayed in a SysPick form

Change management for purchase orders [AX 2012]


Updated: January 25, 2012
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
You can use change management to control the changes that you make to purchase orders in your organization. Change management introduces a managed workflow that makes sure that purchase orders are locked when they have been approved. The purchase orders cannot be changed until you start the change request workflow. When the workflow starts, all changes are stored in a history log, so that you can review the changes and compare purchase order versions.
To understand the change management process, you must understand how the change process fits into the life cycle of the purchase order. There are six approval statuses that the purchase order travels through, fromDraft to Finalized. Change requests can be raised in only two of the approval statuses.
NoteNote
A change request cannot be canceled. It must always be submitted and approved through the workflow.
Approval status
Description
Change requests allowed
Draft
The purchase order is a draft and has not been submitted for approval in the purchase order workflow.
No
In review
The purchase order was submitted for approval in the purchase order workflow. Approval is pending.
No
Rejected
The purchase order was rejected during the approval process.
No
Approved
The purchase order was approved.
Yes
Confirmed
The purchase order was confirmed. A purchase order cannot be confirmed until it has been approved.
Yes
Finalized
The purchase order was made final. It is financially closed and can no longer be changed.
No
Purchase order statuses cannot be increased for intercompany trading partners when change management is enabled. Also, purchase orders that have been created by firming planned orders from master planning are always set to Approved, regardless of the change management settings.
Click these links to find more information about the concepts that are discussed in this topic.
  1. Click Procurement and sourcing > Setup > Procurement and sourcing parameters.
  2. In the General area, select the Activate change management check box to enable change management for purchase orders in the current legal entity.
  3. Select the Allow override of settings per vendor check box if you want to be able to override the default settings for each vendor. This means that you can enable or disable the change management process for each vendor, regardless of the settings for the current legal entity.
    NoteNote
    To override the change management settings for a vendor, select the Override settings check box on the Purchase order defaults FastTab in the Vendors form.
A purchase order must have an Approved status before you can request that a change be made to the purchase order. A purchase order can have this status only if it is processed through a workflow. Therefore, when you enable change management, you must also set up a purchase order workflow. You do this on the Procurement and sourcing workflows list page. When you have set up the workflow, you must also enable it. For information about how to set up workflows, see Create a workflow and Set up Procurement and sourcing workflows.
A workflow represents a business process. It defines how a document flows through the system and indicates who must complete a task or approve a document. There are several benefits of using the workflow system in your organization:
  • Consistent processes — You can define the approval process for specific documents, such as purchase requisitions and expense reports. Using the workflow system helps to ensure that documents are processed and approved in a consistent and efficient manner.
  • Process visibility — You can track the status, history, and performance metrics of a specific workflow instance. This helps you determine whether changes should be made to the workflow to improve efficiency.
  • Centralized work list — Users can view a centralized work list to view the workflow tasks and approvals assigned to them. This work list is available from the Role Center pages in the Microsoft Dynamics AX client and Enterprise Portal.
For an overview of workflow in Microsoft Dynamics AX, see Overview of the workflow system andWorkflow concepts.
  1. Click Procurement and sourcing > Setup > Procurement and sourcing workflows.
  2. On the Action Pane, click New.
  3. Select the type of workflow to create, and then click Create workflow.
  4. In the workflow editor, design the workflow by dragging workflow elements onto the canvas.
  5. Configure each element of the workflow. For more information, see Configuring the workflow system.
  6. Repeat steps 2 through 5 to create additional workflows for Procurement and sourcing.
  1. Click Procurement and sourcing > Common > Purchase orders > All purchase orders.
    –or–
    Click Accounts payable > Common > Purchase orders > All purchase orders.
  2. Select the purchase order. On the Action Pane, on the Purchase order tab, in the Maintaingroup, click Request change.
    NoteNote
    The selected purchase order can be changed only if it has been approved. If change management has not been enabled, a purchase order can be approved when it is created. If change management has been enabled, the purchase order can be approved through a workflow.
  3. Enter the required changes on the purchase order. The approval status is set to Draft, and the purchase order must be approved again by all approvers before the purchase order can be processed.
When you change a purchase order, a copy of the changes is saved. All changes that you make at the header level and at the line level are saved. You can then view the difference between the approved purchase order and the changes that were made, and you can compare the purchase order versions.
  1. Click Procurement and sourcing > Common > Purchase orders > All purchase orders.
    –or–
    Click Accounts payable > Common > Purchase orders > All purchase orders.
  2. Select the purchase order.
  3. On the Action Pane, on the Manage tab, in the History group, click Compare purchase order versions.
  4. In the Compare purchase order versions form, review the changes that were made to the selected purchase order. All changes to individual fields are listed on the Changed fields FastTab. These values apply on the purchase order lines:
    • Exclamation point – One or more changes were made to the existing data.
    • Check mark – No changes were made to the existing data.
    • Plus sign – A new purchase order line was added.
    • Red X – The line was deleted.
  5. Click Close to return to the All purchase orders list page.
  6. On the Action Pane, on the Manage tab, in the History group, click View purchase order versions.
  7. In the Purchase order versions form, view a list of the available versions of the selected purchase order. You can sort the list by change date or approval status.

WMS in Microsoft Dynamics® AX 2009. Shipping Process Overview


Introduction

The WMS (Warehouse Managements System) encompasses the core components within average Microsoft Dynamics AX installations that are implemented to manage and run world class warehouses.
The WMS functionality is enabled by the configuration keys LogisticsAdvanced, WMSBasic, and WMSAdvanced. Formal training is available with the courses “Trade and Logistics I in Microsoft Dynamics® AX 2009” and “Trade and Logistics II in Microsoft Dynamics® AX 2009”. The training material covers main flows and processes, but there is still plenty of room for discussions on this exiting subject.
Please welcome the first post of a WMS series on this blog.

Why should I continue reading this post?

This post describes core Microsoft Dynamics AX 2009 outbound shipping process components, such as output order and shipment, and it provides an overview of the outbound process in general. We would definitely recommend that you continue reading this post to:
·         Get a clear overview of outbound shipping processes with WMS in AX2009
·         Learn more about new features in the shipping process, such as consolidated picking
Let’s get started.

Outbound process

In Microsoft Dynamics AX 2009 outbound shipping via warehouse management is processesed through a shipment [Inventory management > Common Forms > Shipments].
A shipment is a collection of items that are packed in the same container for transport by, for example, ship, rail, truck, or plane. A shipment includes an entire order, a part of an order, or a consolidation of multiple orders.
Based on the contents of the shipment, one or more picking routes, one or more pallet transports, or both are created.
An output order is a request for a picking requirements and it forms the basis of a shipment. From the shipment you can activate a pallet transport, a picking route, or both. The shipment status is based on the lowest denominator of the shipment lines’ status.
When, for example, a sales order line is created in Microsoft Dynamics AX 2009 an inventory transaction is created with a negative quantity to control an expected issue of inventory. To control the process of issuing the physical inventory, an output order is used in the warehouse management area. The output order [Inventory management > Inquiries > Output orders] is created when the reference order is released (Posting of the picking list).
The output orders are associated with a shipment, and in that process Microsoft Dynamics AX 2009 creates shipment lines. When shipment reservation is run, the program creates picking routes and/or output pallet transports based on predefined settings. The following activation of the picking process makes it possible to pick and deliver picked inventory to the shipment staging areas where the shipment is staged and loaded before it is sent.
 
As shown below, the outbound process can be set up to include only part of the existing stages.

Output orders

In Microsoft Dynamics AX 2009, the warehouse management outbound processes use output orders [Inventory Management > Inquiries > Output orders].
 
The output order [Inventory management > Inquiries > Output orders] is created when the reference order is released (Posting of the picking list), or when a manual output is requested from the issue reference line.
The output order holds information about the status of the outbound process and it is linked to the detailed information of the issue reference line.

 

Relation to inventory transactions

When the output order is created, it takes “ownership” of corresponding issue inventory transactions. This relationship is maintained by two dedicated fields on the InventTrans table (TransChildType and TransChildTypeRef). All related inventory transactions are marked consistently against an output order. Consider the following code example of output order creation.
AOT/Classes/WMSOrderCreate/updateCreateWmsOrder()
inventTrans.TransChildType  = InventTransChildType::WMSOrder;
inventTrans.TransChildRefId = wmsOrder.OrderId;

Shipment

A shipment consists of a shipment header and lines, and the information relates to output orders which, again, relate to the different reference order lines. Note, that when using advanced warehouse management in AX, a shipment can contain references to multiple issue orders, and these orders can even be of different order types.
The shipment status is based on the lowest denominator of the shipment lines’ status. A shipment can be in one of the following statuses:
Status
Description
Registered
The shipment has been created but not yet reserved or, if just one shipment line exists, without being part of a route.
Reserved
The shipment has been reserved and picking routes and/or pallet transports have been generated, but they have not yet been released for picking.
Activated
Both picking routes and pallet transports have been released, but not all of them have been completed.
Note that picking can start even when all items for the shipment cannot be reserved.
Picked
At least one line of the shipment line is still at the picked stage.
Staged
At least one line of the shipment line is still at the staged stage.
Loaded
At least one line of the shipment line is still at the loaded stage.
Sent
The shipment has been sent and the shipment has been fully expedited.
Canceled
The shipment has been canceled.

Shipment template

A Shipment template available from Inventory management > Setup > Distribution > Shipment templates, is used as the basis of a shipment.
A shipment template is required only if features such as automatic shipment creation, automatic creation of output orders, or creation of shipments via a wizard are applied, otherwise a shipment can be created manually. When a shipment template is applied, output orders can automatically be assigned to a shipment – and then a shipment need not be created manually.

Picking

Microsoft Dynamics AX 2009 supports three outbound picking processes:
·         Consolidated picking
·         Order picking
·         Inventory transaction picking (for example, Accounts receivable > Common Forms > Sales Order Details (Lines) > Inventory > Pick)
The order picking and consolidated picking processes use the same framework, called output orders, but the consolidated picking method has much more functionality and it requires a license to Advanced Warehouse Management.
If consolidated picking is not applied, Microsoft Dynamics AX 2009 automatically creates a shipment and a picking route when, for example, a picking list is posted from the Sales orders form.
We do not recommend using inventory transaction picking in combination with one of the other picking methods since inventory transaction picking does not update output order related information.
The following example illustrates the possibilities of controlling the outbound warehouse management processes utilizing output orders in Microsoft Dynamics AX.
Consolidated picking implies that multiple orders can be combined into one picking list. The orders can potentially be of different types, for example sales orders or transfer orders.
Consolidated picking uses advanced shipment functionality such as reservation via shipment, activate picking, activate pallet transport, and guided picking routes.
For flexibility of use, the consolidated picking method can be set up in a hierarchy of levels:
-          Inventory model group
-          Warehouses
-          Warehouse items
-          Picking list posting

Unpick and cancelation of pick

In Microsoft Dynamics AX 2009 inventory can be unpicked and returned to a different inventory dimension as, for example, a location and/or pallet. The inventory transactions are returned to the original status after an unpick operation has been performed. The reference to the output order still exists, and the picking line can be updated to Picked again right after unpicking. When a picking line is canceled, the output order reference is moved to the issue reference line and the output order, therefore, needs to be released again from the issue order. Alternatively, the reference line or the ��deliver remainder” quantity on the issue reference line can be canceled.
The unpicking and cancelation methods can be found on the picking list registration [Inventory management > Periodic > Picking list registration], lines – Functions. All the picking lines can also be canceled in one operation via Functions on the picking route header.
 
 Note that after the unpick action it is still possible to pick the same inventory again and again. Since the historical information is not stored in the system, the final inventory transactions are marked against the latest selected picking route, and the original reference using inventory transactions (TransChildType, TransChildTypeRef) is not valid anymore which means that these fields are empty on related inventory transactions. This aspect should be considered by every partner, who is planning to customize functionality in this area.

Data model

Please look at the following data model which represents the relationships between all entities in the scope of this blog post.
  
Per Lykke Lynnerup & Ievgenii Korovin, Inventory Management, Microsoft Dynamics AX.