I recently developed a script that could integrate with Salesforce and move documents via file blobs to individual Salesforce folders but with our organizations recent migration to Salesforce Lightning, I'm not able to find the Folder IDs that are needed to point captured files towards. My current code snippet is as follows:
spo_file=test.txt Document doc = new Document(Name=spo_file, Body=res.getBodyAsBlob(), FolderId=folder_id); insert doc; Blob headerValue= blob.valueOf(res.getBody()); String body = EncodingUtil.base64Encode(headerValue);
The problem I have here is that the original Folder IDs for document folders are no longer appearing in the new Salesforce Lightning folders since they now use Case Safe IDs and I haven't been able to find a workaround that gives me Folder IDs that I can use in my Apex code. Any ideas on where I should begin?
Here is a below error message I sometimes get from Apex due to the Case Safe Folder ID: