I have a Picture Library. It has YES/NO column called "Activation Status".

When we deactivate a image, we have to manually, un-check the Activation Status.

Can we use JavaScript code to un-check the status column when the image reaches its Expiration Date. Expiration date is a date column.

  • How are you deactivating the image? Jan 26, 2015 at 15:07
  • Its a custom code where the images are shown in a slideshow.We deactivate the image by unchecking the status column.
    – user29762
    Jan 26, 2015 at 15:08
  • Ok in that case you can either modify the custom code which displays the slideshow (add a condition to find expired items) or use a timerjob as i mentioned in the answer. Jan 26, 2015 at 15:10
  • ok.Can we use a oob workflow?
    – user29762
    Jan 26, 2015 at 15:14
  • The problem with Workflow is its difficult to set it to run every day. Also the workflow should be for an item. In your case you need to run every day and also it should check for expired items across the whole list (so loop is required). Jan 26, 2015 at 15:15

2 Answers 2


I don't think using JavaScript is a good option in this situation.

What you need is a way to update the List Item and change the Activation Status = NO

For that you can create a Timer Job which run's every day and go through the list items whose expiration date is less than TODAY and change the item.


While this is not possible with JavaScript, you can definitely create a Workflow (SP Designer) and use Information Management Policy of the list to schedule the run of this workflow every day/night. Follow this blog to understand the basics of Information management policy which has the same example as yours.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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