StockedProductList for all TradingPartner

hello i tried to get this in visual studio but not work please cant you tell me how it workt i need to list all items in rent in all places thanks

IEnumerable Product2 = StockedProductList.GetStockedProductList(giud,ProductType.All);

Hello again. I would need an error message to answer your question.

The sample project downloadable on this site loops through all jobsites and does exactly what you’re looking for. I’m not why you’re declaring the list as IEnumerable. While this may work, you should declare this as StockedProductList instead. The sample C# project shows this.

Can you give me the example link? Of the code that says it does this?

Here you go Sample C# Project

the example that you give to me not contains how get the StockedProductCollection, only list the the Locations . i need the products and locations and the rent or available , I tryied , and give me error please help me or give to me a real documentation about the methods .

   StockedProductCollection jobs = StockedProductCollection.GetStockedProductCollection(Guid.Empty,ProductType.All);

Error	CS0030	Cant not convert the object  'Avontus.Rental.Library.StockedProduct' en 'Avontus.Rental.Library.StockingLocationListItem'	Quantify.API	C:\Users\admin\Desktop\Quantify.API.cs\Program.cs	35	active

This should do it.

StockedProductList products = 
    StockedProductList.GetStockedProductList(Guid.Empty, ProductType.Product);

Hello i try this but allways give me 0 Elementes using Guid.Empty
but the Collection of Stock Products allways is empty .

Can you help me ¿¿?? , y need the stockedProducts’s Numbers like , Avaible, On Rent , Etc. by Productos off all the company.

Hello Marveen. You first need to create an instance of the list:

// Create instance
StockedProductList products = StockedProductList.Get(…);
// Count
int IntProductList = products.Count();

1 Like

the both of this give me Zero

StockedProductList StockedPrds = StockedProductList.GetStockedProductList(Guid.Empty, Guid.Empty, ProductType.Product);

StockedProductList StockedPrds2 = StockedProductList.GetStockedProductList(Guid.Empty, ProductType.All);

Hi Marveen. Thanks for posting.

In StockedProductList.GetStockedProductList({locationIDs}, {Guid.Empty}, {ProductType.Product}), you’d need to pass in the List(Of Guid) as the first parameter, containing the list of stocking-location-ids. This can be found in the following DataSet -

        DataSet orgData = StockingLocationOrganization.GetOrganizationData(ActiveStatus.Active);
        DataTable locations = orgData.Tables[0];

Thanks! Works Now For me !! thanks Again!