Script advance to next line

SOLVED

Hello, 

Below is a simple script for SO invoice data entry that default the qty shipped to one which has been working fine for a few months.

'Script to set order and shipped quantity to 1 in SO Invoice Data Entry
DfltOrderQty=1
ItemType = ""

if oSession.CompanyCode = "MWR" or oSession.CompanyCode = "ZKR" then
 retVal = oBusObj.GetValue("ItemType$",ItemType)
  If ItemType="1" or ItemType = "5" then
     retVal = oBusObj.SetValue("QuantityOrdered",DfltOrderQty)
     'retVal = oBusObj.SetValue("QuantityShipped",DfltOrderQty)
  
End If
End If           'at end of code for company restriction

Client now wants to be able to scan the item number, set the quantity to one and advance to the next line.  I experimented with MoveLast, MoveNext.

Is there a method available to do this?

Thanks in advance for any assistance.

Parents
  • 0
    DfltOrderQty=1
    ItemType = ""

    'if oSession.CompanyCode = "MWR" or oSession.CompanyCode = "ZKR" then
    if oSession.CompanyCode = "ZKR" then    'for testing only
     retVal = oBusObj.GetValue("ItemType$",ItemType)
     If ItemType="1" or ItemType = "5" then
      retVal = oBusObj.SetValue("QuantityOrdered",DfltOrderQty)
      'retVal = oBusObj.SetValue("QuantityShipped",DfltOrderQty)
      retVal = oBusObj.Write()
     End If
     
    If oScript.UIObj > 0 Then
    CMD_STR = "" : oSession.AsObject(oScript.UIObj).GetValue "CMD_STR$", CMD_STR
    Select Case True
    Case UCase(Left(CMD_STR, 1)) = UCase("P")
    CMD_STR = "X PERFORM" & Mid(CMD_STR, 2) & "; "
    Case UCase(Left(CMD_STR, 1)) = UCase("X")
    CMD_STR = CMD_STR & "; "
    Case Else
    CMD_STR = "X "
    End Select
    CMD_STR = CMD_STR & "IF GD_Lines.CTL>0 THEN _obj'GoToCell(GD_Lines.CTL,GD_Lines.CTL'CurrentRow+1,""ItemCode$"") END_IF"
    oSession.AsObject(oScript.UIObj).SetVar "CMD_STR$", CMD_STR

    End If

    End If           'at end of code for company restriction
Reply
  • 0
    DfltOrderQty=1
    ItemType = ""

    'if oSession.CompanyCode = "MWR" or oSession.CompanyCode = "ZKR" then
    if oSession.CompanyCode = "ZKR" then    'for testing only
     retVal = oBusObj.GetValue("ItemType$",ItemType)
     If ItemType="1" or ItemType = "5" then
      retVal = oBusObj.SetValue("QuantityOrdered",DfltOrderQty)
      'retVal = oBusObj.SetValue("QuantityShipped",DfltOrderQty)
      retVal = oBusObj.Write()
     End If
     
    If oScript.UIObj > 0 Then
    CMD_STR = "" : oSession.AsObject(oScript.UIObj).GetValue "CMD_STR$", CMD_STR
    Select Case True
    Case UCase(Left(CMD_STR, 1)) = UCase("P")
    CMD_STR = "X PERFORM" & Mid(CMD_STR, 2) & "; "
    Case UCase(Left(CMD_STR, 1)) = UCase("X")
    CMD_STR = CMD_STR & "; "
    Case Else
    CMD_STR = "X "
    End Select
    CMD_STR = CMD_STR & "IF GD_Lines.CTL>0 THEN _obj'GoToCell(GD_Lines.CTL,GD_Lines.CTL'CurrentRow+1,""ItemCode$"") END_IF"
    oSession.AsObject(oScript.UIObj).SetVar "CMD_STR$", CMD_STR

    End If

    End If           'at end of code for company restriction
Children