Adding tracking code to accounts payable

While receiving payment under an invoice the tracking code is inactive. Please assist

Tracking Codes are allocated during the posting of profit & loss transactions.
Receiving a payment is a balance sheet transaction and therefore are inactive.