I have a script that runs on Transactions that mat...
# suitescript
j
I have a script that runs on Transactions that matches that transaction type to a custom record via a List/Record Transaction Type field. The problem I'm having is that when I run a saved search to match the current transaction to the list record, the custom record transaction type field wants the internal id of the transaction type, not the text value ('salesorder'). Does anyone have a solution to match the record to one of these transaction types? (We also rename our transaction types so Sales Order is actually 'License')
s
First thought is try using setText instead of setValue?
j
I'm not setting a value on a current record, im making a search to find the correct custom record.
b
the complicated solution is to have your list/record field have a source of
Scripted Record Type
instead
add a filter on the field so that the
List/Record
or
Search Type
is a Transaction to limit the selections to transaction types
and then have another field that uses sourcing to source the script id so that you have your script id to search against
s
I don't get what you are doing honestly; if you are not setting a value, why do you need to translate between the different ways record types are displayed?
j
Okay @battk thanks for the answer I'll try it out.
@Sandii I've built a script that basically just prints a pdf with an advanced pdf template on any record. There's a configuration record that holds the record type and list of advanced pdfs. The issue was matching the record type because netsuite requires an internal id of the sales order type and all I have on the current record is the text value.
b
i forgot to mention the easier solution, which is to just hardcode a lookup between internal ids and script ids for the transaction type
j
What about other netsuite records that aren't transactions?
b
transaction type is not the list/record source you want if you want to include non transactions
j
The intended goal is all records
b
probably just go for Scripted Record Type without the filter i mentioned
j
Alright I'll try it, thanks again.