Discussion:
How to create a production order with x++
(too old to reply)
jos
2008-04-08 06:18:00 UTC
Permalink
Hi,
is there an easy way to create production orders with x++?
For example: Is there any class with function createProd(itemId _itemId, Qty
_qty)?
How do you create productions?
--
Regards
Joerg
Axel Kühn
2008-04-08 09:09:06 UTC
Permalink
Hi,

you can create production order in a way like this:

static void CreateProd(Args _args)
{
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find("YourItemId");

prodTable.initValue();

prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);

prodTable.QtySched = <YourQty>;
prodTable.insert();
}

Hope that hepls you.
--
Sincerely yours
Axel Kühn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by jos
Hi,
is there an easy way to create production orders with x++?
For example: Is there any class with function createProd(itemId _itemId, Qty
_qty)?
How do you create productions?
--
Regards
Joerg
Stefan Ebert
2008-04-11 12:21:08 UTC
Permalink
Hi,

please pay attention, mentioned solution lacks on following:

1) no BOM and route:
User has explicitely to pass it by using:

prodTable.RouteId = inventTable.routeId (dateNull(), myQty);
prodTable.BOMId = inventTable.BOMId (dateNull(), myQty);


2) missing trans data:

I tried prodTable.insert() approach some time ago, but recovered that no
record in InventTrans table will be created.
So I had a look on Form "ProdTableCreate" which uses
"prodTable.insertFromForm(...)" method instead. Unfortunately, those form
contains mixture of methods, event handlers and data sources methods (and
... of course, a gui).


Jörg, did you meantime resolve the problem?

Axel, do you know a "better" encapsulation of the po creation process? I'm
very interested.

--
Ciao,
Stefan Ebert
Post by Axel Kühn
Hi,
static void CreateProd(Args _args)
{
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find("YourItemId");
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.QtySched = <YourQty>;
prodTable.insert();
}
Hope that hepls you.
--
Sincerely yours
Axel Kühn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by jos
Hi,
is there an easy way to create production orders with x++?
For example: Is there any class with function createProd(itemId _itemId, Qty
_qty)?
How do you create productions?
--
Regards
Joerg
Axel Kühn
2008-04-11 16:05:01 UTC
Permalink
Hi Stefan,

thank you for the information. This I still do not have noticed. :-(
Sorry for that.

Yes, i think i have a "better" or let my say working solution for creating
production oderers with x++. :-)

I played a litte bit and found this way:

static void CreateProductionOrder(Args _args)
{
ProdQtySched productionQty = 1;
ItemId productionItem = "AKU-1000";

ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find(productionItem);

//Initialise the base values
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);

prodTable.DlvDate = today();

prodTable.QtySched = productionQty;
prodTable.RemainInventPhysical = prodTable.QtySched;

//Set the active bom and route
prodTable.BOMId = BOMVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).BOMId;
prodTable.RouteId = RouteVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).RouteId;

prodTable.initRouteVersion();
prodTable.initBOMVersion();

//Use ProdTableType class to create the production order
prodTable.type().insert();
}

The code above set the active BOM / Route and also creates the InventTrans
data.
--
Sincerely yours
Axel Kühn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Stefan Ebert
Hi,
prodTable.RouteId = inventTable.routeId (dateNull(), myQty);
prodTable.BOMId = inventTable.BOMId (dateNull(), myQty);
I tried prodTable.insert() approach some time ago, but recovered that no
record in InventTrans table will be created.
So I had a look on Form "ProdTableCreate" which uses
"prodTable.insertFromForm(...)" method instead. Unfortunately, those form
contains mixture of methods, event handlers and data sources methods (and
.... of course, a gui).
Jörg, did you meantime resolve the problem?
Axel, do you know a "better" encapsulation of the po creation process? I'm
very interested.
--
Ciao,
Stefan Ebert
Post by Axel Kühn
Hi,
static void CreateProd(Args _args)
{
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find("YourItemId");
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.QtySched = <YourQty>;
prodTable.insert();
}
Hope that hepls you.
--
Sincerely yours
Axel Kühn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by jos
Hi,
is there an easy way to create production orders with x++?
For example: Is there any class with function createProd(itemId _itemId, Qty
_qty)?
How do you create productions?
--
Regards
Joerg
Stefan Ebert
2008-04-14 16:39:21 UTC
Permalink
Dear Axel,

Respect! Works perfect.

