Hello, what is the transaction type for an advance...
# suitescript
p
Hello, what is the transaction type for an advanced intercompany journal entry? I am not seeing documentation on what the name should be
p
thanks. what would the record load value be?
nevermind I found it. is it possible to dynamically load a record type?
s
record.Type.ADV_INTER_COMPANY_JOURNAL_ENTRY
p
thanks
s
not sure what you mean by 'dynamic' but you can surely accept a string variable for record type
I usually shy away from trying to be overly dynamic unless I really need it.
p
I have tried setting a string value for the record type. what am I doing wrong? I tried setting a variable equal to record.Type.JOURNAL_ENTRY
s
that isn't the enum for advanced intercompany je
p
I got the enum for it. is it possible to set the enum is a variable?
s
you can use a string variable for the record type, but again I recommend sticking with the enumeration unless you have a compelling reason not to. I'm guessing you have code that wants to load one of several different type of records?
p
I want to use the enum but I need to load the different je record types in a script
but I keep on getting an error when setting type: recordtoload that I have an invalid record type
s
I don't see the point in setting a string to an enumeration value rather than just using the enumeration value. It's very readable/clear if you just use the record.Type enumeration
s
sounds like you should share more of your script for context.
p
is it possible to use a variable for the record type in this line: type: record.Type.JOURNAL_ENTRY
so instead of record.Type.JOURNAL_ENTRY I can use a variable and set it earlier in the code
s
yes, record.Type,ANYTHING is just a string; you can make a variable just a string, but once again, why would you want to do that?
p
Hello Sandii, I have three types of journal entries that I need to process with a saved search and it will save a good amount of code with the record.type setup
s
you can certainly do that, but
var journalentry = record.Type.JOURNAL_ENTRY
seems silly imo, since
record.Type.JOURNAL_ENTRY
is a very identifiable enum/string that no one ever needs to figure out why that string is what it is
p
thanks