Chris (Toronto)
2006-09-15 12:37:01 UTC
Hi,
I need to import cost information from a supplier using X++ and I want to
use the trade agreement functionality.
I have created the following test code to setup a purchase trade agreement
for the given vendor and Item.
All of the records get inserted ok and exist in the priceDisc table, but
when I open up the item and view the purchase price trade agreements no
records are visible.
What am I missing?
Chris
--------------------------------------------------------------
static void test(Args _args)
{
PriceDiscTable pricedisctable;
itemId _itemId;
AccountNum _accountNum;
ioCost _ioCost;
;
// Setup variables
_itemId = '100011';
_accountNum = 'VN100003';
_ioCost = 999.99;
ttsbegin;
select forupdate pricedisctable;
priceDiscTable.clear();
priceDiscTable.initValue();
priceDiscTable.ItemCode = TableGroupAll::Table;
priceDiscTable.ItemRelation = _itemId;
priceDiscTable.AccountCode = TableGroupAll::Table;
priceDiscTable.AccountRelation = _accountNum;
priceDiscTable.QuantityAmount = 1;
priceDiscTable.FromDate = today();
priceDiscTable.Amount = _ioCost;
priceDiscTable.Currency = VendTable::find(_accountNum).Currency;
priceDiscTable.SearchAgain = NoYes::Yes;
priceDiscTable.relation = priceType::PricePurch;
priceDiscTable.UnitId = inventParameters::find().DefaultUnitId;
priceDiscTable.CalendarDays = Noyes::Yes;
priceDiscTable.validateWrite();
priceDiscTable.insert();
ttscommit;
}
I need to import cost information from a supplier using X++ and I want to
use the trade agreement functionality.
I have created the following test code to setup a purchase trade agreement
for the given vendor and Item.
All of the records get inserted ok and exist in the priceDisc table, but
when I open up the item and view the purchase price trade agreements no
records are visible.
What am I missing?
Chris
--------------------------------------------------------------
static void test(Args _args)
{
PriceDiscTable pricedisctable;
itemId _itemId;
AccountNum _accountNum;
ioCost _ioCost;
;
// Setup variables
_itemId = '100011';
_accountNum = 'VN100003';
_ioCost = 999.99;
ttsbegin;
select forupdate pricedisctable;
priceDiscTable.clear();
priceDiscTable.initValue();
priceDiscTable.ItemCode = TableGroupAll::Table;
priceDiscTable.ItemRelation = _itemId;
priceDiscTable.AccountCode = TableGroupAll::Table;
priceDiscTable.AccountRelation = _accountNum;
priceDiscTable.QuantityAmount = 1;
priceDiscTable.FromDate = today();
priceDiscTable.Amount = _ioCost;
priceDiscTable.Currency = VendTable::find(_accountNum).Currency;
priceDiscTable.SearchAgain = NoYes::Yes;
priceDiscTable.relation = priceType::PricePurch;
priceDiscTable.UnitId = inventParameters::find().DefaultUnitId;
priceDiscTable.CalendarDays = Noyes::Yes;
priceDiscTable.validateWrite();
priceDiscTable.insert();
ttscommit;
}