- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
GL Budget lookup
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-20-2012 01:40 PM
I'm trying to retrieve the Budget Amounts from the GL_PeriodBudgetDetail file. It is not finding the record. Below is my code. What is the problem?
Thanks
'***** GL BUDGET TEST *******
oGlAccount = 0
TmpGL =""
TmpBudgetAcct=""
TmpAcct=""
TmpBudgetCode="BUDGET 3."
TmpFiscalYear="2010"
TmpFiscalPeriod="01"
TmpDebit=0
TmpCredit=0
Budget=0
'
retVal = oBusObj.GetValue("PurchasesAcctKey$",TmpAcct) 'Get Purchase Account Key
Set oGLAccount = oSession.AsObject(oSession.GetObject("GL_PeriodBud
'
TmpBudgetAcct = TmpAcct+TmpBudgetCOde+TmpFiscalYear+TmpFiscalPerio
MsgBox(TmpBudgetAcct)
retVal = oGLAccount.Find(TmpBudgetAcct) 'Find GL Budget Account
if retVal<>0 then
retVal = oGLAccount.GetValue("CreditAmount", TmpCredit) 'Get Account number
retVal = oGLAccount.GetValue("DebitAmount", TmpDebit) 'Get Account number
MsgBox(TmpCredit)
MsgBox(TmpDebit)
end if
Solved! Go to Solution.
Re: GL Budget lookup
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-20-2012 02:21 PM
My guess is that the key fields are not padded correctly with null. Try setting them individually.
retVal = oGLAccount.SetKeyValue("AccountKey$", TmpAcct)
retVal = oGLAccount.SetKeyValue("BudgetCode$", TmpBudgetCode)
retVal = oGLAccount.SetKeyValue("FiscalYear$", TmpFiscalYear)
retVal = oGLAccount.SetKeyValue("FiscalPeriod$", TmpFiscalPeriod)
retVal = oGLAccount.Find()
Sr. Software Engineer
Sage 100 ERP
Re: GL Budget lookup
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-20-2012 02:28 PM
Also, you probably don't have a period at the end of "BUDGET 3." in your data. The period you see in the key field in Data File Display and Maintenance isn't really a period. It represents nulls.
Sr. Software Engineer
Sage 100 ERP
Re: GL Budget lookup
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-21-2012 11:39 AM
Both of you were correct.
Thank you.


