AnsweredAssumed Answered

template question - Invoice

Question asked by evansj2 on Apr 16, 2014

Title

template question - Invoice

Post

     All

     I used the invoice template as a starting point and needed to add account numbers to charge against (we don’t use cash/credit). I created another dbase and related it to the user so I can now just show the account numbers associated with a specific user.

     Using how the template deals with adding a Product to an invoice (press Add Line Item ect) I am trying to do the same thing with adding an Account number(s) to a invoice.

     I have the Popover working, it shows just the account numbers for the specific client.

     I duplicated the script, Popover I Add Product Item [Get Script Parameter], renamed it Popover I Add Account Number [Get Script Parameter] and replaced the values with what I thought they need to be. See below. But what’s happening is its pasting the first account number no matter which one I select in the popover list.

      

     Here is the script, and I will admit that I am not sure what some of its doing....

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" )

     and

     IsEmpty ( Get ( ScriptParameter ) ) ]

Set Variable [ $SELECTED_ITEM; Value:List (accounts::Account Num;"") ]

Else

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 ) ]

      

     Any ideas what I did wrong?

fmp.png

Outcomes