I have a custom record I have a map/reduce script ...
# suitescript
e
I have a custom record I have a map/reduce script that updates values on an instance of that custom record I have a user event script with a
beforeSubmit
function attached to the custom record. All the
beforeSubmit
function does is log out
context.type
When the record is updated from the map/reduce script, the values are updated, but the user event
beforeSubmit
function is not firing (nothing is being logged) When I edit and save the custom record in the UI, the context is logged. .. When I use
record.submitFields
on the record (just in the console), the context is logged.... Context Filtering -> Execution Context on the Script Deployment includes
Map/Reduce
Anyone know why this could be happening?
a
can you share all the code in the UE before submit? or all the code up to the log that's not firing
cos based on what you've shared, you've covered all your bases and it should be logging... so I think we're missing something
e
image.png
There is logic below this section of code... but I don't think it should matter
👍 1
a
right, it shouldn't
just wanted to verify there wasn't some conditional before the log that was exiting early
e
_context_.newRecord.id
would exist even on "xedit", right?
a
yeah
☝️ 1
and if it didn't you'd get an error, or you'd get a log where it said context.type for <emptystring>
and you're getting neither
you mentioned context filtering has MR selected on your UE deployment... is there a value in event type?
the map reduce is editing the custom record directly? you're not idk chaining UEs to make the update? have a parent-child custom record and are modifying the child (lines) and the UE is on the parent?
e
What is the
Status
on the UE? It needs to be `Released`; if it is
Testing
, the other two UI contexts would still fire, but the MR would not. What is the Audience on the UE?
a
my money is on this
if it is
Testing
, the other two UI contexts would still fire, but the MR would not.
e
Given all the other info, this is my only solid guess. If it's not that, I'm not sure what's happening.
e
Status is Released Audience is set to all
It might be related to the MR updating child records which have UE events that update the Parent record. I'm going to look into that one
a
yeah UEs won't trigger other UEs, its to prevent infinite loops of records updating each other
☝️ 1
e
Right. But on the parent record, the context shows "Script (Map/Reduce)" Which is why I assumed it would trigger. But Im' thinking that the M/R is updating the Child Record and a UE on the Child Record is updating the Parent Record which would prevent the parent records UE's from running. Diving into it now
Thanks for the ideas @Anthony OConnor /@erictgrubaugh
👍 2
u
did you upload via SDF ? I had a weird bug the other day where something very similar was happening.. i tried manually re uploading the script and it started working
probably not the case ^ but maybe.. I ended up just deleting the script and re-making it manually and then my logs started working after that