GL Account Override Lookup Example
If you allow users to code to expense in the AP Invoice, Expense, and PO modules, you may want to restrict the list of available GL Accounts by creating a GL Lookup.
Create a user-defined field on the GL Chart of
Accounts that shows only GL Accounts that have with a UD field. The following
example shows how to link the employee PRCo directly to the GLCo.
Add the following lookup in
Select cast(KeyID as varchar(10)) as ChoiceShortName, GLAcct + ' - ' + Description as ChoiceLongName
INNER JOIN GetEmplInfo(null,null,@AuthToken) a on kGLAC.GLCo = a.PRCo
WHERE kGLAC.udExpenseYN = 'Y'Note: To remove the GLCo link to the PRCo of the current user, remove "INNER JOIN GetEmplInfo(null,null,@AuthToken) a on kGLAC.GLCo = a.PRCo" from the SQL Choice Override.
If you allow users to enter expenses for other users, you can create a more
dynamic lookup that sends the PRCo and Employee of the proxied user, as shown in
the following example:
Select cast(kGLAC.KeyID as varchar(10)) as ChoiceShortName, GLAcct + ' - ' + kGLAC.Description + '- Employee ' + cast(kPREH.Employee as varchar(200)) as ChoiceLongName
INNER JOIN kPRDP on kGLAC.GLCo = kPRDP.PRCo and kGLAC.udPRDept = kPRDP.PRDept
INNER JOIN kPREH on kPRDP.PRCo = kPREH.PRCo and kPRDP.PRDept = kPREH.PRDept
WHERE kPREH.PRCo = @PRCo and kPREH.Employee = @Employee
- Assign the lookup to the portal setting GL Account Override Lookup located under .
Review your GL Chart of Accounts in Vista and mark
all appropriate accounts. See the following example:
Apply your lookup to the appropriate portal
- For AP: Invoice Line GL Account Override Lookup under .
- For Expense: GL Account Override Lookup under .
- For PO Pending: GL Account Override Lookup for PO under .