stan
1
Hi all…
I just have issue about to import data (csv) to 1 table → table Transfer Line (5741)
so the data should be liket this
Location Code Item Code Quantity
BLUE Item A 1
BLUE Item B 3
BLUE Item C 2
RED Item A 10
RED Item B 9
RED Item C 4
and then I want to automatically create Transfer Header (5740) which is No. automatically get from No Series
for this example data… it should be 2 Transfer header records and 6 Transfer Line records
do you know how I create these?
thanks before
Hi
it is possible to create two TO-Header,i have below question to you
1.Why do you want to create 2 To headers with same lines ?
2.is your CSV have the requird fields to create TO headers ?
kindly give us more details or attach your CSV file
Thanks
jerome Marshal.J
aklex
3
Import lines to Transfer lines, then go through Transfer Line and create Records in Transfer Header table accordingly to your conditions.
stan
4
I have one warehouse and then want to transfer item to every outlet
so I think I want to create it by transfer order…
we collect the data from barcode scanner,which is csv
so after I import it… the data will inserted to Tranfer Line
and grouping in Transfer Header
so we don’t need to input it manually to NAV
Hi Stan it is possible to achieve your requirement
Do the below steps
-
Create a table (Example table1) it should contain all the fields which are mentioned in your CSV file with appropriate data type.
-
Table1’s primary key must be contain following fields Location Code, Item No
-
Create a data port (Example TO Import) with table1 as your data item
-
Now Import all the records from your CSV to Table1
-
While import check for duplication based on primary key
-
If duplication found add the quantity with existing record
-
After successful import records in Table1 like below
Location Code Item Code Quantity
BLUE Item A 1
BLUE Item B 3
BLUE Item C 2
RED Item A 10
RED Item B 9
RED Item C 4
-
Go to the design mode of the TO Import data port
-
Create three record variables for the following tables Transfer Header, Transfer Line, Location Code (Example Transheader, TransLine, LocationCode)
-
Write code at Table1- OnPostDataItem() as below
Location Code.reset;
If Location Code.find(‘-’) then
Begin
repeat
Table1.reset;
Table1.setrange(Tabl1.”Location Code”,LocationCode.Code);
If Table1.find(‘-’) then
Begin
{ here you create your transheader}
{here you filter your Transfer line table by newly created Transfer header No and insert the lines from Table1}
{After Successful insertion into Transfer line you have to deleted insered lines from Table1}
End;
Until LocationCode.nex = 0;t
End;
-
The above solution will create one Transfer header per location code for example in step 8 you have two location codes (BLUE, RED)
-
So that two transfer Headers will be created on is for Blue Location another one is for RED location (Example TO-001 and To-002)
-
TO-001 will have the lines of blue location TO-002 will have the lines of Red Location
-
So that each TO have 3 lines
stan
6
thanks a lot Marshall
but I still confused about the code
stan
8
Begin
{ here you create your transheader}
{here you filter your Transfer line table by newly created Transfer header No and insert the lines from Table1}
{After Successful insertion into Transfer line you have to deleted insered lines from Table1}
End;
that is how I create transfer header
because I must no series for add new transfer header automatically every Location Code (Grouped)