Ciao,
Stefan Ebert
Post by Axel Kühn
Hi Stefan,
thank you for the information. This I still do not have noticed. :-(
Sorry for that.
Yes, i think i have a "better" or let my say working solution for creating
production oderers with x++. :-)
static void CreateProductionOrder(Args _args)
{
ProdQtySched productionQty = 1;
ItemId productionItem = "AKU-1000";
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find(productionItem);
//Initialise the base values
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.DlvDate = today();
prodTable.QtySched = productionQty;
prodTable.RemainInventPhysical = prodTable.QtySched;
//Set the active bom and route
prodTable.BOMId = BOMVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).BOMId;
prodTable.RouteId = RouteVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).RouteId;
prodTable.initRouteVersion();
prodTable.initBOMVersion();
//Use ProdTableType class to create the production order
prodTable.type().insert();
}
The code above set the active BOM / Route and also creates the InventTrans
data.
--
Sincerely yours
Axel Kühn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Stefan Ebert
Hi,
prodTable.RouteId = inventTable.routeId (dateNull(), myQty);
prodTable.BOMId = inventTable.BOMId (dateNull(), myQty);
I tried prodTable.insert() approach some time ago, but recovered that no
record in InventTrans table will be created.
So I had a look on Form "ProdTableCreate" which uses
"prodTable.insertFromForm(...)" method instead. Unfortunately, those form
contains mixture of methods, event handlers and data sources methods (and
.... of course, a gui).
Jörg, did you meantime resolve the problem?
Axel, do you know a "better" encapsulation of the po creation process? I'm
very interested.
--
Ciao,
Stefan Ebert
Post by Axel Kühn
Hi,
static void CreateProd(Args _args)
{
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find("YourItemId");
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.QtySched = <YourQty>;
prodTable.insert();
}
Hope that hepls you.
--
Sincerely yours
http://blog.ak-home.net)
Post by jos
Hi,
is there an easy way to create production orders with x++?
For example: Is there any class with function createProd(itemId
_itemId,
Qty
_qty)?
How do you create productions?
--
Regards
Joerg
Nicola Garbinato
2010-11-15 10:48:58 UTC
Permalink
Test
Post by jos
Hi,
is there an easy way to create production orders with x++?
For example: Is there any class with function createProd(itemId _itemId, Qty
_qty)?
How do you create productions?
--
Regards
Joerg
Post by Axel Kühn
Hi,
static void CreateProd(Args _args)
{
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find("YourItemId");
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.QtySched = <YourQty>;
prodTable.insert();
}
Hope that hepls you.
--
Sincerely yours
Axel K??hn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Stefan Ebert
Hi,
prodTable.RouteId = inventTable.routeId (dateNull(), myQty);
prodTable.BOMId = inventTable.BOMId (dateNull(), myQty);
I tried prodTable.insert() approach some time ago, but recovered that no
record in InventTrans table will be created.
So I had a look on Form "ProdTableCreate" which uses
"prodTable.insertFromForm(...)" method instead. Unfortunately, those form
contains mixture of methods, event handlers and data sources methods (and
... of course, a gui).
J?rg, did you meantime resolve the problem?
Axel, do you know a "better" encapsulation of the po creation process? I'm
very interested.
--
Ciao,
Stefan Ebert
Post by Axel Kühn
Hi Stefan,
thank you for the information. This I still do not have noticed. :-(
Sorry for that.
Yes, i think i have a "better" or let my say working solution for creating
production oderers with x++. :-)
static void CreateProductionOrder(Args _args)
{
ProdQtySched productionQty = 1;
ItemId productionItem = "AKU-1000";
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find(productionItem);
//Initialise the base values
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.DlvDate = today();
prodTable.QtySched = productionQty;
prodTable.RemainInventPhysical = prodTable.QtySched;
//Set the active bom and route
prodTable.BOMId = BOMVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).BOMId;
prodTable.RouteId = RouteVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).RouteId;
prodTable.initRouteVersion();
prodTable.initBOMVersion();
//Use ProdTableType class to create the production order
prodTable.type().insert();
}
The code above set the active BOM / Route and also creates the InventTrans
data.
--
Sincerely yours
Axel K??hn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Stefan Ebert
Dear Axel,
Respect! Works perfect.
Ciao,
Stefan Ebert
Submitted via EggHeadCafe
Microsoft .NET DataBase Access For Beginners
http://www.eggheadcafe.com/training-topic-area/Microsoft-NET-DataBase-Access/1/SQL-Server-Oracle-DB2-Informix-Query-Samples.aspx
Nicola Garbinato
2010-11-15 10:49:56 UTC
Permalink
TEST
Post by jos
Hi,
is there an easy way to create production orders with x++?
For example: Is there any class with function createProd(itemId _itemId, Qty
_qty)?
How do you create productions?
--
Regards
Joerg
Post by Axel Kühn
Hi,
static void CreateProd(Args _args)
{
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find("YourItemId");
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.QtySched = <YourQty>;
prodTable.insert();
}
Hope that hepls you.
--
Sincerely yours
Axel K??hn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Stefan Ebert
Hi,
prodTable.RouteId = inventTable.routeId (dateNull(), myQty);
prodTable.BOMId = inventTable.BOMId (dateNull(), myQty);
I tried prodTable.insert() approach some time ago, but recovered that no
record in InventTrans table will be created.
So I had a look on Form "ProdTableCreate" which uses
"prodTable.insertFromForm(...)" method instead. Unfortunately, those form
contains mixture of methods, event handlers and data sources methods (and
... of course, a gui).
J?rg, did you meantime resolve the problem?
Axel, do you know a "better" encapsulation of the po creation process? I'm
very interested.
--
Ciao,
Stefan Ebert
Post by Axel Kühn
Hi Stefan,
thank you for the information. This I still do not have noticed. :-(
Sorry for that.
Yes, i think i have a "better" or let my say working solution for creating
production oderers with x++. :-)
static void CreateProductionOrder(Args _args)
{
ProdQtySched productionQty = 1;
ItemId productionItem = "AKU-1000";
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find(productionItem);
//Initialise the base values
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.DlvDate = today();
prodTable.QtySched = productionQty;
prodTable.RemainInventPhysical = prodTable.QtySched;
//Set the active bom and route
prodTable.BOMId = BOMVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).BOMId;
prodTable.RouteId = RouteVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).RouteId;
prodTable.initRouteVersion();
prodTable.initBOMVersion();
//Use ProdTableType class to create the production order
prodTable.type().insert();
}
The code above set the active BOM / Route and also creates the InventTrans
data.
--
Sincerely yours
Axel K??hn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Stefan Ebert
Dear Axel,
Respect! Works perfect.
Ciao,
Stefan Ebert
Post by Stefan Ebert
Test
Submitted via EggHeadCafe
Microsoft .NET DataBase Access For Beginners
http://www.eggheadcafe.com/training-topic-area/Microsoft-NET-DataBase-Access/1/SQL-Server-Oracle-DB2-Informix-Query-Samples.aspx
Nicola Garbinato
2010-11-15 10:50:23 UTC
Permalink
test
Post by jos
Hi,
is there an easy way to create production orders with x++?
For example: Is there any class with function createProd(itemId _itemId, Qty
_qty)?
How do you create productions?
--
Regards
Joerg
Post by Axel Kühn
Hi,
static void CreateProd(Args _args)
{
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find("YourItemId");
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.QtySched = <YourQty>;
prodTable.insert();
}
Hope that hepls you.
--
Sincerely yours
Axel K??hn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Stefan Ebert
Hi,
prodTable.RouteId = inventTable.routeId (dateNull(), myQty);
prodTable.BOMId = inventTable.BOMId (dateNull(), myQty);
I tried prodTable.insert() approach some time ago, but recovered that no
record in InventTrans table will be created.
So I had a look on Form "ProdTableCreate" which uses
"prodTable.insertFromForm(...)" method instead. Unfortunately, those form
contains mixture of methods, event handlers and data sources methods (and
... of course, a gui).
J?rg, did you meantime resolve the problem?
Axel, do you know a "better" encapsulation of the po creation process? I'm
very interested.
--
Ciao,
Stefan Ebert
Post by Axel Kühn
Hi Stefan,
thank you for the information. This I still do not have noticed. :-(
Sorry for that.
Yes, i think i have a "better" or let my say working solution for creating
production oderers with x++. :-)
static void CreateProductionOrder(Args _args)
{
ProdQtySched productionQty = 1;
ItemId productionItem = "AKU-1000";
ProdTable prodTable;
InventTable inventTable;
;
inventTable = InventTable::find(productionItem);
//Initialise the base values
prodTable.initValue();
prodTable.ItemId = inventTable.ItemId;
prodTable.initFromInventTable(inventTable);
prodTable.DlvDate = today();
prodTable.QtySched = productionQty;
prodTable.RemainInventPhysical = prodTable.QtySched;
//Set the active bom and route
prodTable.BOMId = BOMVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).BOMId;
prodTable.RouteId = RouteVersion::findActive(prodTable.ItemId,
prodTable.BOMDate,
prodTable.QtySched).RouteId;
prodTable.initRouteVersion();
prodTable.initBOMVersion();
//Use ProdTableType class to create the production order
prodTable.type().insert();
}
The code above set the active BOM / Route and also creates the InventTrans
data.
--
Sincerely yours
Axel K??hn (visit my Dynamics AX blog at: http://blog.ak-home.net)
Post by Stefan Ebert
Dear Axel,
Respect! Works perfect.
Ciao,
Stefan Ebert
Test
Post by Stefan Ebert
TEST
Submitted via EggHeadCafe
Microsoft .NET DataBase Access For Beginners
http://www.eggheadcafe.com/training-topic-area/Microsoft-NET-DataBase-Access/1/SQL-Server-Oracle-DB2-Informix-Query-Samples.aspx
Loading...