I have created my own class with the Execute() method which should erease some pages under a specific node/page pointed out in a property on the Startpage.
The whole thing works like a charm when I run the job manually... but when I schedule the job it doesn't. It seems like there's a problem when I fetch the property from the Startpage... As I said it works very well when I run it manually but when scheduled there's an exception being thrown and it jumps to the fetch part. By trial and error I've found out that it has to do with the Startpage property I'm using.
I've tried inhereting both from the JobBase (using override Execute) and my own PageBaseData (using static Execute) and both fails when scheduled.
I've tested using DataFactory as well as Repository for getting the Startpage property... and they both fail when scheduled but works when manually triggered.
Any ideas on what the problem with this schedule job could be?
<p>Ah... good advice Per! Though I still have the same problem after trying this:</p>
<p>PageData page = DataFactory.Instance.GetPage(PageReference.StartPage, new LanguageSelector("sv"));</p>
<p>The exception says content link doesn't have a value:</p>
<pre class="brush:html;auto-links:false;toolbar:false" contenteditable="false">Exception has been thrown by the target of an invocation. [The provided content link does not have a value. Parameter name: contentLink]</pre>
<p>Which is really weird since it definately has one...</p>
<p></p>
<p>Ah, now I remember. Check out this <a href="https://blog.mathiaskunto.com/2014/05/30/episervers-contentreference-startpage-is-an-empty-reference-when-lacking-binding/">blog</a> and the comments: "<span>You may run into similar problems in scheduled jobs. One way around it is to add a wildcard binding (“*”) for your default site."</span></p>
Hi!
I have created my own class with the Execute() method which should erease some pages under a specific node/page pointed out in a property on the Startpage.
The whole thing works like a charm when I run the job manually... but when I schedule the job it doesn't. It seems like there's a problem when I fetch the property from the Startpage... As I said it works very well when I run it manually but when scheduled there's an exception being thrown and it jumps to the fetch part. By trial and error I've found out that it has to do with the Startpage property I'm using.
I've tried inhereting both from the JobBase (using override Execute) and my own PageBaseData (using static Execute) and both fails when scheduled.
I've tested using DataFactory as well as Repository for getting the Startpage property... and they both fail when scheduled but works when manually triggered.
Any ideas on what the problem with this schedule job could be?