Rick Goodrow
01/06/2025, 2:20 PMN/search.lookupFields()
to pull that value (along with several others) from the record. I then need to to lookup additional data from whatever that record is. The issue I'm running into is that because it's one of two possible record types, I don't have a clean programmatic way to pull the record type. N/search.lookupFields()
returns
{"custrecord_fq_linked_transaction":[{"value":"267972","text":"Sales Order #SO35426"}]
I can do a text-search within the .text
key for Sales Order
or Quote
but that feels very unclean. Closest googling came was this reddit post which talked about an undocumented .type
key, but that's based on using N/record
, which I'm trying to avoid loading the entire record when N/search
will just get me the data. Anyone have any ideas how to get record type using N/search.lookupFields()
?battk
01/06/2025, 5:08 PMrecordtype
columnRick Goodrow
01/07/2025, 1:39 AMlet freightQuoteData = Nsearch.lookupFields({
type: uvFQLibId.record.FREIGHT_QUOTE.id,
id: params.fqIid,
columns: [
freightQuoteField.LINKED_TRANSACTION,
freightQuoteField.LINKED_TRANSACTION + '.type',
],
});
gives me
{
"custrecord_uv_fq_linked_transaction":[{"value":"267972","text":"Sales Order #SO35426"}],
"custrecord_uv_fq_linked_transaction.type":[{"value":"SalesOrd","text":"Sales Order"}],
}
problem now is SalesOrd
is not in the enum of N/record.Type
, as it uses salesorder
. I cant find any info on a native translation from what the .type
property returns to what is accepted by a param requiring N/record.Type
enum.
I also tried your .recordtype
, but that didn't return the type of the linked transaction, but the type of the record the lookup was being performed onbattk
01/07/2025, 1:41 AMbattk
01/07/2025, 1:43 AMRick Goodrow
01/07/2025, 1:58 AMcustrecord_uv_fq_myfield
is a custom field on that record of type List/Record, sourced only from record types of either Quote or Sales Order.
When I do the following:
Nsearch.lookupFields({
type: 'customrecord_uv_fq',
id: 123,
columns: [
'custrecord_uv_fq_myfield',
'custrecord_uv_fq_myfield.type',
],
});
I'm trying to get the record type of which record is linked in the custom field, so then I can then to a subsequent lookup on that record.Rick Goodrow
01/07/2025, 1:59 AMbattk
01/07/2025, 2:02 AMbattk
01/07/2025, 2:03 AMcustrecord_uv_fq_myfield.memo
battk
01/07/2025, 2:05 AMSalesOrd
into salesorder
, especially if you only have to do it for sales orders or quotesRick Goodrow
01/07/2025, 2:11 AMRick Goodrow
01/07/2025, 2:11 AMSalesOrd
=> salesorder
, I didn't know if there was a native transformation, or there was a way of getting salesorder
from the original lookupsearchbattk
01/07/2025, 2:13 AMbattk
01/07/2025, 2:14 AMRick Goodrow
01/07/2025, 2:15 AMbattk
01/07/2025, 2:17 AMRick Goodrow
01/07/2025, 2:17 AMRick Goodrow
01/07/2025, 2:17 AMbattk
01/07/2025, 2:17 AMRick Goodrow
01/07/2025, 2:18 AMbattk
01/07/2025, 2:18 AMRick Goodrow
01/07/2025, 2:57 AM