<@UJXS1JYQL> You can do an entity/customer search ...
# suitescript
a
@Santiago You can do an entity/customer search and do not set any customer and just return the addresses internal ids, but I think I need to know better what is your use case...
s
Hi thanks for your response, Basically what happens is I get the address on the sales order Ship To field and need to load the address record to get the address information. The problem is that the id given in the getField Value doesn't work to lod the address record so I need to make a search for that address internalid to be able to load the address record
Same thing with the vendor Ill look into SA to see if there is anything I missed
a
You can't load the address record directly because it is a subrecord, you would need to load the Sales Order customer and from there load the address record. You can create a search to get what you need too, but again is not a straightforward, I strongly suggest you do a search in the SuiteAnswers site.
s
yes I did that finally I created a search of the customer addressinternalid as acolumn compares and addedd the internal id with a join to get the address internal id
var shipaddressSearch = search.create({
      
type: recordtype,
      
filters: [['internalid', 'is', recordid]],
      
columns: [
        
search.createColumn({
          
name: "internalid",
          
join: "Address",
          
label: "Internal ID"
        
}),
        
search.createColumn({
          
name: "addressinternalid"
        
})
      
]
    
})
    
var shipipingAddressResults = shipaddressSearch.run().getRange({
      
start: 0,
      
end: 1000
    
})
    
debugger;
    
// var warehouseLocation = ""
    
shipipingAddressResults.forEach(function (shipaddress) {
      
console.log("EXTRENAL IDDDD", shipaddress.getValue("addressinternalid"));
      
//log.debug({ title: "EXTERNAL ID ADDRESS", details: });
      
if (shipaddress.getValue("addressinternalid") == warehouseLocation) {
        
warehouseLocation = shipaddress.getValue({ name: 'internalid', join: 'Address' });
      
}
    
})