Discussion:
Dim Warehouse not correct when executing from x++ - Please help
(too old to reply)
Eduardo
2010-08-05 22:50:03 UTC
Permalink
Hi,

I have managed to be able to create a Transfer Order header and line with
the header status to "Created" thanks to the help of many of you.

However, I'm facing a situation that I cannot solve. Basicaly, I need to
transfer the items from Waehouse DOCK to Warehouse 001.

The header takes this information well, but when I'm creating the line,
unless I comment a method called CheckInventLocationId
(InventMov_TransferFrom class) I always get an error message saying that the
Warehouse From should be DOCK.

Now, the application is correct as when I create the line without going into
the method stated above, under the Dimenssions tab (line) the warehouse is
950 and the site DI, where these should be FR and DOCK.

The weird thing is that when I create the item directly into the form and
triggers the initFromInventTable method, everything is correct.

What am I missing? The following is the code. Thanks a lot!
static void TestTOCreation(Args _args)
{
InventLocationIdFrom fromLoc = 'DOCK';
InventLocationIdTo toLoc = '001';
InventTransferTable inventTransferTable;
InventTransferLine inventTransferLine;
NumberSequenceReference numberSequenceReference;
NumberSeq numberSeq;
Qty qtyTransfer;
ItemId itemId;
;

inventTransferTable.clear();
inventTransferTable.initValue();
numberSequenceReference = InventParameters::numRefTransferId();
numberSeq =
numberSeq::newGetNumFromCode(numberSequenceReference.NumberSequence);
ttsbegin;
inventTransferTable.TransferId = numberSeq.num();
ttscommit;
inventTransferTable.InventLocationIdFrom = fromLoc;
inventTransferTable.modifiedField(fieldNum(inventTransferTable,
InventLocationIdFrom));
inventTransferTable.InventLocationIdTo = toLoc;
inventTransferTable.modifiedField(fieldNum(inventTransferTable,
InventLocationIdTo));
inventTransferTable.ShipDate = today();
inventTransferTable.ReceiveDate = today() + 21;
inventTransferTable.TransferStatus = InventTransferStatus::Created;
inventTransferTable.insert();

itemId = '01-3016-150';
qtyTransfer = 1020;

inventTransferLine.clear();
inventTransferLine.LineNum = 1;
inventTransferLine.initFromInventTransferTable(inventTransferTable,
NoYes::Yes);
inventTransferLine.ItemId = itemId;
inventTransferLine.initFromInventTable(InventTable::find(itemId));
inventTransferLine.QtyTransfer = qtyTransfer;
inventTransferLine.QtyRemainShip = qtyTransfer;
inventTransferLine.QtyRemainReceive = qtyTransfer;
inventTransferLine.QtyShipNow = 0;
inventTransferLine.QtyReceiveNow = 0;
//this following line is where the update gets cancelled because of the
CheckinventLocation.
inventTransferLine.insert();

}
kurt hatlevik
2010-08-06 18:44:39 UTC
Permalink
Hi.

I think the solution to you problem is to make sure the InventTransfer.InventDimId is properly set in your job. The warehouse (inventdim.InventLocationId) must be equal to the from warehouse on the transfer order.

/kurt



Eduardo wrote:

Dim Warehouse not correct when executing from x++ - Please help
05-Aug-10

Hi

I have managed to be able to create a Transfer Order header and line wit
the header status to "Created" thanks to the help of many of you

However, I am facing a situation that I cannot solve. Basicaly, I need t
transfer the items from Waehouse DOCK to Warehouse 001

The header takes this information well, but when I am creating the line
unless I comment a method called CheckInventLocationI
(InventMov_TransferFrom class) I always get an error message saying that th
Warehouse From should be DOCK

Now, the application is correct as when I create the line without going int
the method stated above, under the Dimenssions tab (line) the warehouse i
950 and the site DI, where these should be FR and DOCK

The weird thing is that when I create the item directly into the form an
triggers the initFromInventTable method, everything is correct

What am I missing? The following is the code. Thanks a lot
static void TestTOCreation(Args _args

InventLocationIdFrom fromLoc = 'DOCK'
InventLocationIdTo toLoc = '001'
InventTransferTable inventTransferTable
InventTransferLine inventTransferLine
NumberSequenceReference numberSequenceReference
NumberSeq numberSeq
Qty qtyTransfer
ItemId itemId


inventTransferTable.clear()
inventTransferTable.initValue()
numberSequenceReference = InventParameters::numRefTransferId()
numberSeq
numberSeq::newGetNumFromCode(numberSequenceReference.NumberSequence)
ttsbegin
inventTransferTable.TransferId = numberSeq.num()
ttscommit
inventTransferTable.InventLocationIdFrom = fromLoc
inventTransferTable.modifiedField(fieldNum(inventTransferTable
InventLocationIdFrom))
inventTransferTable.InventLocationIdTo = toLoc
inventTransferTable.modifiedField(fieldNum(inventTransferTable
InventLocationIdTo))
inventTransferTable.ShipDate = today()
inventTransferTable.ReceiveDate = today() + 21
inventTransferTable.TransferStatus = InventTransferStatus::Created
inventTransferTable.insert()

itemId = '01-3016-150'
qtyTransfer = 1020

inventTransferLine.clear()
inventTransferLine.LineNum = 1
inventTransferLine.initFromInventTransferTable(inventTransferTable
NoYes::Yes)
inventTransferLine.ItemId = itemId
inventTransferLine.initFromInventTable(InventTable::find(itemId))
inventTransferLine.QtyTransfer = qtyTransfer
inventTransferLine.QtyRemainShip = qtyTransfer
inventTransferLine.QtyRemainReceive = qtyTransfer
inventTransferLine.QtyShipNow = 0
inventTransferLine.QtyReceiveNow = 0
//this following line is where the update gets cancelled because of th
CheckinventLocation
inventTransferLine.insert()

}

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
AJAX Web Service Driven Customers Table With Customer Details
http://www.eggheadcafe.com/tutorials/aspnet/4c3d2726-d99e-4f83-9e49-0d4867b6271a/ajax-web-service-driven-customers-table-with-customer-details.aspx
Eduardo
2010-08-06 20:09:03 UTC
Permalink
Kurt,

