change warehouse in the table components of the production order
kanika
Member Posts: 247
Hi Experts! NAV2017
When the production order is updated and the data is written in the table of components of the order, I need the warehouse of these components to be that of the work center, because it is an external job.
I have looked at the code coverage and I think it is written to the CU 99000845 but I do not see exactly where the component reservation line is written because I have changed the code in "SetProdOrderComponent" but it does not make the reservation of the component in the work center warehouse.
I have replaced line 202
CalcReservEntry. "Location Code": = NewProdOrderComp. "Location Code"
for the code
pRutaOrden.RESET;
pRutaOrden.SETRANGE ("Prod. Order No.", NewProdOrderComp. "Prod. Order No.");
pRutaOrden.SETRANGE (Type, pRutaOrden.Type :: "Work Center");
pRutaOrden.SETRANGE ("Work Center Group Code", "EXTERNAL");
IF pRutaOrden.FINDFIRST THEN BEGIN
pCenTra.RESET;
pCenTra.SETRANGE ("Work Center Group Code", pRutaOrden. "Work Center Group Code");
pCenTra.SETRANGE ("Subcontractor No.", '<> ""');
IF pCenTra.FINDFIRST THEN
CalcReservEntry. "Location Code": = pCenTra. "Location Code";
END ELSE
CalcReservEntry. "Location Code": = NewProdOrderComp. "Location Code";
where
pRutaOrden (record, Prod. Order Routing Line)
pCenTra (record, Work Center)
Is not this Cu?
Is not it the right place?
Is not the code correct?
Thanks in advance
When the production order is updated and the data is written in the table of components of the order, I need the warehouse of these components to be that of the work center, because it is an external job.
I have looked at the code coverage and I think it is written to the CU 99000845 but I do not see exactly where the component reservation line is written because I have changed the code in "SetProdOrderComponent" but it does not make the reservation of the component in the work center warehouse.
I have replaced line 202
CalcReservEntry. "Location Code": = NewProdOrderComp. "Location Code"
for the code
pRutaOrden.RESET;
pRutaOrden.SETRANGE ("Prod. Order No.", NewProdOrderComp. "Prod. Order No.");
pRutaOrden.SETRANGE (Type, pRutaOrden.Type :: "Work Center");
pRutaOrden.SETRANGE ("Work Center Group Code", "EXTERNAL");
IF pRutaOrden.FINDFIRST THEN BEGIN
pCenTra.RESET;
pCenTra.SETRANGE ("Work Center Group Code", pRutaOrden. "Work Center Group Code");
pCenTra.SETRANGE ("Subcontractor No.", '<> ""');
IF pCenTra.FINDFIRST THEN
CalcReservEntry. "Location Code": = pCenTra. "Location Code";
END ELSE
CalcReservEntry. "Location Code": = NewProdOrderComp. "Location Code";
where
pRutaOrden (record, Prod. Order Routing Line)
pCenTra (record, Work Center)
Is not this Cu?
Is not it the right place?
Is not the code correct?
Thanks in advance
0
Best Answer
-
I finally solved this matter by putting this code in the OnInsert of the table 5407
pRutaOF.RESET;
pRutaOF.SETRANGE("Prod. Order No.","Prod. Order No.");
pRutaOF.SETRANGE("Routing Reference No.","Prod. Order Line No.");
pRutaOF.SETRANGE("Routing Link Code","Routing Link Code");
IF pRutaOF.FINDFIRST THEN BEGIN
IF pWorkCenter.GET(pRutaOF."Work Center No.") THEN BEGIN
IF (pWorkCenter."Location Code"<>'') AND (pWorkCenter."Subcontractor No."<>'') THEN
"Location Code":=pWorkCenter."Location Code";
END;
END;0
Answers
-
Hi,
What is the reason, why you don't transfer the stock into the new location using a Transfer Order?My blog - https://www.HannesHolst.com/0 -
to avoid customer work
if I use the transfer order they would have to do 2 + invoice, if I can do it from the production order they will save the 2 transfer orders and can invoice directly from the purchase order generated from the production order.0 -
I finally solved this matter by putting this code in the OnInsert of the table 5407
pRutaOF.RESET;
pRutaOF.SETRANGE("Prod. Order No.","Prod. Order No.");
pRutaOF.SETRANGE("Routing Reference No.","Prod. Order Line No.");
pRutaOF.SETRANGE("Routing Link Code","Routing Link Code");
IF pRutaOF.FINDFIRST THEN BEGIN
IF pWorkCenter.GET(pRutaOF."Work Center No.") THEN BEGIN
IF (pWorkCenter."Location Code"<>'') AND (pWorkCenter."Subcontractor No."<>'') THEN
"Location Code":=pWorkCenter."Location Code";
END;
END;0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 333 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
