We have Sales Transaction Entry in VBA by reading the information from a third party table and populate the entry fields in the Sales Transaction Entry window (headers & details) without user intervention. It was working perfectly fine in GP8 but after we upgrade to GP10, I am now getting errors. The main problem I’m facing now is when populating the entry field for Invoice Quantity and Quantity Returned in the SalesItemDetailEntry window. If the Invoice quantity is higher than the available quantity, the SalesQuantityShortageOption window will open and we always select the default option “Override Shortage” by just clicking “OK” (SalesQuantityShortageOption.ok = 1) and the window will automatically close and go back to SalesItemDetailEntry window. It was fine in GP8 but not in GP10. There are errors like "SalesQuantityShortageOption window still open" and "Quantity not properly distributed". Please… is there any body who can help me, I’m stuck on this. Below is part of the code.
strQty = Str(rsSop!Quantity)
strUnitPri = Str(rsSop!UnitPrice)
If SalesItemDetailEntry.IsLoaded = False Then
SalesTransactionEntry.ExpansionButton5 = 1
End If
SalesItemDetailEntry.ItemNumber = rsSop!ItemNumber
SalesItemDetailEntry.QTY.Focus
SalesItemDetailEntry.QTY = strQty
SendKeys "{TAB}", True
If SalesQuantityShortageOption.IsLoaded = True Then
SalesQuantityShortageOption.OK = 1
SalesQuantityShortageOption.Close
End If
If SalesReturnedQuantitiesEntr.IsLoaded = True Then
SalesReturnedQuantitiesEntr.OnHand = strQty
SendKeys "{TAB}", True
SalesReturnedQuantitiesEntr.OK = 1
End IfSalesItemDetailEntry.UnitPrice.Focus
SalesItemDetailEntry.UnitPrice = strUnitPri
SendKeys "{TAB}", True
SalesItemDetailEntry.Save = 1
Thanks.
Salvo AB
*This post is locked for comments