Quantcast
Channel: Sage 100
Viewing all articles
Browse latest Browse all 37863

Forum Post: Issue with button script/refresh grid

$
0
0
I have a button script in SO entry which uses the new invoke lookup function. The lookup calls the customer's price schedule list then after selecting it Adds that item to the order. The script works fine as long as the line is not the first line. If the line is the first time it forces focus to the totals tab. After the first line is written and you go back it never happens again. Anyone have any ideas??? Here is a copy of the script: retVal = 0 val = "" sDiv = "" sCust = "" sItem = "" lookupCode = "IM_PriceCodeCust" retVal = oBusObj.GetValue("ARDivisionNo$", sDiv) retVal = oBusObj.GetValue("CustomerNo$", sCust) set oLines = oBusObj.AsObject(oBusObj.Lines) If lookupCode "" Then retVal = oUIObj.InvokeLookup(LookupCode, val, sDiv + sCust + String(20 - Len(sCust),chr(0))) If retVal 0 And val "" Then sItem = replace(mid(val,6,30),chr(0),"") retVal = oLines.AddLine() retVal = oLines.SetValue("ItemCode$", sItem) retVal = oLines.Write() oScript.LinesAdded = 1 retVal = oScript.LoadGrid("GD_Lines") retVal = oUIObj.HandleScriptUI() End If End If

Viewing all articles
Browse latest Browse all 37863

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>