Skip to Main Content

How to set item's value via javascript without violating the ITEM_VALUE_PROTECTION?

DannyS-OracleJul 21 2016 — edited Jul 25 2016

Hi guys,

This is a follow up question from How to download a BLOB file with its original file format?, when I upload a file and save as BLOB, I lost the file's extension (e.g. test.csv becomes test) if I download it back. So based on some suggestion from that thread, I am trying to setup the MIME_TYPE attribute. To do so, I am trying to parse and get the file's extension via javascript. This is the step by step of what I am doing:

  1. Using javascript, parse the file's name from the upload field to get the extension and store into a variable (e.g. var EXTENSION = '.csv')
  2. Using javascript, set a hidden field's value to be the file's extension. This is the command: $s('P1_HIDDEN', EXTENSION)
  3. Submit the upload file form

Am I doing this correctly? I feel this is too much work to preserve the file's format. And after all these steps I got the ITEM_VALUE_PROTECTION error it seems I am not allowed to set a field's value via javascript? Is there a workaround for this?

I am using Apex v5.0.3

Thank you!

Danny

This post has been answered by PMON on Jul 21 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Aug 22 2016
Added on Jul 21 2016
8 comments
493 views