3 Replies Latest reply: Dec 31, 2012 5:09 AM by igwe RSS

    using balances in BG_ABSENCE_DURATION

    igwe
      Hello, I'm getting this strange error.
      I created a balance HAJ_LEAVE_BALANCE, which feeds in a Days input value into the balance and added the assignment inception to date dimension to it.
      Now in my BG_ABSENCE_DURATION formula, I'm trying to use this balance to compare, like:

      if HAJ_LEAVE_BALANCE_ASG_ITD = 0 then e.t.c. Of course I already added the line

      DEFAULT FOR HAJ_LEAVE_BALANCE_ASG_ITD IS 0

      at the top of my formula.
      Unfortunately I keep getting this error:

      APP-FF-33005: The local variable HAJ_LEAVE_BALANCE_ASG_ITD was used before being initialized

      Not sure why this would happen. Can I use balances in quickpaint formulas or not? The balance is clearly visible in the table ff_database_items so I'm really scratching my head here

      Many Thanks
        • 1. Re: using balances in BG_ABSENCE_DURATION
          iavinash.com
          Hi,

          Could you please go to Balance screen and check if your balance name is associated with dimension "_ASG_ITD".
          Also please check all variables are spelled correctly.

          Thanks,
          Avinash
          • 2. Re: using balances in BG_ABSENCE_DURATION
            clive_t
            Hi

            The message occurs because the formula compiler doesn't recognise that as a database item. The DB items you use in any formula are only usable if they have all their required contexts set by the calling process - a QP-type formula does not set all the contexts that a payroll-type formula would. Check out the table FF_FTYPE_CONTEXT_USAGES to see the differences between the two formula types (formula_type_id = 61 for payroll, 101 for QP)

            In short, if you want to obtain balances for a QP formula you might need to make use of a pl/sql function within the QP formula.

            Clive

            Edited by: clive_t on 31-Dec-2012 10:57

            Edited by: clive_t on 31-Dec-2012 11:03
            • 3. Re: using balances in BG_ABSENCE_DURATION
              igwe
              Oh my, that is unfortunate. Thanks though. Have written a function to retrieve the value in question.