Tuesday, January 17, 2012

How to set Default Order Settings for an Item??

How to set Default Order Settings for an Item??
static void Set_DefaultOrderSettings(Args _args)
{
InventTable inventTable;
InventItemInventSetup invent;
InventItemPurchSetup purch;
InventItemSalesSetup sales;
;
delete_from invent;
delete_from purch;
delete_from sales;

while select inventTable
{
if(!InventItemPurchSetup::findDefault(inventTable.ItemId))
{
InventItemPurchSetup::insertDefault(inventTable.ItemId);
}

if(!InventItemInventSetup::findDefault(inventTable.ItemId))
{
InventItemInventSetup::insertDefault(inventTable.ItemId);
}
if(!InventItemSalesSetup::findDefault(inventTable.ItemId))
{
InventItemSalesSetup::insertDefault(inventTable.ItemId);
}
}
}
If you have deleted the Item master and imported with new items then run this job to automatically insert the default order settings for the all items..
Otherwise system will not allow u to create any item transactions it will give error like"No Item parameter for the item"..
Enjoy DAXing :)-

Tuesday, January 3, 2012

How to extract Date value from a DateTime field?

How to extract Date value from a DateTime field:
static void getDate(Args _args)
{
System.DateTime _dateTime;
Date _date;
PurchTable _purchTable;
;
_purchTable = PurchTable::find("PO000008");
_dateTime = System.DateTime::Parse(dateTime2str(_purchTable.createdDateTime));
_date = _dateTime.get_Date();
info(date2str(_date,-1,-1,-1,-1,-1,-1));
}
OR
static void getDate(Args _args)
{
System.DateTime _dateTime;
Date _date;
PurchTable _purchTable;
InteropPermission intPerm = new InteropPermission(InteropKind::ClrInterop);
;
_purchTable = PurchTable::find("PO000008");
intPerm.assert();
_dateTime = System.DateTime::Parse(dateTime2str(_purchTable.createdDateTime));
_date = _dateTime.get_Date();
CodeAccessPermission::revertAssert();
info(date2str(_date,-1,-1,-1,-1,-1,-1));
}
OR
Simply :)-
Instead of the third and second last lines you could use:
_dateTime = DateTimeUtil::date(_purchTable.createdDateTime); for the same result.

Difference between Transfer Journal ,Transfer Order and Stock Transfer?

What is the difference between a transfer journal and a transfer order?
A) With the help of the transfer journal, the Inventory Manager transfers the items from one dimension (warehouse, location, color, etc) to another one instantaneously.

The transfer order is used for registering in the system the items that must be moved from one warehouse to another and for managing this process.

Process Includes:
Create Transfer Order
Pick Items to Transfer->then->Picking list registeration
or
Pick Items to Transfer(No Picking list registeration)
Ship Transfer Order
Receive the Items at other end.

What is the difference between a transfer Order and Stock tranfer?
A) For Indian Localization taxation, Microsoft Included Stock transer.It will Includes taxes on the Item in the transfer Process(Create Stock transfer,Pick,ship,receive)