Does anyone know if there is a way to call an inte...
# suitescript
j
Does anyone know if there is a way to call an internal URL of a page in NS from a script. My use case is that I want to “scrape” this page https://XXXXX.app.netsuite.com/app/common/custom/itemoptions.nl?whence= or ideally the actual CSV download link from that page https://XXXXXX.app.netsuite.com/app/common/custom/itemoptions.csv?bundlefilter=BLANK&sortcol=rank&sortdir=ASC&csv=Export&OfficeXML=F&pdf=&size=1000&showall=T I’ve tried calling both using https.get and proper oauth headers but it just takes me to a login page. I know it’s something to do with that URL and that otherwise my headers are ok, as I’ve tested by calling the URL of an internal-only Suitelet and THAT works just fine.
a
pretty sure this requires a client session, you'll be able to get in a client script. I've run into similar issues trying to access the csv import status page from a serverside script.
j
I need it to run silently behind the scenes 😞
a
apparently you can query them in the customfield table using suiteql but you'd need to filter out everything else... which since they're classed as custcol field types isn't easy... could you enforce a naming convention on the scriptid? custcol_io_xxxx ? then you can filter on that?
Copy code
SELECT
	CustomField.description,
	CustomField.fieldType,
	CustomField.internalId,
	CustomField.id,
	CustomField.name,
	CustomField.lastModifiedDate,
	CustomField.fieldValueTypeRecord,
	CustomField.isMandatory,
	CustomField.owner,
	CustomField.recordType,
	CustomField.scriptid,
	CustomField.isShowInList,
	CustomField.isStored,
	CustomField.fieldValueType,
FROM
	CustomField
WHERE
        fieldtype = 'COLUMN'
j
the problem is I need the order ….
I’m already pulling out all the itemoptions using something like your query with a ‘visible on transactions’ filter also to get just the Item Options and not transaction line fields.
👍 1
I just cannot find any way to get the ORDER that they are specified in (what order the options appear in)