Random salt and PBKDF2 key Suppose I wrote a function $$(salt,IV ) = \text{keyIVGenerator}(passwd)$$ which generates a random salt of size 32-bytes and a random Initialisation Vector (IV) of size 16-bytes. Then, use a  Key Derivation Function (KDF) like PBKDF2 to generate a key of length 32 bytes (dkLen=32).
$$key = PBKDF2(password, salt, deLen)$$
I created a function  $$ c = encryption(key,data,IV)$$, assume that padding of data (using aes CBC) is correctly done and logic is right.
When I ask the user for encryption and data, I pass the password to the function $keyIVGenerator(passwd)$ to get the $IV,key$, and $passwd$ them to the $encryption(key,data,iv)$ along with data. The encryption works.
And now suppose I have to decrypt the data I will need to pass the same key as generated by PBKDF2 for encryption to decrypt my data. The iv was prepended to the ciphertext.
But what about the salt.
If I pass the password requested from the user to $keyIVGenerator(passwd)$ it will generate a new key with the new random salt, hence the data won't be decrypted.
Am I supposed to prepended my salt to the ciphertext too? Should I keep a database of salts?
How do I generate the same key from PBKDF2?
Yes, generally the salt is prefixed to the ciphertext.
In principle you always generate a new key for each salt, so you might not need the IV. I would however use the output of PBKDF2 to create a randomized IV and key just to be sure (e.g. using SHA-512 and then use the leftmost 32 for the key and the next 16 bytes for the IV).
It is also possible to use HKDF on the output of PBKDF2 to split off both the data key and IV from the generated intermediate key (that's more neat, but also harder to implement).

Notes:

It would be a good idea to use an authenticated mode such as GCM. In that case the IV should be 12 bytes.
dkLen is specified to be in bits, not bytes - at least in the standard. Key sizes generally are.
A salt of 16 bytes is generally plenty, but 32 bytes is OK too (it should still fit in a single block of even SHA-256, so it will likely not influence the work factor created by the hash function and iteration count).