I have an event that won't seem to fire, not sure ...
# suitecommerce
c
I have an event that won't seem to fire, not sure what I'm doing wrong. Anyone see my blind spot?
Application.on('after:LiveOrder.get', function afterLiveOrderGet(modelDefinition, resultData) {
console.log('modelDefinition', JSON.stringify(modelDefinition));
console.log('resultData', JSON.stringify(resultData));
});
a
this function looks fine... do you have Application and LiveOrder in your define?
c
I didn't have LiveOrder in the define because I have another event
before:LiveOrder.update
which is already working as expected.
Figured it out. Had an override on
.get()
which was preventing the event to register for some reason.
p
ah yes if you override a function you are also overriding the code that wraps all functions in a model with events.
c
Is is possible to add a parameter to a function w/o overriding it?
Found another option... SCA is versatile but not simple. 🙂
👍 2