+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Problem with Custom Module Creation

Problem with Custom Module Creation

6 posts, 0 answered
  1. Janak
    Janak avatar
    6 posts
    Registered:
    13 Dec 2010
    21 Apr 2011
    Link to this post
    Hi Sitefinity Team,

    I am implementing the custom module for user registration with the help of Job-Intermediate module.

    I got stuck in midway as I am not able to identify where to mention my user created SQL table e.g UserInfo.

    Another thing I have followed exact Job Intermediate module and some how developed registration module but I am getting error when I click on submit button which is in following area.

           public override RegApplication CreateRegApplication(Guid id)
            {
                var dateValue = DateTime.UtcNow;
                var item = new RegApplication()
                {
                    Id = id,
                    ApplicationName = this.ApplicationName,
                    Owner = SecurityManager.GetCurrentUserId(),
                    DateCreated = dateValue,
                    PublicationDate = dateValue
                };

                ((IDataItem)item).Provider = this;

                if (id != Guid.Empty)
                {
                    this.GetScope().Add(item);
                }

                return item;
            }

    In above code this.GetScope().Add(item) I am getting "OpenAccessException" Object reference not set to a instance of object although i can see Item instance created. I have spent too much time and not getting any solution.

    Also please provide us some proper guide about how to work with user create tables because the provided tutorial doesn't contain any details related to connectivity of database  and tables which is something very basic information require for any custom module.

    There is an appconfig file where I have mentioned my database related value but no luck. Even there is no proper documentation on how to use module's app.config file.

    Hoping for quick reply. I am really stuck in my project development and I am feeling Sitefinity version 4 is wrong decision for my project.

    Best Regards,

    Janak Darji
  2. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    25 Apr 2011
    Link to this post
    Hello Janak,

    You need to use this.GetContext() instead.

    Cheers,
    Duneel
  3. Janak
    Janak avatar
    6 posts
    Registered:
    13 Dec 2010
    26 Apr 2011
    Link to this post
    First thing is I am not getting this.GetContext() option in my code.

    Also important thing is I am following Job Module which is working properly and same thing I followed to create my module. I don't know why it is giving me problem in this section.

    Haven't got any answer on below. Waiting for your reply.

    "Also please provide us some proper guide about how to work with user create tables because the provided tutorial doesn't contain any details related to connectivity of database  and tables which is something very basic information require for any custom module".





  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    27 Apr 2011
    Link to this post
    Hello Janak,

    Unfortunately, we cannot tell you what is causing this exception without seeing the whole implementation of the module. If you send us the project, we could have a look. The exact part of the code, that you have pasted, seems fine, in case you are using Sitefinity 4.0.
    However, in case the version is 4.1, Duneel's suggestion is valid. Actually, in the Q1 release, we made a big change (improvement) of the way persistence classes are mapped in the database. You can find more information here:
    http://www.sitefinity.com/blogs/slavoingilizov/posts/11-04-07/changes_in_mapping_persistent_classes_in_custom_modules_with_sitefinity_4_1.aspx

    The actual migration shouldn't take much time if you follow the steps. Also we will release the SDK with the updated sample till the end of this week.

    Kind regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  5. Richard
    Richard avatar
    77 posts
    Registered:
    24 Oct 2007
    28 Apr 2011
    Link to this post
    I TOTALLY agree with the original poster and strangely enough I am having the same problem.

    The documentation needs to improved greatly and I hope with the 4.1 release, the documentation and examples will be clearer, more accurate and actually up to date.  It is a waste of my time and also Telerik time in raising and answering support calls.

    You need to consolidate and remove old posts/guides that are no longer relevant!  Tired of following a tutorial only to find I need to raise a support call because the tutorial is out of date or because 10 threads I found are't actually answered.
  6. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    03 May 2011
    Link to this post
    Hello Richard,

    Yes, you are right.
    We know about these problems and we are already working to address them.

    Best wishes,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

6 posts, 0 answered