I have defined a custom field on the Address recor...
# ask-stanley-ai
b
I have defined a custom field on the Address record. How can I retrieve the value of that custom field using SuiteQL?
c
AI generated answer (using internal Slack threads):
To retrieve the value of a custom field on the Address record using SuiteQL, you can perform a SuiteQL search on the customer record and include the custom field in the search columns. Here is a sample SuiteScript 1.0 code snippet that demonstrates this:
Copy code
javascript
var addressToReference = nlapiGetFieldValue('custrecord_po_record_address_book');

var customerSearch = nlapiSearchRecord("customer",null,
[
   ["address.internalidnumber","equalto",addressToReference]
], 
[
   new nlobjSearchColumn("address1","Address",null), 
   new nlobjSearchColumn("address2","Address",null), 
   new nlobjSearchColumn("city","Address",null), 
   new nlobjSearchColumn("state","Address",null), 
   new nlobjSearchColumn("zipcode","Address",null),
   new nlobjSearchColumn("custrecord_po_store","Address",null), 
   new nlobjSearchColumn("custrecord_alternate_store","Address",null), 
   new nlobjSearchColumn("custrecord_building_id","Address",null), 
]
);
In this example,
custrecord_po_store
,
custrecord_alternate_store
, and
custrecord_building_id
are custom fields on the Address record. Replace these with your custom field internal ID. The search results will include the values of these custom fields. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849563062
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848822951
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843209326
Please provide your feedback on this answer.