pasting the selected field from a pop up
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.
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,
- Popover: Popover | Add Account Number[Get Script Parameter]
- Allow User Abort [ Off ]
- Set Field [ Invoices::Search ; "" ]
- Set Field [ Invoices::account number ; "" ]
- Perform Script [ “Trigger | Refresh Search” ]
- Commit Records/Requests
- [ No dialog ]
- If [ not IsEmpty ( Get ( ScriptParameter ) ) ]
- Set Variable [ $SELECTED_ITEM; Value:Get ( ScriptParameter ) ]
- Else If [ GetLayoutObjectAttribute ( "select_account_pop" ; "IsFrontPanel" )
- IsEmpty ( Get ( ScriptParameter ) ) ]
- Set Variable [ $SELECTED_ITEM; Value:List (accounts::Account Num ; accounts::CUSTOMER ID MATCH FIELD) ]
- Exit Script [ ]
- End If
- Go to Object [ Object Name: "select_account_pop" ]
- Close Popover
- Go to Field [ Invoices::account number ]
- Set Field [ Invoices::account number ; GetValue ($SELECTED_ITEM ; 1 ) ]