Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to increase and decrease a DateTime column from a specific list with jquery and SPServices.

Normaly I should first receive the original datatime and then add the timespan and after that save it. But its too much I think. Is there a better possibility to add a timespan like 5 minuts to a datetime column adhoc? Maybe someone knows a little CALM query for it :)

share|improve this question
    
I think the answer is simply no. Maybe you could reconsider your design, and calculated columns or workflows would be a better way in your case? –  Christophe Jan 11 '12 at 16:36

2 Answers 2

AFAIK caml isn't offering such a functionality.

There are different ways how to achieve this. From jQuery you could use

  • Plain ASMX Services (no-one likes writing SOAP messages :D)
  • SPServices as ASMX Wrapper
  • Client Object Model (when site is hosted in SharePoint)
  • REST API

By using any of these technologies you're able to minimize the traffic going across the wire.

I would use SPServices or REST API.

share|improve this answer
    
Ok.. for sure i will use the SPServices, but the documentation is soooo fantastic irony Do you know any usefull tutorials or something like that? –  Smokefoot Jan 11 '12 at 15:45
    
The documentation is offering some samples. They are listed on the detail pages for the ASMX methods. But Marc, the author has written a lot of articles about SPServices in daily business on his own blog. Just have a look at sympmarc.com. It's also good to have a look at the debug version of SPServices. SPServices is just regular JavaScript so it's easy to read and understand. I guess it's the best practice you could do to get a deeper knowledge of SPServices itself. –  Thorsten Hans Jan 11 '12 at 15:48
    
There is a lot of support on the forums of the codeplex site where Marc and other contributors are very active. It's almost better to post there than her regarding SPServices. –  PirateEric Jan 11 '12 at 16:28

To expand on my initial comment, you could do it with 3 columns:

  1. Your original DateTime column
  2. a Timespan column
  3. a calculated column that does DateTime+Timespan

Then you could use SPServices to update Timespan, and the calculated column would automatically store the result. No need to grab the original DateTime value.

This might not work for your specific scenario, but based on the info you provided it seems like a reasonable solution

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.