Pages

March 27, 2015

Auto Settlement of Sales Invoice in AX

In an organization where thousands (or more) of sales transaction happening every day, and here is this auto settlement requirement comes in picture. Auto settlement process save a ton of time to manually settlement of each and every customer or record. There are three different ways to perform a auto settlement of the sales invoices.

1. By Sales parameter select auto settlement.
2. By select open transaction at the time of invoice posting
3. Through X++ code

1. By Sales parameter select auto settlement: Go to AR/Setup/Parameter under settlement tab you will found a check box for automatic settlement. Select this check box. And your system will auto settle your sales invoice.
clip_image002

This will settle a transaction whenever you post a payment journal.

2. By select open transaction at the time of invoice posting: You can also choose the open transaction at the time of invoice journal creation. At the time of invoicing click on “open transaction settle” button, this will open a new form to select records to be settle from open transaction of that customer.


clip_image004

clip_image006

3. Finally we have code as well (I love this part ;)): So here we are to do some tricky things. Yes, we can do the settlement by X++ code as well. Below code is an example in Job. You can use the same logic for any trigger point in AX.

static void theAxapta_AutosettlePayment(Args _args)
{
CustTable custTable;
CustTrans invCustTrans, payCustTrans;
SpecTransManager manager;
CustVendTransData custVendTransData;
;
custTable = CustTable::find("504411");
// Find the oldest unsettled invoice
select firstonly invCustTrans
order by TransDate asc
where invCustTrans.AccountNum == custTable.AccountNum &&
invCustTrans.TransType == LedgerTransType::Sales &&
!invCustTrans.closed;
// Find the oldest unsettled payment
select firstonly payCustTrans
order by TransDate asc
where payCustTrans.AccountNum == custTable.AccountNum &&
payCustTrans.TransType == LedgerTransType::Payment &&
!payCustTrans.closed;
ttsbegin;
// Create an object of the CustVendTransData class with the invoice transaction as parameter
custVendTransData = CustVendTransData::construct(invCustTrans);
// Mark it for settlement
custVendTransData.markForSettlement(CustTable);
// Create an object of the CustVendTransData class with the payment transaction as parameter
custVendTransData = CustVendTransData::construct(payCustTrans);
//mark it for settlement
custVendTransData.markForSettlement(CustTable);
ttscommit;
// Settle all marked transactions
if(CustTrans::settleTransact(custTable, null, true,
SettleDatePrinc::DaysDate, systemdateget()))
info("Transactions settled");
}

Enjoy…..

- Harry

March 23, 2015

How to deploy Dynamics AX instance on Azure through LifeCycle Service (LCS)- Part I

 
Hi All,
In this post I will demonstrate how to configure your Azure account  with LCS(LifeCycle services) project to deploy the AX on Azure cloud.
In second part of this post I will share how to actual deploy the AX on Azure.
Here is quick steps to setup/configuration your Azure with LifeCycle services
Step 1: Login you LCS services
Step 2: Create a new project or you can use any existing project as well. Here in this tutorial I will take an example with new instance creation.
clip_image001
Click on + button and fill the details and click on create.
clip_image002
After create a new project below screen will come which shows, your project created successfully.
clip_image003
Step 2: Now click on Microsoft Azure setting under environments
clip_image004'
To proceed further you need you Azure subscription id. To find your subscription id Login into your Azure management portal.  Scroll down click on setting and copy from here
clip_image005
Paste this Subscription id in below field
clip_image006
Step: 3 Download management certification (file name : LifecycleServicesDeployment.cer)
This certificate will enable Lifecycle Services to communicate with Azure on your behalf. Download this management certificate to your local computer. Then, upload the management certificate to the Azure management portal (Settings > Management Certificates).
To  upload this certification Login into your Azure management portal.  Scroll down click on setting click on Management Certificate than click on “Upload Management certification”
clip_image007
Upload the “LifecycleServicesDeployment.cer” file here.
Step :4 Now on LCS window click on next and select Azure region and click on “Connect”.
clip_image008 '
So here we completed the setup of LCS with Azure.
In my next post i will share how to deploy the AX on windows Azure environment. How to host AX on cloud.
- Harry

March 19, 2015

Completed 200 posts today.

Hi Friends,

Today I completed my 200 posts. This cant be possible without your support and feedback. 
A big thanks to all of you.

Regards-
Harry

Workflow setup in AX2012 R3 CU8

Hi Folks,

Here is the steps to setup the workflow in CU8. To setup workflow for first time, we need to setup it first.

1. First of all we need a batch group which can handle the workflow triggers and proceed workflow task, also send the the notification to users.
 Go to System admin-> Setup -> Batch Group
Add a new batch group for workflow,

clip_image001

Add batch server accordingly.
clip_image002

2. Now we need to setup the workflow parameters 
Go to System Admin -> Setup -> workflow -> Workflow parameter
image  

Select workflow email template. (You may need to create a new workflow Email template)
clip_image003

3. Go to System Admin -> Setup -> workflow -> click on Workflow infrastructure Configuration
Now a wizard will open and Follow below steps
clip_image005

4. Configure the workflow message processing batch job
Select Batch group in below screen. (This may be not editable if already some records exists in respective tables)
clip_image007

5. Configure the workflow due date processing batch job
On next screen select same batch group and enter the number of hours for recurrence interval
clip_image009

6. Configure the line-item workflow notification batch job
In this screen we need to select a batch group and the number of minutes for recurrence interval of this job
clip_image011

7. As next screen you will have below screen to finish this process
clip_image013

So…. Now your system is ready for workflow process.

-Harry

March 03, 2015

The table WHSWorkLineCycleCount does not contain the method WHSWorkTable.

Hi Folks,

Today i just got this error message for "WHSWorkLineCycleCount" table.  while there is no changes in standard objects. Have a look on below case and share your suggestion and feedback as well. Here i am sharing my experience with the same.

Compilation error:
The table WHSWorkLineCycleCount does not contain the method WHSWorkTable.

CIL Error:
CIL generation: Warning: CIL could not be generated for X++ method WHSWorkTableForm.sourceButton_clicked due to X++ compile errors. This method throws an exception if run as CIL.

Possible Reason:
After the configuration key "Warehouse and Transportation management" is disabled, you will get above compilation and CIL error on standard AX 

Solutions:
1. Add one method in table WHSWorkLineCycleCount named WHSWorkTable
To fix it on your environment, simply create a method with name whsWorkTable() on the WHSWorkLineCycleCount table, that returns the corresponding work based on the relation field 
2. You can also try below hotfix:
http://support2.microsoft.com/hotfix/KBHotfix.aspx?kbnum=3001197&kbln=en-in

-Harry

March 02, 2015

Unable to save . This version of Menu FixedAssets belongs to a lower application object layer

Error: Unable to save . This version of Menu FixedAssets belongs to a lower application object layer

Solution:
Clear your cache

image

Try to save now.

-Harry