Hello, is it possible to get the createdfrom fiel...
# suitescript
p
Hello, is it possible to get the createdfrom field from a vendor bill record? I have tried the following: var soId = search.lookupFields({ "type" : "transaction", "id" : sourcetran, "columns" : [ "createdfrom" ] });
b
that should work out if that transaction has a created from
keep in mind that that the return value of search.lookupFields should be an object
p
the vendor bill does not have a native createdfrom. it does return it with a regular saved search
is there another way to get the value?
b
im not sure what you are describing
search.lookupFields is basically a search
for transactions, it uses columns from the mainline
as long as the mainline has a value for the createdfrom column, you should be able to get a value
p
am I calling it correctly? var potoset = sea[0].getValue('createdfrom');
I keep on getting the error org.mozilla.javascript.EcmaError: TypeError: Cannot call method "getValue" of undefined (/SuiteScripts/jeamortizationpo.js#99)
b
you might want to look at it from a debugger
its an object, where the key is the intenralid of the column
and the value of the key should be an array
p
ok. there should only be one result for the array
b
yes, the array should have 1 element, an object
which has a value and text key