Issue:
I’m facing issue while making a custom record of the online form which I’m getting from Shopify in NetSuite and this happens because I’m unable to upload the attachment or file into the file cabinet.
Tried:
I tried to convert the file or attachment into base64 and also through blob too but unable to get the desired result because Netsuite has limitations that it can’t handle more than 1000 characters and this also not a good workaround as the user has the privilege to update the image.
In Code:
Created an online HTML form and map their field with their related field and create a custom record for every record and I’m successfully able to map all the field except attachment(.png, .pdf, .png, etc)
Is there any way to get the result i.e successfully create the custom record through online HTML form or any other workaround to get the result?
3
Answers
For, Now whatever I checked or searched regarding upload image, maybe we are not able to upload an image into their respective field until and unless we save the particular file into the file cabinet.
So, I opt for some other method that is by going through
suitelet
and then POST the same form after storing the file in the file cabinet into the respective field.Here, is my workaround code:
Hope it helps others. And one more thing you need to decrypt the data as you saving in the file cabinet but if you change the file type to jpg image in all then you may do not need to need to convert it. Thanks
As far as I can find, the file cabinet is not available to online forms.
As a workaround, you could have Shopify “receive” the file, then code it to send the file to NetSuite via a custom email capture plugin.
Put the right data on the subject line so your capture script knows where to put the file.
I get the script from SuiteAnswers. It’s for 2nd version of NS script. The suitelet can be used via an
iframe
. You could directly attach the file to a the record and/or populate thecustrecord_file_id
. This it not the best practice if you have limited storage space.In my case, for
return/repair form
where the customer should upload a video or an image of the damaged product. I used the “google script” to upload the file into google drive and and I post only the URL to Netsuite via Suitelet.