I need to unallocate a determinate sales order (E.g OrderNum = 31 ) ; I have found a little example and I modified this to my issue ; I think I have to use the methods GetListOfOrders , OrderAllocationGetRows and finally UnallocateAndUnreserve ; but when i run my code , in the “GetListOfOrders” method I get the message “Specified argument was out of the range of valid values.”
The original code in the example indicate that the method requiere 16 arguments , but If i try to put it as the exple says i get the message “No overload for method ‘GetListOfOrders’ takes 16 arguments” ; This is clear for me because in the object explorer the method require only two arguments.
Im really apreciate any help.
My code:
//Unallocate Sales Order
System.Data.DataSet OrderAllocListDataSet;
Erp.Tablesets.OrderAllocTableset OrderAllocDataSet;
bool morePages = false;
string outMessage = string.Empty;
OrderAllocAdapter AllAdp = new OrderAllocAdapter(UD24Form);
AllAdp.BOConnect();
SearchOptions options = new SearchOptions(SearchMode.AutoSearch);
options.PreLoadSearchFilter = “OrderNum = 31”;// My Idea
//OrderAllocListDataSet = AllAdp.GetListOfOrders(options, out morePages);// My Idea
OrderAllocListDataSet = AllAdp.GetListOfOrders("",String.Format(“OrderNum = {0}”,31),"","","",“NoFilter,NoFilter,NoFilter,NoFilter”,"","","","","","",0,0,out morePages,"");// What the example says
//OrderAllocDataSet = AllAdp.OrderAllocationGetRows(OrderAllocListDataSet,0);
// AllAdp.UnallocateAndUnreserve(ref OrderAllocDataSet, out outMessage);
AllAdp.Dispose();
I’m trying to use the OrderAlloc adapter to make Unallocate/Unreserve transactions on a custom screen that grabs PartAllocations. Is there a way to query the OrderAlloc dataset to get the exact record I want to Unallocate/Unreserve. The trace really doesn’t show much for these types of transactions in FWB.