get item instance(context item) on before add

オフライン

hello

I'm developping a method that is going to be trigered by a server event on before Add/update .The method needs to retrieve the inputs entered by the user creating the item.

problem is when i was first testing this method. I tested it with an already created object that i got by keyed name but in reality the item is not yet created and i need to retrieve the instance of the object in my method to be able to execute my logic.

i've tried this :

Item template =  inn.getItemById("ZFCcontrainteTemplate", this.getID());

but got this error:

Object reference not set to an instance of an object.

the method is c# server side

obviously i feel like the this.getID is not suficent to point to the instance of the item being created but i have really no idea where to look for that so if you have any information that might help me it would be much apreciated.

thanks

lucas

Parents Reply
  • 0 オフライン in reply to Gopikrishnan

    hello,

    so the "this.getID()" actually gets an id 

    but this id is not from an object of my itemtype ZFCcontrainteTemplate

    Item template =  inn.getItemById("ZFCcontrainteTemplate", this.getID()); 

    i think thats why no item is retrieved from the get item by ID 

    let me know if this makes sense or if u have a better explanation.

    (and i run the method on after add of a ZFCcontrainteTemplate item.)

    thanks,

    Lucas

Children
No Data