use PSI web services in Server events

S

Satya Mantena

Can i call PSI webservice which returns a timesheet dataset from server
event and update the dataset?
 
J

Jim Corbin [MSFT]

Datasets in event handlers are for read-only use. For example, if you change
the TimesheetDataSet and use QueueUpdateTimesheet within the OnUpdating
pre-event handler, that has no effect. What you need to do is save the data
you need, cancel the event if necessary, and then use QueueUpdateTimesheet
outside of the event handler. Be sure to set a key, such as a string in the
Comments property, so the second time around QueueUpdateTimesheet recognizes
the data as correct, and you avoid an infinite loop.

See the Using Datasets in Event Handlers section in the Getting Started
article (
http://msdn2.microsoft.com/en-us/library/bb456485.aspx#officepj2007platform__EventsDataSets )
..

--Jim
 
A

Adam Behrle

Hi Jim,

Just for my understanding, do all write PSI methods have this readonly
affect if originated from an event handler or are certain methods
restricted depending on the event?
From reading that article, my understanding is the DataSet provided in
the event arguments was readonly, not additional calls to the PSI (I
would assume you'd need to copy the dataset to a new dataset to
actually make the call).

Thanks in advance for the clarification!

Adam
 
S

Satya Mantena

As you explained event handlers will not allow me to update the data i moved
to another way.
Let me explain my problem in detail.

When a Project server user cliks a link (a new webapplication) i should pull
the data automatically from another system and update the Project server
timesheet data.

I wrote a new web application based on sample impersonation webapp. i was
able to pull the data, when i try to update the data it's failing saying that
job was unsuccesfull.

is there any thing wrong i am doing? Any comments on approach also welcome.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top