`"Sales_order"` is not a valid type. Use the `N/re...
# suitescript
e
"Sales_order"
is not a valid type. Use the
N/record.Type
enumeration for specifying types
s
I'm a bit confused
from the documentation
var relativePath = url.resolveRecord({ recordType: record.Type.SALES_ORDER, recordId: 6, isEditMode: true });
and in my example
type : record.Type.SALES_ORDER is working fine
e
"Sales_order"
is not the same thing as
record.Type.SALES_ORDER
s
I tried with SALES_ORDER, sales_order, Sales_Order, etc... none works.
e
The
Type
enumeration is not different than any other Object. You can alias its properties like you would any other.
Copy code
var myObj = {
  myProperty: {
    nestedProperty = 7;
  }
}
var seven = myObj.myProperty.nestedProperty;
Seems like you're just guessing at random strings instead of properly referencing the enumeration
Why not
var thetype = record.Type.SALES_ORDER
If you want to know what value the enumeration holds, then log out
record.Type.SALES_ORDER
like
log.debug({title: "value=", details: record.Type.SALES_ORDER});
s
This ^, also if you really want to know the text, you can load
N/record
in the console and type r.Type.SALES_ORDER and see that is
'salesorder'
s
It's working. Thanks a lot