Skip to main content

Notifications

Dynamics 365 Community / Blogs / NAV-real-life / Automatic Recording into NA...

Automatic Recording into NAV with barcoding, Part 2 (end)

Next thing, we can speed up the process of recording of work center output in production floor, where for NAV consultant, this is known as capacity journal. I refer this as automation, and with the same philosophy as previous post

… With this, we can save hours of resource for doing data input, we can eliminate human / typing errors, we can shorten tremendously the (field) operation procedure, and so on. There are really a lot of advantageous and benefit to the operation, for businesses, for industries, and of course, for consultant.

Part 2 – On Production Floor, on capacity and output journal .

The scenario that I use is for a job shop, which are working on various items at the same time. It is normally not a mass product, and in general, there are tens or hundreds different item running simultaneously in production.

The main point is, NAV can produce barcode print-out. We can make use of that barcode print-out to replace our manual things. My focus is to use Dataport to read the output of scanned barcode data and automate the Capacity Journal line creation.

On production ticket, we need to have minimal data to feed NAV - 
draw your barcode to contain: 
“Prod. Order No.”,”Item No.”,”Unit of Measure Code”,Quantity,”Work Center No.”

Just to recall, this is a bit further information about barcode set:

About barcode set Code39 – see here for more detail
(http://en.wikipedia.org/wiki/Code_39).
There are Code39 (only) and Code38 Full ASCII.   I’m using Code38 Full ASCII.
If you use Code39 only, you can not use comma sign (“,”) as separator.


From this point, we have some options on how to collect the scanned data, using an interface, where it holds the data, and store it just as is.

After all data recorded, we need to pull out everything stored in it, to a simple text file. Just plain text file, and at the NAV end, we use dataport. Let’s make a dataport, name is as “Auto Consumption”.

Dataport: Auto Prod. Journalp2

Data Item : Item Journal Line

 Item Journal Line – OnAfterImportRecord()

“Journal Template Name” := ‘CAPACITY’       //or work your own here. 
“Journal Batch Name” := ‘AUTO.C’            //or work your own here. 

“Posting Date” := WORKDATE;                 //or use any date you want
“Source No.” := “Item No.”;
“Entry Type” := “Entry Type”::Output;
“Document No.” := “Prod. Order No.”;        
//or work your own here. 
“Source Type” := “Source Type”::Item;
“Source Code” := FORMAT(‘CAPACITJNL’);
“Document Date” := “Posting Date”;          
//or work your own here. 
“Output Quantity” := Quantity;
“Value Entry Type” := “Value Entry Type”::”Direct Cost”;
“No.” := “Work Center No.”;
“Unit Cost Calculation” := “Unit Cost Calculation”::Units;
 

prodline.SETRANGE(Status, prodline.Status::Released);
prodline.SETRANGE(“Prod. Order No.”, “Prod. Order No.”);
prodline.SETFILTER(“Item No.”, “Source No.”);

IF prodline.FIND(‘-‘) THEN BEGIN
     Description := prodline.Description;
     “Shortcut Dimension 1 Code” := prodline.”Shortcut Dimension 1 Code”;
     “Shortcut Dimension 2 Code” := prodline.”Shortcut Dimension 2 Code”;
     “Prod. Order Line No.” := prodline.”Line No.”;
     “Location Code” := prodline.”Location Code”;
     “Routing No.” := prodline.”Routing No.”;
     “Routing Reference No.” := prodline.”Routing Reference No.”;
     rtgref := FORMAT(prodline.”Routing Reference No.”);
END ELSE MESSAGE(‘There is no record with :’+”Prod. Order No.”+’ , Item: ‘+”Source No.”);

itm.GET(“Item No.”);

IF itm.FIND(‘=’) THEN BEGIN
     “Inventory Posting Group” := itm.”Inventory Posting Group”;
     “Gen. Prod. Posting Group” := itm.”Gen. Prod. Posting Group”;
     “Item Category Code” := itm.”Item Category Code”;
END ELSE MESSAGE(‘Can not find Item: ‘+”Item No.”); 
//or work your own here.

itmuom.GET(“Item No.”,”Unit of Measure Code”);
“Qty. per Unit of Measure” := itmuom.”Qty. per Unit of Measure”;
“Quantity (Base)” := Quantity * “Qty. per Unit of Measure”;
“Output Quantity (Base)” := Quantity * “Qty. per Unit of Measure”;

wc.GET(“Work Center No.”);
“Cap. Unit of Measure Code” := wc.”Unit of Measure Code”;
“Qty. per Cap. Unit of Measure” := wc.Capacity;

prodrtg.SETRANGE(Status, prodrtg.Status::Released);
prodrtg.SETRANGE(“Prod. Order No.”, “Prod. Order No.”);
prodrtg.SETFILTER(“Routing Reference No.”, rtgref);
prodrtg.SETFILTER(“Routing No.”, “Routing No.”);
prodrtg.SETFILTER(“No.”, “Work Center No.”);

IF prodrtg.FIND(‘-‘) THEN “Operation No.” := prodrtg.”Operation No.”;
ELSE “Operation No.” := FORMAT(prodline.”Line No.”);

===========================================================

Finish it, compile it, put it in the Navigation Pane. Then you have done your work!

Well, in my case, I name it ‘Production Jnl.’, because I make it also able to export certain lines from Item Journal Line.

This is only an idea, a model, a scenario that I made. It needs more than this example to run in real business operation.  It needs adjustments, and modifications to fit the business / operation model.

The main point is, NAV can produce barcode print-out. We can make use of that barcode print-out to replace our manual things. My focus is to use Dataport to read the output of scanned barcode data and automate the Capacity Journal line creation.

 


Filed under: Microsoft Dynamics NAV, NAV, Navision Tagged: automation, barcode, business, capacity, dataport, Microsoft Dynamics NAV, NAV, Navision, operation, production, programming

This was originally posted here.

Comments

*This post is locked for comments