has anyone here ever had to use setTimeout() when ...
# suitescript
s
has anyone here ever had to use setTimeout() when entering lines via client script? I noticed that item (for example) is not blocking while sourcing, and also, commitLine() isn’t blocking either.
b
i use it if
forceSyncSourcing
doesnt fix the problem, usually when doing an ill advised attempt at modifying multiple lines as part of one of the sublist related entry points
s
I wasn’t using forceSyncSourcing..
Thanks @battk!!
worked like a charm~
The script runs faster with that property specified.. I wonder why they didn’t default to
true
to begin with?
s
not defaulted
true
with performance in mind?
s
@stalbert strangely, it’s faster when it’s set to ‘true’
when setting sourced fields, that is, because forceSyncSourcing set to
false
doesn’t prevent sourcing.
b
im assuming the reason is that syncSourcing means that a synchronous xhr is used to source data
👍🏼 1
that probably shouldnt be faster than an asynchronous xhr
s
right - my expectation is you're forced to wait for synchronous sourcing to complete when
true
, else it does it in the background