Wednesday, August 10, 2016

Empty BOM lines

We faced with a problem of empty BOMs. Users created BOM versions and approved them, but they forgot to fill BOM lines table. In order to solve this problem, I wrote a really simple X++ job to collect information about exists BOM versions with empty BOM lines.

PS: ItemId has a special code format in a project, so I used itemId mask in "like" statement.


 static void NBA_GetEmptyBOM(Args _args)  
 {  
   BOM tBOM;  
   BOMVersion tBomVersion;  
   info("Run");  
   while select tBOMVersion  
   where tBomVersion.ItemId like '?-?????-??????'  
   notexists join tBOM  
   where tBOM.BOMId == tBomVersion.BOMId  
   {  
     info(tBomVersion.BOMId + " with itemId: " + tBomVersion.ItemId);  
   }  
   info("Done");  
 }  

PPS: A report about BOM statement could be a better solution, but I in a current stage we decided not to spend developer time on developing the report.

Friday, July 22, 2016

Customer case #2

One more case of my career.

 Customer made parts in a foundry. Technologists created a bill of materials (BOM), for instance, virgin material, external scrap, internal scrap, and alloying elements and cost of labor for one ton of every allowed grade of steel. Further, users in the factory floor wrote an amount of tons of steel and an amount of material for the steel producing in an old accounting system. At the end of a month, financial officers counted difference in warehouse balances between month beginning and end and wrote off this difference in materials. Finally, they distributed the cost of this difference to the completely steel and parts production according to the design documentation.

 At the same time, knowing the weight of a separate component part and steel price, customer’s financial officers calculated an actual cost of each component part. In addition, according to the accounting policy steel cost averaged and included in part cost with the average price of steel.

It is obvious that due to this writing-off policy they had a big error in steel cost. Finally, managers could not receive actual information about materials’ flow.

The problem: how to help the customer to calculate the parts cost and the average cost of steel? In addition, they wanted not to create a detailed bill of material for steel producing in part of detail’s BOM.

Solution: we created separate BOM for one ton of every steel grade with a list of raw materials and cost of labor. Furthermore, we created the second BOM for the part or component. This BOM had just steel as the BOM line. Amount if steel in kilograms was equal to the weight of the part.

Moreover, the steel BOM had a few so-called “phantom” lines for a few materials groups. For example, we had separate specifications for molding materials, flask, tools etc. It helped technologists easy to operate with a variety of BOM options. Finally, it helped receive actual information about consumption of materials for steel making.

 What about the average cost of steel? We decided not to expand part of detail BOM to steel component during production order processing. First, a user in Axapta created needed steel amount, after that, he created detail from this amount of steel. It allowed us to receive the average cost of steel. It was the way to receive average month cost of a ton of every grade of steel.

Tuesday, July 19, 2016

Save everything

It sounds obvious but I should write it. You have to log your every setting in every module.

I have done it since my career beginning, however, sometimes I forget about that. I faced with the problem a few days ago. I was setting up a module at a training base for testing one idea. However, I have tested many settings variants in this base, so my work settings were mixed with old settings. Obviously, if I had written my settings, I would have saved my time.

Therefore, what I do for logging. I have one doc or text file for every module. I write everything that I change in settings to these files. It helps me during system designs writing and during customizations and ideas testing.

Monday, July 18, 2016

Customer case #1

The purpose of this post and others is to illustrate customers' cases and our solutions.
case #1.
Customer: large aluminum profile factory.
ERP Implementation company: AFM Consulting. Microsoft Gold Partner.
Systems: MS Dynamics Axapta (AX) 4.0, 2009
Our customer bought aluminum ingot and produced aluminum logs in a foundry. After that, an aluminum profile is extruded from logs with the help of an extrusion press with a die-changing device. The standard length of a profile at the factory is 6.8 meters. Profiles are counted in a warehouse in kilograms and pieces. However, pieces and meters are used in sales specifications, which means that a profile is sold at a price per meter, counted from the price per tonne of an aluminum profile. The standard length can be cut on a customer's request.
Price per tonne depends on the complexity of the profile and the profile system.
Tasks: 
1. To add a number of units of measurement (meter, kilogram, piece) and to take into account different lengths of the profile.
2. To calculate the price per meter taking into account the price per tonne of aluminum.

Solutions:
1.  First and foremost, we  agreed with our customer that all inventory movements in AX have to be based on the theoretical weight per meter. It allowed us to get rid of extra operations in AX on every profile piece which would take place if we used a real weight of a profile piece.
After that, we decided to use two additional fields: the alternative unit of measurement (UM) and the quantity in this alternative UM. We added these two fields into InventTrans table and into every related document, such as InventTable, Sales orders lines, Purch orders lines, Inventory journals trans, Production orders and production journals trans, BOM lines, Unit convert etc.  In InventTable a user had to select alternate UM if an item uses alternate measurement method. A piece was an alternate UM for an aluminum profile, at the same time a kilogram was a warehouse unit of measure, and a meter was a sales unit of measure.
In addition, we added the theoretical weight of the profile meter according to the design documentation for the profile. At the same time, we made the customization of UnitConvert class for calculating the profile piece weight, depending on the theoretical weight per meter and its length.
Alternative units of measurement were added so that alternative units of measurement were recalculated when the sales UM or quantity in sales UM change in a SaleOrderLine. 
We have to take into account the fact that during the change of a total weight in a line of any document,  Axapta has to round the whole UM triad (kilogram - meter - piece) so that the piece remains integral. For instance, we sell 1 piece of a profile with the length of 6.8 meters and the weight of 20 kgs. (2.94 kg / meter). If a salesperson  decides to change the sales quantity to 15 meters, Axapta will offer the nearest integral amount of a piece. In our case, it will be 2 pieces and 13.6 meters.
The problem of rounding errors was solved with writing-off the remaining grams during the sale order process or during the warehouse inventorying.
2. We developed the tables of complexities group and aluminum profile systems. Afterward, we developed a table of price per profile tonne based on complexities groups and profile systems dimensions. Finally, in A/R module we created a new type of price agreement journal which is called "price per profile tonne". A user had to enter the price per tonne, price date, profile complexity group, profile system, a customer (or customers groups) and a contract number (if necessary). In sales orders we added a function for calculating price per meter in accordance with the price per tonne for the sales order.

