Have you established that the value you're passing in fir the folder - ri!folderId_int - contains a valid folder identifier? (Note: the id for a folder is unique in any given environment, so if you're storing/retrieveing the folder id in a reference source such as a constant or a database then if you promote this value from, say, DEV to TEST, the folder in the target environment may not have the same Id as the source envrionment)