AI OnAI Off
Hi Magnus.
Which version of EPiServer are you running? Could there be an issue with access rights? http://world.episerver.com/Forum/Pages/Thread.aspx?id=28953&epslanguage=en
Scheduled jobs are runned as a Anonymous user. You could howerver use impersonate and run the job with a specified user. Check out Erik Nordins blog for an example: http://antecknat.se/blog/2009/03/04/scheduled-tasks-tips/.
Hope this helps.
Br, Tore
I have a scheduled task which is supposed to get the child pages, call them C1 and C2 from a pagereference, call it P, set in a dynamic property of the start page.
Getting the reference to P always works. However, when GetChildren is called with P as argument, the results are a bit unpredictible. It seems that if I trigger the job manually the expected C1 and C2 are returned. When the job runs scheduled it returns no children.
If I use GetDescendents instead I get the pagelinks of C1 and C2 (there is nothing more under P). I can use GetPage and get C1 and C2 and verify that their ParentLink is actually P.
I thought it might be an issue with language branch, but it seems to select the correct one even when running as a scheduled task. Any idea why this might be happening? I can work around it with GetDescendents, but I still wonder why it happens.