This topic contains 4 replies, has 0 voices, and was last updated by chanarbon 7 years, 10 months ago.
-
AuthorPosts
-
December 16, 2016 at 9:18 am #1395
OKolesnykHello guys,
Please advice, how in SuiteScript 2.0 we can work with timezones. In 1.0 was few timezone functions, in 2.0 nothing similar.
I try to set created date custom field for INVENTORY_NUMBER record.
So I can’t find no way to get my current time for my timezone. If we use new Date() – it returns server time.
‘N/format’ also not include any transformation API.
So I can’t get current user timezone and transform “new Date()”.
Thank you
This is a cached copy. Click here to see the original post. -
December 16, 2016 at 11:12 am #1396
CREECEI believe you can use [Nruntime] and use runtime.getCurrentUser().getPreference(‘TIMEZONE’)
-
December 18, 2016 at 7:28 pm #1397
chanarbonHi @Okolesnyk,
If you are working with server side script for this concern, you may try N/config to load the user preferences as well. Also for the timezone conversation, N/format has a timezone parameter which you can try on your end. Please see this SuiteAnswers article for more info on the usage https://netsuite.custhelp.com/app/an…ail/a_id/61223 and https://netsuite.custhelp.com/app/an…ail/a_id/61222
-
December 22, 2016 at 3:37 am #1398
ArunKumarHello everyone,
I’m trying to display the PDF content in suite script 2.0 But I’m not successful and I’m able to do it in suite script 1.0.Please see the below code and suggest me what I’m missing here.
1.0 Sample code to display PDF on suite let page-Working)
var xmlStr = ‘nnnnHello World!nn’;;
var file = nlapiXMLToPDF( xmlStr );
response.setContentType(‘PDF’,’Test’ + ‘.pdf’, ‘inline’);
response.write( file.getValue() );
2.0 Sample code to display PDF on suite let page-not working):
var xmlStr = ‘nnnnHello World!nn’;;
var pdfFile = render.xmlToPdf({
xmlString: xmlStr
});
resObj = pdfFile.getContents();
context.response.write(resObj);
Thanks,
โArun.
-
December 30, 2016 at 5:05 am #1399
chanarbonHi ArunKumar
One thing that you missed in here is the setting of the content type for the response. Also I would suggest that you the concern that you have would be referred using a new post here in the UG.
-
AuthorPosts
You must be logged in to reply to this topic.