This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Values not getting inserted

Sandy - Thursday, June 30, 2011 2:13 PM:

Hi all,

I have created an Item type called Scheduling and created a property called ActivityID.

I see that when ever an item has been Created an entry is made to the Activity Table for each Work Flow element. 

My Requirement here is that when that entry is made into the Activity table i need to insert an entry into my Scheduling table. For doing this i have written this method which i have given on the onAfterAdd for Activity table.

 string id =this.getID();

Item itm =this.newItem("SCHEDULING","add");

 

itm.setProperty("ACTIVITYID",id);

Item Result = itm.apply();

return this

 When i run this It is inserting an entry into scheduling table, but the ActivityId is inserted as 'NULL'. Can any one tell what i'm doing wrong.

 



Brian - Friday, July 1, 2011 6:52 AM:

Hi Sandy,

It looks basically ok. Have you tested the Result item? Is it returning what you would expect?

Have you tested the "id" from the this.getID() to ensure that you are getting what you think you should be?

You could try hard coding an Id just for testing and triggering the method via the "run server method" action and return the "result" item to see that it is behaving the way you expect. The other thing is of course to debug the method.

Hope this helps,

Brian.