AnsweredAssumed Answered

pasting the selected field from a pop up

Question asked by evansj2 on Feb 25, 2015
Latest reply on Feb 26, 2015 by philmodjunk

Title

pasting the selected field from a pop up

Post

hello

Working on an invoicing program and started with a template. I added a pop up that contains the account numbers associated with a specific client.

         
  1. 123456
  2.      
  3. 654321
  4.      
  5. 987654
  6.      
  7. Empty
  8.      
  9. Empty

I would like to be able to select one of the account numbers and have it paste into the next available field in the Invoice. Currently its only pasting the first entry from the Pop up, not the one I selected. Also its pasting it into the 1st row.

I've played with the following script for awhile and not had luck. Any ideas??

Here is the script,

         
  1. Popover: Popover | Add Account Number[Get Script Parameter]
  2.      
  3. Allow User Abort [ Off ]
  4.      
  5. Set Field [ Invoices::Search ; "" ]
  6.      
  7. Set Field [ Invoices::account number ; "" ]
  8.      
  9. Perform Script [ “Trigger | Refresh Search” ]
  10.      
  11. Commit Records/Requests
  12.      
  13. [ No dialog ]
  14.      
  15. If [ not IsEmpty ( Get ( ScriptParameter ) ) ]
  16.      
  17. Set Variable [ $SELECTED_ITEM; Value:Get ( ScriptParameter ) ]
  18.      
  19. Else If [ GetLayoutObjectAttribute ( "select_account_pop" ; "IsFrontPanel" )
  20.      
  21. and
  22.      
  23. IsEmpty ( Get ( ScriptParameter ) ) ]
  24.      
  25. Set Variable [ $SELECTED_ITEM; Value:List (accounts::Account Num ; accounts::CUSTOMER ID MATCH FIELD) ]
  26.      
  27. Else
  28.      
  29. Exit Script [ ]
  30.      
  31. End If
  32.      
  33. Go to Object [ Object Name: "select_account_pop" ]
  34.      
  35. Close Popover
  36.      
  37. Go to Field [ Invoices::account number ]
  38.      
  39. Set Field [ Invoices::account number ; GetValue ($SELECTED_ITEM ; 1 ) ]

Outcomes