NetSuite: Can I expose a pdf of an invoice in a saved search for download? - netsuite

I need to expose the pdf version of a NetSuite invoice in my ecommerce site. I'm using saved searches to push up invoice header info but I want to be able to click a link and it will download the NetSuite invoice pdf.

The link to the PDF of an Invoice record looks like this:
/app/accounting/print/hotprint.nl?regular=T&sethotprinter=T&formnumber=102&id=3253&label=Invoice&printtype=transaction&trantype=custinvc
You can use a formula column in your search that dynamically fills in the correct parameters and generates an appropriate <a> tag.

You need to mark the PDF files in the File Cabinet to be "Available Without Login", this should provide you with an External URL you can use to download.

Here is what you can do : taking in consideration that you want the file to be accessible without netsuite login:
To access a file without login, it must be in file cabinet and with "Available without login" checked but when you click on Print in netsuite, this doesn't save the generated file in the file cabinet, so here is what you can do:
Add a custom transaction body field of type free-text or url.
Create a userevent script that trigger on aftersubmit (I'm here giving a general idea, so you can set it otherwise if you want).
Using the "render" (suitescript 2.0) : you can generate the PDF of your Invoice, save the file in the file cabinet with "Available without login" checked.
After saving the file, reload it and get its external url and save it in the custom field created in (1).
Updated your Saved Search to add the new field as a result column
Good luck :)

Related

Creating a NetSuite Restlet to pull files from Communications tab of a Vendor Bill

I am currently trying to create a NetSuite restlet that searches through all my vendor bills for bills that have a file in the Communications tab and then downloads the file.
My issue is that I can't seem to access the Files Sublist within the Communications tab. It looks likes the Files Sublist is a STATICLIST type (which isn't available for scripting according to this), so I need a workaround.
Has anyone dealt with this problem before?
I've done a customization similar with this problem before. You should be using a Saved Search and add your Vendor Bill ID as filter. There is a field called File (Line) Fields... and File Fields.... You can make use of their internal IDs.

saving mail attachment with PowerAutomate to sharepoint corrupts the file

I am trying to build a flow based on the PowerAutomate template
Create Planner task and add attachments to SharePoint on new email
arrival
This template works fine, in that it saves all the mail attachments to my sharepoint. But it only shows the link to the last attachment in the task.
I have worked around it, by adding a string variable and appending all the sharepoint paths to this variable.
With my Flow, everything runs smoothly. But the stored files are about 10%- 20% bigger in size than the original and they turn out to be corrupted.
The only difference I can spot in the saving of the file is as follows:
Template section has "get attachment" and the according "body('get attachment'):
While my in my version I can only select "get attachment (V2)" and the corresponding "body('get attachment (V2)')
There is an option with V2 that allows or disallows chunking, but there is no effect on my filesize.
The other difference is, that I have my flow create a different folder based on the task ID, since there where errors, if the same name attachment came a second time. But I have tried my flow without the added folders and there is no difference in file size.
The original files:
and the corrupted files:
It makes no difference if I use the sharepoint link provided through the flow to my new planner task, or if I open the files directly within sharepoint. The result is an error.
Can anyone guess, why my flow seems to store something more within the file and thus corrupting it? I can provide the other parts of the flow in more detail too. Here is the overview of my custom flow:
I actually found the answer after rewriting it from scratch:
Using the old template had me looking for the wrong information when adding the attachment content to sharepoint. I had always searched for "body" which was used in the template and gave me this
But searching for attachment the dynamic content actually showed me the right pieces. I am not sure, if I missed it before, or if recoding a template hid them somehow. With the rewrite from scratch I found this:
So, to make a long story short: Use "Content Bytes" of the "Get_Attachment_(V2)" Method and everything works fine.

Is there a way to get the file type of a document in an envelope (without extension)?

I am interesting in obtaining the file type (e.g. PDF, Word doc) of documents sent in an envelope. Of course this could be done just by getting the extension from the file name, but if a filename does not have an extension, is there an API call that would give me the file's type?
You cannot do this. Once the document is uploaded to DocuSign, it's always converted into a PDF. The original is not stored anywhere. You can have code that uses custom fields to store this information, but other than that - you would have to use the file name and the extension in there.

Uploading documents from iManage into SharePoint 2010

I have a requirement from my client to upload documents from iManage/FileSite into SharePoint 2010. When they try to upload documents into the document library they would also like to have an option to get the documents from iManage, other than from the filesystem. Please let me know if there is any easy solution to achieve this. Custom coding is also fine with me.
Thanks in advance.
Use the SPSite Class's Files.Add to upload your file from your alternate source.
There's a complete walkthrough of uploading a local file on MSDN.
I have developed a solution for this that uses the IWL protocol, but this would assume the user has WorkSite/DeskSite installed on their computer, and are running WorkSite 8.5 or greater.
iwl:dms={SERVERNAME}&lib={LIBRARY}&num={DocumentID}&ver={DocumentVersion}&command=opencmd
I then developed a insert link option for a user to insert a WorkSite link and they provide the link text, document number and version.
Another alternative is to upload a NRL file, but again this assumes the user has WorkSite/DeskSite installed.
In my case I wanted to have a hyperlink column in the Sharepoint 2013 pointing to a document in my fileSite.
e.g link: iwl:dms=DEV85SERVER&lib=LIVE&num=25210&ver=1
e.g link description: Document test
I tried to create a hyperlink column but SharePoint didn't recognize my DMS link.
So I had to create a calculated column to make the DMS link works.
Create a column called "Document Link" as Single line of text.
Create another column called "Document Description" as Single line of text.
Create a third column called "Link" as a calculated column.
3.1 insert the following formula:
=IF([Document Link]="","To be inserted","<a href='"&[Document Link]&"'>"&[Document Description]&"</a>")
3.2 Change the type returned from this formula to "Number"
Done!
This is just an example. I hope it helps.

How do I know if the user selected a SharePoint file in OpenFileDialog?

In an OpenFileDialog, the user can enter the address of the SharePoint site and select a document in the document library.
I need to provide check-in/check-out integration for SharePoint documents. Is there any way to determine if the file is stored in a SharePoint document library?
Thanks in advance!
After the dialog returns, you can check the value of the selected file. If there's a value, they probably selected a file. You can validate that a file was actually selected by attempting to open the file.
Start here: http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx

Resources