Has anyone had an issue where you run an extract that the data keeps coming back significantly different. For instance the Total Quantity at the branch and or job level keeps changing. For instance I run the data with the total quantity at the branch level and I get 2000 and the next time I only get 1500.
Hi Chris. Is it likely that someone has completed a shipment? If not, you may also want to check your re-rented materials, it could be that you’re confusing the two?
The only Quantity I am bringing in through the API is QuantityOnRent, QuantityForRent, TotalPieces
When I compare the extract to the report in Quantify I am not getting the same quantities.
To determine if something is re-rented or not, you’ll also need to check the ‘OwnerTradingPartnerID’. If it’s null or an empty Guid then it’s something your company owns. There will be multiple parts, one for each owner, including your stock. Here’s a sample. If you’re still getting an error we can get a backup of your database and source code and take a look.
' Loop through stock at the branch
For Each prod As StockedProductListItem In branchStock
' Write part number
Console.WriteLine("PN: " + prod.PartNumber)
' If owned by someone else, show the owner name
If prod.OwnerTradingPartnerID <> Guid.Empty Then
Console.WriteLine("Owner: " + prod.OwnerName)
' Available stock at branch
Console.WriteLine("Available: " + prod.QuantityForRent)
Here’s an example.The 10’1" Bay Brace appears in the StockedProducts 3 times. Once blank (what we own) then two other times for the other re-rent owners, Alpha and Delta.
Ok I found the issue. I will need your help with this one. IT is only bringing in non-tracked jobs. Is there way that I can bring in the tracked jobs with the non-tracked jobs at once. Of do I need to perform two extracts.
Hi Chris. Not sure what a ‘tracked’ and ‘non-tracked’ job is. Is that some sort of custom property that you have set up on each job?
in the job setup you can select to track scaffold or not. If this is selected it is not bringing the job in. I believe that is what triggers the scaffold tag.
Ah, yes. There are basically two types of jobs, those that track scaffolds and those that don’t, like you’ve pointed out. Yes, I’m pretty sure you’ll need to process regular and scaffold jobs separately.
Ok thanks that is what I thought. SO I would need another loop to look for scaffold tag and bring in those separately.
Ok I am at a block. I can get the list of tags but not the branch and job and the products that are associated with the tag.
Hi Chris. As you’ve seen there, the scaffold tag is a bit different. Instead of being a type of stocking location like other treeview items, a scaffold has a StockingLocation (and stocked products, which is how you get the parts for a tag). It’s called a RelatedStockingLocation. The following code snippet will write out a few parent memmbers.
Console.WriteLine("Parent Job: " + scaffold.RelatedStockingLocation.ParentStockingLocation.Name)
Console.WriteLine("Parent Staging Area: " + scaffold.RelatedStockingLocation.ParentBranchOrLaydownOrStagingArea.Name)
Console.WriteLine("Parent Branch: " + scaffold.RelatedStockingLocation.ParentBranchOrLaydownOrStagingArea.ParentBranchOrLaydownOrStagingArea.Name),
When I run the quantities at the branch level. For some reason it is not pulling the out of service numbers.
'All branches / staging areas
Dim branches As StockingLocationList = StockingLocationList.GetBranchOfficesLaydownYardsAndStagingAreas(False, Guid.Empty)
' Loop through the branches
For Each branch In branches
' Skip inactive branches
If branch.IsActive = False Then Continue For
Dim branchprods As StockedProductList = StockedProductList.GetStockedProductList(
branch.StockingLocationID, Guid.Empty, ProductType.Product)
For Each branchprod In branchprods
'Export to Tableau SQL Database
'Write out all of the items
Dim strBranch As String = branch.Name
Dim strPartnerType As String = branch.PartnerTypeText
Dim strJobName As String = ""
Dim strTag As String = ""
Dim strPartNumber As String = branchprod.PartNumber
Dim strDescription As String = branchprod.Description
Dim strOwner As String = branchprod.OwnerName
If branchprod.OwnerName Is Nothing Then
strOwner = "BGO"
Dim strQtyAvailable As String = Convert.ToDecimal(branchprod.QuantityForRent)
If branchprod.QuantityForRent Is Nothing Then
strQtyAvailable = 0
Dim strQtyAtJob As String = Convert.ToDecimal(branchprod.QuantityOnRent)
If branchprod.QuantityOnRent Is Nothing Then
strQtyAtJob = 0
Dim strQtyInTransit As String = Convert.ToDecimal(branchprod.QuantityInTransit)
If branchprod.QuantityInTransit Is Nothing Then
strQtyInTransit = 0
Dim strQtyInReserve As String = Convert.ToDecimal(branchprod.QuantityReserved)
If strQtyInReserve Is Nothing Then
strQtyInReserve = 0
Dim strQtyTTL As String = Convert.ToDecimal(branchprod.TotalPieces)
If strQtyTTL Is Nothing Then
strQtyTTL = 0
Dim strQtyOOSLost As String = Convert.ToDecimal(branchprod.OutOfServiceLostQuantity)
If strQtyOOSLost Is Nothing Then
strQtyOOSLost = 0
Dim strQtyOOSNotRepairable As String = Convert.ToDecimal(branchprod.OutOfServiceNonRepairableQuantity)
If strQtyOOSNotRepairable Is Nothing Then
strQtyOOSNotRepairable = 0
Dim strQtyOOSRepairable As String = Convert.ToDecimal(branchprod.OutOfServiceRepairableQuantity)
If strQtyOOSRepairable Is Nothing Then
strQtyOOSRepairable = 0
Hi Chris. Have a look at the code sent on the 17th of last month. Snippet below is from there
' OOS parts for branch or laydown yard
If branch.PartnerType = PartnerTypes.BranchOffice Or
branch.PartnerType = PartnerTypes.LaydownYard Then
' Get damaged products - Change status for all others
Dim oosProds As StockedProductExtensionList =
' Write stocked parts at branch
For Each prod As StockedProductExtensionListItem In oosProds
Console.WriteLine("PN: " + prod.PartNumber)
Console.WriteLine("Damaged: " + prod.Quantity)
that only gives damaged. What about OOS lost, OOS repairable etc. All need to be extracted with the same branch, staging area data in line with that data. It is being put into a database and we need to know where all of the OOS equipment is at.
Change the StockedProductExtensionCondition
SO I am going to have to do an extract for each type of OOS. Even though it is part of the stocked product list object.
Experiment a bit. Try passing in None and see if that works to return all of them.