With suitelet's external url unable to send mail - netsuite

We have an issue here. I don't know its by design or an issue that I'm only facing here. Its pretty strange that the same User Event is executing fine while I'm modifying a record through Suitelet's internal url but if I switched to external url its not working. Any guess why this is happening ?

Permission maybe? Under what role are you running the suitelet?

I got one solution for that i am calling restlet with suitelet to invoke user event. wrote some code in restlet like update fields on record type. and user event will trigger. and write mail logic in user event so mail will be sent.

Security Reasons, if your Suitelet is available without login or as you've mentioned accessible by "External URL" that means the it can be accessed by anyone that doesn't have an access to your NetSuite account. Having said that, do you want to send an email triggered by a user whom you don't know? I guess not.

Related

Email Attachments to SharePoint Document Library - Error

I have this weird problem when I try to use a simple default flow template to save email attachments to the company main SharePoint site: company.sharepoint.com (not subsite).
So I get started, by taking all the defaults of this flow, however, once i get to the point of providing the site address and document library path I get the error highlighted in red.
Where I get confused is that when I create a subsite like company.sharepoint.com/sites/testsite I enter the subsite address and the folder path automatically populates the folder structure for me to pick where I want to save such attachment.
I have given full owner permission to this test account with same results. So permission is not the problem.
My question is, could it be I'm using the wrong flow to save to a main SharePoint site? or this is something not allowed?
You could check the connector and recreate a new connection to SharePoint.
In many cases, an error code of 403 appears in a flow fail because of an authentication error. If you have this type of error, you can usually fix an authentication error by updating the connection, please make sure you have update the connection.
You could refer to this article.
Just in case anyone has a similar problem, the account to which you are creating a power automate flow must be a site collector to the root SharePoint site.

"Could not determine customer compid" USER_ERROR in netsuite sandbox

I have a User event which calls a restlet using nlapiRequestURL() method. The URL, headers and authorization seems fine but it returns an error message saying - "Could not determine customer compid". Has anyone had the same issue earlier or know how to work around with this. Any help is appreciated.
We see this occassionally when a Suitelet or Restlet URL isn't specific enough for NetSuite to know which company is trying to call the URL. The script id by itself is not enough to know the company if the user is not currently logged in to NetSuite.
You can add &compid=<YOUR NETSUITE ACCOUNT NUMBER> to the the URL to let NetSuite know which company is trying to call the specific URL.
Just adding this on because I had the same issue, you'll get the same error if you're hitting a sandbox and not capitalizing the SB in nlauth_account.
Eg NLAuth nlauth_account=XXXXXXX_SB1 instead of NLAuth nlauth_account=XXXXXXX_sb1.
We did face this issue, clearing browser cookies solved in most cases.
Sometimes the problem was persistent for about few hours and got fixed on its own.
If you're using NLAuth, be sure you use commas (not spaces) to separate the account, email, and signature fields. Using spaces gave me this error.

logging request and response while using netsuite suitetalk

is it possible to print/log the request response while using the Netsuite API, is there any property we need to set in the nsclient.properties file that might help.
I am trying to find this so that while integrating with NetSuite, in case of any issues, I don't have to go check the API request/response logs in NetSuite.
regards,
Moin
Requests and responses are logged within NetSuite itself. You need to have the Admin role to see them.
I don't think so. I'm not pretty sure that there is any inbuilt feature in NetSuite that allows you to log the request and response of your deployed Restlet. In Netsuite there is a method called :
nlapiLogExecution(logType, title, details)
Which you can use for temporal logging/Debugging. However, it doesn't persist your logging data permanently, so you can't use the same later. Yeah, Of-course you can find many workarounds to get your task done. Create a custom record with appropriate fields for logging then inside your restlet you can write the code to create a log file for each req/resp.

Trying to send a document through a trigger

I'm currently trying to automate the process of creating a docusign document and sending it by putting it into an apex trigger. I have managed to get the docusign api (via WSDL) into my org, and now I'm trying to add the code into the trigger to send out the document. Without pasting the entire code here, I've been following this tutorial and have gotten all of the required code into my trigger. Unfortunatly, when I run it, I get this error:
11:40:49.965 (12965647595)|FATAL_ERROR|System.VisualforceException: Getting content from within triggers is currently not supported.
Trigger.OpportunityTrigger: line 109, column 1
Does this mean that it's not possible to send a document in a trigger? The tutorial sends it through a controller, is that the only currently supported method?
Thank you for any help you can give me!
EDIT:
So I've gotten past that error (using a different tutorial), and am now getting this error.
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: This User lacks sufficient permissions. User does not have the permision to the CreateEnvelopeFromTemplates method faultcode=soap:Client faultactor=https://demo.docusign.net/api/3.0/dsapi.asmx
This appears to be a problem with the Docusign user I am using for sending this document. I am currently using CreateEnvelopeFromTemplates to try and send a templated document out to up to 5 recipients.
I ended up phoning into Docusign Support, and asking them about the issue. Turns out that the last error was caused by me trying to authenticate and sign into docusign with my userID not the AccountID (switched those around and the permission error went away).
Another error showed up related to not having roles setup properly in my template (fixed that by setting up the role), and now everything is working fine. I'm answering my own question to leave it as a reference to future searchers.
Create a call out from trigger
Then get the request from a rest method
Then continue to get the pagereference conten
You can find an example here

Add custom text to Sharepoint Email Alert

We have an alert set-up for sharepoint list, but I want to add some custom text to the alert email. We do not have any access to SPD or sharepoint server and can make changes to sharepoint client only.
Can anyone please advice?
The code that sends out emails runs on the SharePoint server via the Timer Job. Since you have no access to do anything with the server you've got absolutely no chance of modifying the built in alert emails.
Could you do this with javascript?
You can't send emails with JavaScript directly. You can open up a draft email in a users default email client using a mailto link but this won't achieve what you want as a user will still have to edit it.
You could, I suppose, put some javascript onto an edit page using a content editor web part (which you can do without SPD) to on changes make an AJAX call to a separate web server to do the actual sending.

Resources