recently i have written a quick code to to post the invent transfer jounral
/// </summary>
/// <returns>
/// Buffer of the <c>InventJournalTable</c> table.
/// </returns>
Public InventJournalTable populateInventJournalTable()
{
InventJournalTable journalTable;
InventJournalTableData journalTableData;
journalTableData = JournalTableData::newTable(journalTable);
journalTable.JournalId = journalTableData.nextJournalId();
journalTable.Reservation = ItemReservation::Automatic;
journalTable.JournalType = InventJournalType::Transfer;
journalTableData.initFromJournalName(journalTableData.JournalStatic().findJournalName(journalTable.journalNameId));
journalTable.Description = InventDescription.valueStr();
journalTable.insert();
return journalTable;
}
/// </summary>
/// <param name="_InventJournalId">
/// <c>JournalId</c> of the <c>InventJournalTable</c>
/// </param>
/// <returns>
/// Buffer of the <c>InventJournalTrans</c> table.
/// </returns>
public InventJournalTrans populateInventJournalTrans(InventJournalId _InventJournalId)
{
InventJournalTrans inventJournalTrans;
InventDim toInventDim;
inventJournalTrans.TransDate = systemdateget();
inventJournalTrans.ItemId = inventSum.ItemId;
inventJournalTrans.Qty = InventQty.realValue();
// Dimensions from which the transfer performs
inventJournalTrans.InventDimId = inventDimLocal.inventDimId;
inventJournalTrans.initFromInventTable(InventTable::find(inventSum.ItemId), False, False);
// Dimensions To which the transfer performs
toInventDim.inventSiteId = InventSite.valueStr();
toInventDim.InventLocationId = InventWareHouse.valueStr();
inventJournalTrans.ToInventDimId = InventDim::findOrCreate(toInventDim).inventDimId;
inventJournalTrans.insert();
return inventJournalTrans;
}
/// <summary>
/// Creates and posts the Inventory Transfer Journal.
/// </summary>
/// <remarks>
/// If there is any exception then the Inventory Journal data is deleted.
/// </remarks>
public void createAndPostJournal()
{
InventJournalTable inventJournalTable;
InventJournalTrans inventjournalTrans;
JournalCheckPost journalCheckPost;
ttsbegin;
// populates the inventJournalTable table
inventJournalTable = element.populateInventJournalTable();
// populates the inventJournalTrans table
inventjournalTrans = element.populateInventJournalTrans(inventJournalTable.JournalId);
ttsCommit;
if (BOX::yesNo('Do you want to post the Journal ? ', DialogButton::Yes) == DialogButton::Yes)
{
// Call the static method to create the journal check post class
journalCheckPost = InventJournalCheckPost::newPostJournal(inventJournalTable);
if(journalCheckPost.validate())
{
try
{
journalCheckPost.run();
}
catch
{
// Deletes the InventJournalTable table, the InventJournalTrans will auto delete because of the Delete actions.
InventJournalTable.delete();
}
}
}
}
/// <summary>
/// Populates the
buffer of the <c>InventJournalTable</c> table data./// </summary>
/// <returns>
/// Buffer of the <c>InventJournalTable</c> table.
/// </returns>
Public InventJournalTable populateInventJournalTable()
{
InventJournalTable journalTable;
InventJournalTableData journalTableData;
journalTable.clear();
journalTable.JournalNameId =
InventParameters::find().QuickTransferJournalNameId;journalTableData = JournalTableData::newTable(journalTable);
journalTable.JournalId = journalTableData.nextJournalId();
journalTable.Reservation = ItemReservation::Automatic;
journalTable.JournalType = InventJournalType::Transfer;
journalTableData.initFromJournalName(journalTableData.JournalStatic().findJournalName(journalTable.journalNameId));
journalTable.Description = InventDescription.valueStr();
journalTable.insert();
return journalTable;
}
/// <summary>
/// Populates the
buffer of the <c>InventJournalTrans</c> table data./// </summary>
/// <param name="_InventJournalId">
/// <c>JournalId</c> of the <c>InventJournalTable</c>
/// </param>
/// <returns>
/// Buffer of the <c>InventJournalTrans</c> table.
/// </returns>
public InventJournalTrans populateInventJournalTrans(InventJournalId _InventJournalId)
{
InventJournalTrans inventJournalTrans;
InventDim toInventDim;
inventJournalTrans.JournalId
= _InventJournalId;
inventJournalTrans.JournalType = InventJournalType::Transfer;inventJournalTrans.TransDate = systemdateget();
inventJournalTrans.ItemId = inventSum.ItemId;
inventJournalTrans.Qty = InventQty.realValue();
// Dimensions from which the transfer performs
inventJournalTrans.InventDimId = inventDimLocal.inventDimId;
inventJournalTrans.initFromInventTable(InventTable::find(inventSum.ItemId), False, False);
// Dimensions To which the transfer performs
toInventDim.inventSiteId = InventSite.valueStr();
toInventDim.InventLocationId = InventWareHouse.valueStr();
inventJournalTrans.ToInventDimId = InventDim::findOrCreate(toInventDim).inventDimId;
inventJournalTrans.insert();
return inventJournalTrans;
}
/// <summary>
/// Creates and posts the Inventory Transfer Journal.
/// </summary>
/// <remarks>
/// If there is any exception then the Inventory Journal data is deleted.
/// </remarks>
public void createAndPostJournal()
{
InventJournalTable inventJournalTable;
InventJournalTrans inventjournalTrans;
JournalCheckPost journalCheckPost;
ttsbegin;
// populates the inventJournalTable table
inventJournalTable = element.populateInventJournalTable();
// populates the inventJournalTrans table
inventjournalTrans = element.populateInventJournalTrans(inventJournalTable.JournalId);
ttsCommit;
if (BOX::yesNo('Do you want to post the Journal ? ', DialogButton::Yes) == DialogButton::Yes)
{
// Call the static method to create the journal check post class
journalCheckPost = InventJournalCheckPost::newPostJournal(inventJournalTable);
if(journalCheckPost.validate())
{
try
{
journalCheckPost.run();
}
catch
{
// Deletes the InventJournalTable table, the InventJournalTrans will auto delete because of the Delete actions.
InventJournalTable.delete();
}
}
}
}
how about
ReplyDelete// Dimensions To which the transfer performs
toInventDim.inventSiteId = InventSite.valueStr();
toInventDim.InventLocationId = InventWareHouse.valueStr();
Where are declared those objects (InventSite, InventWareHouse);
There is a form that is created by BOF framework gets the input from user, these control are in that form. Here i put just the method that is do the posting of inventory journal.
DeleteThanks for the great information it worked fine, but i don't know how to post Inventory journal with allow transfer error to new journal.
ReplyDeletecould you help me with this please.
I would be interested to know how I can put this to use. Is this code an alternative to standard Ax?
ReplyDeleteBut most particularly - are you distinguishing between "Detail" and "Summary" option. We would LOVE it if the Summary option produced no GL journal if there was no financial impact of the transfer. At present we transfer from one Configuration to another - but when there is no cost change, we get 4 Journal lines that nett to zero for both Inventory and Adjustment GL accounts!
I would be interested to know how I can put this to use. Is this code an alternative to standard Ax?
ReplyDeleteBut most particularly - are you distinguishing between "Detail" and "Summary" option. We would LOVE it if the Summary option produced no GL journal if there was no financial impact of the transfer. At present we transfer from one Configuration to another - but when there is no cost change, we get 4 Journal lines that nett to zero for both Inventory and Adjustment GL accounts!
How to populate financial dimensions on to transfer journal line, thanks in advance.
ReplyDeleteinventSiteDimensionLink = inventSiteDimensionLink::newDimensionTables(inventJournalTrans, frominventDim);
DeleteinventSiteDimensionLink.linkDimension();
inventSiteDimensionLink = inventSiteDimensionLink::newDimensionTables(inventJournalTrans, frominventDim);
ReplyDeleteinventSiteDimensionLink.linkDimension();
Good post please visit here to get more technical material for ax
ReplyDeletehttp://daynamicsaxaptatutorials.blogspot.com
How are you handling Voucher here?
ReplyDeleteI am getting "Voucher number must be filled in" where Selection by field for Journal name points to "Entry". If I make it "Posting" it does work.
sakarya
ReplyDeleteyalova
elazığ
van
kilis
8K81KS
whatsapp goruntulu show
ReplyDeleteshow
KWQW
görüntülü show
ReplyDeleteücretlishow
5WOT
F6856
ReplyDeleteÇerkezköy Koltuk Kaplama
Ordu Parça Eşya Taşıma
Van Lojistik
Balıkesir Parça Eşya Taşıma
Aydın Şehir İçi Nakliyat
Kastamonu Parça Eşya Taşıma
Antalya Parça Eşya Taşıma
Muş Şehir İçi Nakliyat
Sinop Şehirler Arası Nakliyat
178F3
ReplyDeletebuy boldenone
order trenbolone enanthate
halotestin for sale
order dianabol methandienone
testosterone enanthate for sale
order peptides
order sarms
order boldenone
testosterone propionat
CEF1B
ReplyDeletereferans kodu binance
EAFAA
ReplyDeletekaraman rastgele görüntülü sohbet uygulamaları
Mobil Sohbet Siteleri
Hakkari Mobil Sohbet Odaları
mobil sohbet chat
tekirdağ mobil sohbet sitesi
ağrı chat sohbet
adana mobil sohbet chat
malatya sesli sohbet sesli chat
kırşehir bedava sohbet chat odaları
4FEFF
ReplyDeleteGörüntülü Sohbet
Tumblr Beğeni Satın Al
Bitcoin Madenciliği Nedir
Kripto Para Nasıl Üretilir
Kripto Para Madenciliği Nasıl Yapılır
Coin Üretme Siteleri
Coin Madenciliği Nedir
Mefa Coin Hangi Borsada
Kripto Para Kazanma Siteleri