Changing Create Group Widget

Support

Support
A public community space for Developers, IT Professionals, Architects, and System Administrators to engage and help each other, share knowledge and best practices, find product documentation and Q&A, and discuss technology oriented topics.

Changing Create Group Widget

This question is not answered

Hi,

I'm trying to change the Create - Group widget to do the following:

Auto create two forums in stead of the default one (Discussions). i.e.

I want to create two forums : One for discussions and one for Q&A.

I thought a simple change to the widget to include another registered push function with different formdata would do it, but get the following error:

Violation of UNIQUE KEY constraint 'IX_te_Forum_Forums_Validation'.

Cannot insert duplicate key in object 'dbo.te_Forum_Forums'.

Cannot insert the value NULL into column 'ApplicationId', table 'Telligent4GA.dbo.te_Applications';

column does not allow nulls. INSERT fails.

The statement has been terminated. The statement has been terminated.

•Unable to create forum

The duplicate key ?? I thought that the Id get's auto generated.

Thanks

All Replies
  • maybe it's because it;s asynchronous trying to add the new forum before the other one is done ??

  • Hi,

    I would make sure that the names don't conflict and you may also want to include the "DefaultThreadType" in your "forumCreateData" for both calls.

    Would it be possible to see a sample of the ui.js file to look at the createMethods.Push function you added?

    Thanks

  • Hi Rudy,

    Thanks, yes it's just a copy of the default one, with some added attributes. They work on their own, but not together..

    createMethods.push(function(){

    var forumCreateData = {

    GroupId: group.Id,

    Name: group.Name + ' - General Discussions' // + context.singularNameForum

    };

    // if there was a mailing list associated with this forum create request, create it now

    if($(context.forumMailingInput).is(':checked')) {

    $.extend(forumCreateData, {

    EnableMailingList: true,

    MailingListName: forumCreateData.Name,

    MailingListAddress: $(context.forumAddressInput).val()

    });

    }

    $.telligent.evolution.post({

    url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/forums.json',

    data: forumCreateData,

    success: function(response) {

    handleResponse(response, context.createForumErrorMessage);

    },

    defaultErrorMessage: context.createForumErrorMessage

    });

    });

    createMethods.push(function(){

    var forumCreateData = {

    GroupId: group.Id,

    Name: group.Name + ' - Questions & Answers', # + context.singularNameForum

                                                          AllowedThreadTypes: 'QuestionAndAnswer'

    };

    // if there was a mailing list associated with this forum create request, create it now

    if($(context.forumMailingInput).is(':checked')) {

    $.extend(forumCreateData, {

    EnableMailingList: true,

    MailingListName: forumCreateData.Name,

    MailingListAddress: $(context.forumAddressInput).val()

    });

    }

    $.telligent.evolution.post({

    url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/forums.json',

    data: forumCreateData,

    success: function(response) {

    handleResponse(response, context.createForumErrorMessage);

    },

    defaultErrorMessage: context.createForumErrorMessage

    });

    });

  • Hi,

    Please try removing the comment "// + context.singularNameForum" and

    also the "# + context.singularNameForum" from the forumCreateData section.

    With those changes I was able to create a new group with 2 Forums.

    Thanks,

    Rudy Sandoval

  • Hi Rudy,

    Yes,  I just commented out the stuff that was there, he # is just a typo, should have been //.

    Anyway, I removed it, but still get the duplicate key error. I couldn't get it to work, so pretty much gave up on that idea.

    Thanks