Forum Discussion
Hi Flur! It sounds like the onAfterUpdate event should do the trick, though you may want to include an onAfterAdd event if you need to run your logic for newly created items as well.
I have a couple questions to help troubleshoot the issue you’re seeing:
- What’s the error message you’re seeing?
- Is the context item versionable?
- Can you share your onAfterUpdate method code? At least the part that shows how you’re trying to get the data to send to the other system?
Hi Eli, thanks for the quick reply!
- When I pressed save or done on an Item I used to get a null error message, (now I dont see any error in Aras but the save still fails/ gets aborted)
- I'm not quite sure what that means, but when I save an item, a versioning attribute is incremented and I can also create new revisions of the item
- My Code:
var id = this.getID();
var type = this.getType();
MyDll.MyFunction(id, type);
return this;
The basic idea is that I get the updated id of the changed item and feed them into my custom function. Inside of MyFunction I do an async AML request against Aras <AML><Item type="type" action="get" where="[Item].id='id'" /></AML> and then push the result to a different service. This works fine if I test it with a static id but if I try to use this.getID() the changed item does not get found and the AML returns null as result.
- Fflur2 years agoIdeator I
Small update, I found the function "CCO.DB.InnDatabase.CommitTransaction();" and if I call this before MyFunction everything works like I expected. Is this fine or is there a better way to do this?