I was supposed to blog this last Friday but I ran out of time. Spent trying to resolve the issues I encounted and was only able to fix it just at the nick of time (before the office closes at 6pm). Whew!
There were quite a few errors I encountered when working with the exercise including the practice example and below are some them:
a. When trying to follow his example about importing products, I couldn't seem to resolve the ERPProductHelper does not exist in the current context issue. I used all the namespace he used but still the same. I couldn't find ERPProductHelper in the Kentico Documentation and tried other solutions but still no luck :(
So I just skipped this and didn't include in the project. But if you know how to solve this, feel free to comment below.
b. The No Definition found for Set Doctors issue. Remember I skipped the 2nd exercise of Kentico API because I got confused with it? In here, I have really no choice but to do it.
And I learned that I don't need to modify the previous code generated in the DoctorInfoProvider class which I did in Custom Module exercise and that I only need to add a new public method Set Doctors. And it resolved the no definition issue. :)
c. The next one was File does not exist issue (when I ran the Import Doctor scheduled task)
I rechecked all my steps for creating scheduled tasks:
1. Create a new class implementing the CMS.Scheduler.ITask interface - done
2. Add the RegisterCustomClass assembly attribute above the class declaration. - done
[assembly: RegisterCustomClass("ImportDoctor", typeof(ImportDoctor))]
[assembly: RegisterCustomClass("ImportDoctor", typeof(ImportDoctor))]
I have also asked myself it it has something to do with the Task provider name because mine is only showing custom classes but in his example video, it is showing the name he specified. But nahhh..it's not.
And you know the culprit? It's because I didn't specify the task data property. Noticed in the above screenshot, the task data field is empty. Jaaahhh...he didn't show this on the video. Huhu. Perhaps that part, he didn't just capture it. But at least, I know now. :) Hehe.
Now import successful!
Till next time! And for reference about Scheduled Task properties. check-out this link.
Till next time! And for reference about Scheduled Task properties. check-out this link.