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 have a number of custom jobs that my program adds to my SharePoint environment. I noticed that there is no option to give the job a particular ID/GUID in the constructor. So my question is: How is new job's GUID/ID assigned when created and submitted?

I'm aware that I can access and modify that member of the SPJobDefinition, but I'm curious how it's set otherwise.

share|improve this question

1 Answer 1

When the instance of job definition is created it ID property is initialized via base SPPersistedObject constructor to Guid.NewGuid() :

protected SPPersistedObject(string name, SPPersistedObject parent)
  : this(name, parent, Guid.NewGuid())
{
}
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.