How to create a campaign in Netsuite erp - netsuite

Hi i am working with NetSuite and I just want to know to create a email campaign, what are the required attributes and methods to create a email campaign pro-grammatically?
Any help on this will be great.

You can use nlapiSendCampaignEmail(campaigneventid, recipientid)
Both, the parameters are required.
As per docs:
Use this function to send a single “on-demand” campaign email to a
specified recipient and return a campaign response ID to track the
email. This function works in conjunction with the Lead Nurturing
(campaigndrip) sublist only; it does not work with the E-mail
(campaignemail) sublist.

Related

Search payment records information in Netsuite using Suitelet

Need to get payment data from Transaction >> Payable >> Pay single vendor form and create a data file. This has been done with an eventscript (add button), a clientscript and a Suitelet by searching currentRecord data from client script to Suitelet and generated a file. However, searching Transaction record type could not get payer payment department and cost center data as I know. So any advice and recommendation from Netsuite experts on how can get these payer data from Netsuite with the existing Transaction information on the Bill Payment form, like payment check number, entity id, transaction number, etc ?
When using the N/search module the following 3 tools are invaluable for retrieving data from netsuite transactions.
Netsuite records browser (shows all of the fields, available search filters, and joins ect.)
https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_1/script/record/vendorpayment.html
Another great tool is an extension called Netsuite Field Explorer developed by Michoel Chaikin
you can also turn on field ids in your account by navigating to Home->Set preferences->General tab->Set defaults->Show internal ids
(This will show the field id when you click on the field "What is this?" link directly on the record)
between the three you should be able to get everything you need to run a search and retrieve the data you are looking for.
Depending on your needs you can either search.create (return multiple records) or search.lookupfield(return a single record)

Kentico 11 - Macro's not working in Marketing Emails

I have just started to use Kentico, so far everything has been straight-forward however I cannot get certain Macro's to work in Marketing Emails (to insert personalized information in the email such as their country).
Here is a quick overview of my automation process
Person submits a form on the website
Form field information gets mapped to the contact
Automation process begins
Internal/Transactional email sent which contains the requesters information (Macro's work)
Marketing email sent to requester, containing relevant information (Only basic Macro's work (for example recipient.firstname))
The issue is that the Macro's that are used (and working) in the internal transactional email do not appear to work in the marketing emails section, for example: {% OnlineMarketingContext.CurrentContact.ContactCountry #%} would copy in the requesters Country in the transactional/internal email, but it remains blank in marketing emails (Note: I have tested this fully, not as a draft email as I've read that the information doesn't get passed in a draft email).
I have tried using different objects (ContactManagementContext, etc.), however nothing appears to bring in personalized information.
Is there something I need to do to get the Macro's working within the Marketing Emails section? I have read through the docs online and I can't find anything to make this work.
Any help would be greatly appreciated.
The newsletter email macros are based off the subscriber not the contact. If you want to use the contact info, you will have to find a way to relate the subscriber to the contact.
This video shows how to see what macros are available.
Zach is correct. Normally, you would lookup the Contact based on the email address of the Recipient, e.g. {%GlobalObjects.Contacts.Where("ContactEmail = '"+Recipient.Email+"'").TopN(1).FirstItem%}. However, there is a hidden object you can use in marketing emails: {%Advanced.ContactInfo%}

How to get newly created sales order internal id in suitescript 2.0?

I'm writing a suitescript to send order details to a customer email address.
Is it possible to get the sales order id through scriptContext or similar method?
My function is run on Sales Order After Submit.
function afterSubmit(scriptContext){
soid = scriptContext.soid; //<--trying to get the sales order id
}
In an afterSubmit, you can use scriptContext.newRecord.id.
See afterSubmit documentation here: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4407992281.html
and record.Record object members documentation here: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4267255811.html#bridgehead_4273190849

Retrieving Recipient Status via REST API

There appears to be two ways I can gather status information about individual recipients on an envelope:
GET - v2/accounts/:accountId/envelopes/:envelopeId/recipients
GET - v2/accounts/:accountId/envelopes/:envelopeId/audit_events
Unfortunately, each of these suffers from a separate limitation that is making it difficult for me to use either.
This API call returns two DateTime values of interest: deliveredDateTime and signedDateTime. I am able to call and use this API successfully. However, it appears to me that deliveredDateTime is not specified until the user actually clicks the email link AND clicks the review documents button on the signer view. Since what I was actually interested in might be better described as sentDateTime, deliveredDateTime doesn't appear to work for my needs.
This API call returns a detailed list of all events that have transpired on the envelope, including individual receipient status updates. However, the data format is such that in order to tie the result data back to recipients, I have to do string matches on the recipient name. I'd prefer to do the match based on email or, better still, recipientID, but the audit log entries for "sent invitations" and "signed" don't contain these fields. Here is an example (click here to view larger):
Is there an API call other than these two that I can use? Is there a way to get additional data in the audit event API call?
Thank you in advance,
Andrew
I don't believe there's a way to get additional data from the audit_events call since the DocuSign API documentation (which is up to date) indicates that call has no parameters (other than the envelopeId in the URL).
I think you're stuck with doing a string comparison on the userName value to identify/link your recipients, however I want to point out that once you do that you can then link to their unique recipientGuid through the first api call you've highlighted here.
For instance, the /audit_events API call seems to achieve what you want and has all the info you need, however it identifies the recipients through their userNames. If you then make a call on the same envelope and check the response from the /recipients URI, it contains the name, email, recipientId, and recipientGuid for each and every recipient in the envelope. Match the user names and you now have access to their IDs, etc.
So in the end I don't believe there's one API call to achieve this but you can solve by doing one string compare and combining the results from the API calls you've highlighted.

How to get list of payment methods/shipping method and assign it to a order (suitescript)

I'm working with creating salesorder in netsuite using suitescript but I can't find any document about "payment method", so how can I get a payment method such as VISA card and assign to the order? (I think it's required a payment method id but I didn't find payment method in supported suitescript records).
[update]
Here is my code:
var order = nlapiCreateRecord("salesorder");
// set some field value
// order.setFieldValue(....)
Now I want get payment method and shipping method id to set to order:
order.setFieldValue("shipmethod", shippingmethodId);
order.setFieldValue("paymentmethod", paymentmethodId);
I already have payment method name "Test Payment Method" and shipping method "Test Shipping Method". How can I get their id using their name?
For Payment Methods:
To get a list of the payment methods and their respective IDs available in your NetSuite account, you should navigate to Setup > Accounting > Accounting Lists. You will see a Type filter on the bottom of the page. Select Payment Method in there and you'll be able to see the different payment methods available for you.
For Shipping Methods:
Navigate to Lists > Accounting > Shipping Items.
Edit:
Actually you don't need to. Use nlobjRecord.setFieldText instead of setFieldValue i.e. order.setFieldText('VISA')
You can use hard-coded values instead of getting the values dynamically.

Resources