Clear actionResult?

Good afternoon,
I am working on customizing the Inventory Transfer Form using Application Studio. My goal is to have two buttons on the form in the From and To sections. The buttons are to replace the functionality of the search icon in the bin fields.

When I click the From Bin button, I run a BAQ called BinList to get a list of all the bins that have some parts in it. I use search-show, and search-value-set to set the fields in the form based on what the user chooses from the search screen. In particular I have three search-value-set widgets. One for bin, lot, and bin description. These work well. I set the search-value-set widgets to use the actionResult. This seems to pull in the right data.

When I click the To Bin button, I want to perform a similar operation to the one I described above. Except that I want to run a different BAQ called BinListWarehouse. This will list all of the bins in a warehouse, and will list any on hand quantity for the part entered. This way, someone can choose to transfer the parts to another bin where there are already parts, or choose another bin in the warehouse where there are not any parts. I attempted this by using the same process as above with a search-show, and several search-value-set widgets. However, when I choose a bin, the actionResult keeps return a row from 4 rows below the one I choose in the search. I can’t explain this with debugging.


4

Everything looks as if I legitimately choose the row 4 rows below my chosen row. This obviously returns the wrong bin and description to the form.

My questions is, am I using actionResult correctly? Do I need to clear or reset it somehow between search-shows?

BAQs For Reference:

BinList
select 
	(str(WhseBin.Fullness_c * 100) + '%') as [Calculated_RealFullness],
	[WhseBin].[Fullness_c] as [WhseBin_Fullness_c],
	[WhseBin].[Description] as [WhseBin_Description],
	[WhseBin].[WarehouseCode] as [WhseBin_WarehouseCode],
	[WhseBin].[BinNum] as [WhseBin_BinNum],
	[PartBin].[OnhandQty] as [PartBin_OnhandQty],
	[PartBin].[LotNum] as [PartBin_LotNum],
	[PartBin].[PartNum] as [PartBin_PartNum]
from Erp.PartBin as PartBin
inner join Erp.WhseBin as WhseBin on 
	WhseBin.Company = PartBin.Company
	and WhseBin.WarehouseCode = PartBin.WarehouseCode
	and WhseBin.BinNum = PartBin.BinNum
where (PartBin.PartNum = @Part)
 and (WhseBin.Fullness_c is not null)
BinListWarehouse
select 
	(str(WhseBin.Fullness_c * 100) + '%') as [Calculated_RealFullness],
	[WhseBin].[Fullness_c] as [WhseBin_Fullness_c],
	[WhseBin].[Description] as [WhseBin_Description],
	[WhseBin].[WarehouseCode] as [WhseBin_WarehouseCode],
	[WhseBin].[BinNum] as [WhseBin_BinNum],
	[SubQuery2].[Calculated_HaveOnHand] as [Calculated_HaveOnHand]
from Erp.WhseBin as WhseBin
left outer join  (select 
	[PartBin].[PartNum] as [PartBin_PartNum],
	[PartBin].[BinNum] as [PartBin_BinNum],
	(sum(PartBin.OnhandQty)) as [Calculated_HaveOnHand]
from Erp.PartBin as PartBin
group by [PartBin].[PartNum],
	[PartBin].[BinNum])  as SubQuery2 on 
	WhseBin.BinNum = SubQuery2.PartBin_BinNum
	and ( SubQuery2.PartBin_PartNum = @Part  )

where (WhseBin.WarehouseCode = @Warehouse)
 and (WhseBin.Fullness_c is not null)

Thank you for your time!
Nate

Try using searchResult instead of actionResult.

If that doesn’t work, you could try to use a data-clear widget and see if it will let you choose actionResult (not positive it will).


Tested this with clearing searchResult which is also a system view and it worked, so I imagine it will work for actionResult if my first suggestion doesn’t get you what you need.

1 Like

I tried both approaches. I added two data-clear widgets to the beginning and end of my events. I added one for searchResult, and one for actionResult. These changes did not seem to impact functionality at all. I still get the same result returned to the bin field. The result is exactly four rows down from the one I picked. It is so strange.

Does anyone else ever see duplicate events piling up while customizing forms in Application Studio? These all seem to point to the same events, but I can delete them one at a time until there is only one left without any issues. It seems like they pile up as I make changes and save. I think this is probably a separate issue.
1

I think I read your original post incorrectly. I thought it just wasn’t clearing out the data from the last search. So, when you choose row ‘n’, it’s populating your fields with row ‘n+4’?

I don’t know that clearing the data is the issue. But, yes, I consistently get the fourth result below the row I clicked in the search box. The frustrating part is that the “From” bin button works fine. It is just when I try to choose the “To” bin that I get the incorrect results.

Interestingly it seems like I can use actionResult and searchResult interchangeably without impacting the functionality of the form.

Sounds like a corrupt layer. Try the same concept on a fresh layer.

I keep deleting and recreating my layer from scratch. It does seem that there are some underlying bits that don’t get cleared. I have noticed weird little bugs even on a fresh layer. Man, I hate Kinetic!

Hm–maybe try clearing your browser cache? I don’t know if that will do anything, but it’s worth a shot?