Thanks for your response.

So, where would I be assigning the value to inventdim.InventLocationId?

As far as I know, the value is sent to the merge inventory method like this:

inventTransferLine.InventDimId =
inventTransferLine.inventDimMergeWarehouse(inventTransferTable.InventLocationIdFrom,inventTransferTable).InventDimId;

Where the inventTransferTable.InventLocationIdFrom is equal to DOCK.

Is there a direct assigment I can perform? if so, would you be able to send
me a code sample on how to instatiate the InventDim table and assign the
value to it without knowing what the dim id is?

While debuging everything seems to go well, but at some point the code just
changes thge values of the dim table to 950.

Thanks for your response and help.

Eduardo
Post by kurt hatlevik
Hi.
I think the solution to you problem is to make sure the InventTransfer.InventDimId is properly set in your job. The warehouse (inventdim.InventLocationId) must be equal to the from warehouse on the transfer order.
/kurt
Dim Warehouse not correct when executing from x++ - Please help
05-Aug-10
Hi,
I have managed to be able to create a Transfer Order header and line with
the header status to "Created" thanks to the help of many of you.
However, I am facing a situation that I cannot solve. Basicaly, I need to
transfer the items from Waehouse DOCK to Warehouse 001.
The header takes this information well, but when I am creating the line,
unless I comment a method called CheckInventLocationId
(InventMov_TransferFrom class) I always get an error message saying that the
Warehouse From should be DOCK.
Now, the application is correct as when I create the line without going into
the method stated above, under the Dimenssions tab (line) the warehouse is
950 and the site DI, where these should be FR and DOCK.
The weird thing is that when I create the item directly into the form and
triggers the initFromInventTable method, everything is correct.
What am I missing? The following is the code. Thanks a lot!
static void TestTOCreation(Args _args)
{
InventLocationIdFrom fromLoc = 'DOCK';
InventLocationIdTo toLoc = '001';
InventTransferTable inventTransferTable;
InventTransferLine inventTransferLine;
NumberSequenceReference numberSequenceReference;
NumberSeq numberSeq;
Qty qtyTransfer;
ItemId itemId;
;
inventTransferTable.clear();
inventTransferTable.initValue();
numberSequenceReference = InventParameters::numRefTransferId();
numberSeq =
numberSeq::newGetNumFromCode(numberSequenceReference.NumberSequence);
ttsbegin;
inventTransferTable.TransferId = numberSeq.num();
ttscommit;
inventTransferTable.InventLocationIdFrom = fromLoc;
inventTransferTable.modifiedField(fieldNum(inventTransferTable,
InventLocationIdFrom));
inventTransferTable.InventLocationIdTo = toLoc;
inventTransferTable.modifiedField(fieldNum(inventTransferTable,
InventLocationIdTo));
inventTransferTable.ShipDate = today();
inventTransferTable.ReceiveDate = today() + 21;
inventTransferTable.TransferStatus = InventTransferStatus::Created;
inventTransferTable.insert();
itemId = '01-3016-150';
qtyTransfer = 1020;
inventTransferLine.clear();
inventTransferLine.LineNum = 1;
inventTransferLine.initFromInventTransferTable(inventTransferTable,
NoYes::Yes);
inventTransferLine.ItemId = itemId;
inventTransferLine.initFromInventTable(InventTable::find(itemId));
inventTransferLine.QtyTransfer = qtyTransfer;
inventTransferLine.QtyRemainShip = qtyTransfer;
inventTransferLine.QtyRemainReceive = qtyTransfer;
inventTransferLine.QtyShipNow = 0;
inventTransferLine.QtyReceiveNow = 0;
//this following line is where the update gets cancelled because of the
CheckinventLocation.
inventTransferLine.insert();
}
Submitted via EggHeadCafe - Software Developer Portal of Choice
AJAX Web Service Driven Customers Table With Customer Details
http://www.eggheadcafe.com/tutorials/aspnet/4c3d2726-d99e-4f83-9e49-0d4867b6271a/ajax-web-service-driven-customers-table-with-customer-details.aspx
.
Loading...