Sunday, July 17, 2016

Number sequence status checking

Obviously that any consultant has to check number sequences during a project stage. If numbers run out AX might suddenly stop work correctly.

So in AX 2012 I use this job for the regular number sequences monitoring.

In this post value of percent is 90. Any number sequences where next number is above 90 will be showed in the infolog window. Do not forget to setup your preferred value for  the alert.


1:  static void NBA_NST(Args _args)  
2:  {  
3:    NumberSequenceTable numberSequenceTable;  
4:    real  rNSTpercent;  
5:    info("Run");  
6:    while select numberSequenceTable  
7:    {  
8:      rNSTpercent = (numberSequenceTable.NextRec - numberSequenceTable.Lowest)/(numberSequenceTable.Highest - numberSequenceTable.Lowest)*100;  
9:      if(rNSTpercent > 90) // 90% of number sequence using. You should setup value about 80-90 to become alerted  
10:      {  
11:        info(strFmt("Id: %1 text: %2 percent: %3",numberSequenceTable.NumberSequence,numberSequenceTable.Txt,rNSTpercent));  
12:      }  
13:    }  
14:    info("Done");  
15:  }  

Friday, July 15, 2016

Voucher number in invent journals

Sometimes, people, who work with Dynamics AX, need to analyze what is the source for a ledger transaction. Is that specific invent movement journal, invent transfer journal or BOM journal?
So, in my opinion, the best way to solve the problem is separate vouchers in every invent journal name with settings in of voucher number sequences. Default settings use the same settings for different journals names.

A user can see voucher with a number "IMU1_######" and understands that it is voucher from a invent movement journal named U1. Voucher "ITU2_######" says "hey, I am a voucher from a invent transfer journal named U2". U1 & U2 might be the names for journals for specific customers units, for instance.

So you, as a consultant, just need to set up number sequences settings in Inventory and Warehouse management - Setup - Journals - Invent journal name in the field ".VoucherNumberSequenceTable AutoIdentification".

Friday, July 8, 2016

How to hide invent journal name from user's select

Yesterday I faced problem how to hide old invent journal names from selection in inventjournaltable form.

I see two ways. The way of modification says to develop setting "hide journal name" for journalnametable and activate this setting in every record to hide. The way of settings says to create user group "hide journals" with no users and enter this group name in blockusergroup_id field. 

Thursday, July 7, 2016

Production module without routes, master planning etc.

A few days ago I received task to test Customer's business processes in Production module functional. We decided to use at current project stage simply settings without routes, work centers etc. Just product orders (PO) and BOMs.

General ledger (GL) transaction will be posted during PO closing.

There is a check-list for our settings in standard Axapta 2012 (with Russian localization).


Module - Menu path Setup Comment
Production control - Setup - Parameters - General PostPickList = Yes So we want to have GL transaction and we should activate these settings
PostReportedFinished = Yes
NoPostProdTrans_RU = Yes Do not post routes trans into GL
Production control - Setup - Parameters - AutoUpdate BOMAutoConsumpStUp = Never we do not want use any consumption
RouteAutoConsumpStUp = Never
BOMAutoConsumpRepFin = Never
RouteAutoConsumpRepFin = Never
BOMAutoConsumpStUp = Never
Production control - Setup - Parameters - ProdStatus Created - 0, Y, N, N, N, N, N, N
Cost estimated, Y, 0, N, N, N, Y, N, N
Operation Scheduled - N, N, 0, N, N, Y, N, N
Job scheduled - N, N, N, 0, N, Y, N, N
Released - N, N, N, N, 0, Y, N, N
StartUp - N, N, N, N, N, 0, Y, N
Reported finished - N, N, N, N, Y, 0, Y, N
Completed - 0, 0, 0, 0, 0, 0, 0, 0
We activate just necessary statuses: created, cost estimated, started up, reported finished and completed.
After these settings completed we have to set up production journals and pools (usually, I use pools as calendar period).

If you have invent items posting setting and do not have specific posting settings for you customer's units, then do not use production groups.

Don't forget to fill necessary financial dimensions in your journal picking list. You can face with problem during PO closing without financial dimensions.

Monday, July 4, 2016

Hi there

Hi there,

I have decided to write in this blog any helpful and useful information about Microsoft Dynamics Axapta.
I am functional consultant, I have worked with Axapta since 2007. My major modules is T&L and Production. So I hope that I will have enough time for the blog during my everyday life.