Click here to Skip to main content
14,326,017 members

SharePoint

 
AnswerRe: Sharepoint 2010. Resource Calendar - add new item with resource Pin
Ayan Chalki15-Jun-14 19:40
memberAyan Chalki15-Jun-14 19:40 
QuestionWhat's the best Architecture for this case in SharePoint 2013 Portal Pin
Maher Elsayed3-May-14 1:59
memberMaher Elsayed3-May-14 1:59 
AnswerRe: What's the best Architecture for this case in SharePoint 2013 Portal Pin
Member 109951416-Aug-14 0:23
memberMember 109951416-Aug-14 0:23 
QuestionHow to merge two domain on Sharepoint 2010 Pin
trunghieu0725-Apr-14 0:14
membertrunghieu0725-Apr-14 0:14 
QuestionOrderBy on SPListItemCollection Pin
trunghieu0725-Apr-14 0:09
membertrunghieu0725-Apr-14 0:09 
AnswerRe: OrderBy on SPListItemCollection Pin
Member 99266858-May-14 17:11
memberMember 99266858-May-14 17:11 
AnswerRe: OrderBy on SPListItemCollection Pin
Kannan Karthikeyan11-Nov-14 4:20
memberKannan Karthikeyan11-Nov-14 4:20 
QuestionSome trouble with creating a group on feature activation Pin
Aptiva Dave10-Apr-14 10:05
memberAptiva Dave10-Apr-14 10:05 
I've built a feature for our training department, which up until today has worked as intended. Today wrote some code in the feature activation that will add a new SharePoint group called 'Travel Plaza Managers' (Travel Plaza is a department within our organization that runs our gas stations).

On the feature activation I first run a function called 'checkForGroup', which checks to see if the group has already been created on the site. Here is the code for that group:

''' <summary>
    ''' Checks to see if the group exists in the the site
    ''' </summary>
    ''' <param name="groupName"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function checkForGroup(ByVal groupName As String, ByVal web As SPWeb) As Boolean
        Dim group As SPGroup = Nothing
        Try
            group = web.Groups(groupName)
        Catch ex As Exception

        End Try

        If Not group Is Nothing Then
            Return True
        Else
            Return False
        End If
    End Function


If this function returns 'False' then I call another function called 'CreateTPManagersGroup', which runs this code:
''' <summary>
   ''' Creates the Travel Plaza Managers Group
   ''' </summary>
   ''' <param name="web">The current web</param>
   ''' <remarks></remarks>
   Public Sub CreateTPManagersGroup(ByVal web As SPWeb)
       'create the owner of the group
       Dim owner As SPUser = web.SiteAdministrators("username")
       Dim member As SPMember = web.SiteAdministrators("username")
       'get the groups
       Dim groups As SPGroupCollection = web.SiteGroups
       'add the Travel Plaza Managers to the list of site groups
       groups.Add("TP Managers", member, owner, "These are the current Travel Plaza Managers of the Choctaw Nation")
       Dim newSPGroup As SPGroup = groups("TP Managers")
       Dim role As SPRoleDefinition = web.RoleDefinitions("Read")
       Dim roleAssignment As SPRoleAssignment = New SPRoleAssignment(newSPGroup)
       roleAssignment.RoleDefinitionBindings.Add(role)
       web.Update()
   End Sub


So, the first time I ran this, the activation ran fine, but when I went to see if the group had been created the group name wasn't there. Figured I may have done something like not actually deploy the current version of the feature, so I did another deploy from Visual Studio and got the message saying that the group name had already been used.

Did a debug on the feature activation and each time 'checkForGroup' returns 'False', but I still get the same message that the group name has already been used. I can't remove the group because it doesn't show up on the website, so what am I to do?

modified 10-Apr-14 16:18pm.

QuestionAbout SharePoint 2010 workflows Pin
BHUPATHI NAIDU9-Apr-14 1:49
memberBHUPATHI NAIDU9-Apr-14 1:49 
AnswerRe: About SharePoint 2010 workflows Pin
Richard MacCutchan9-Apr-14 3:06
protectorRichard MacCutchan9-Apr-14 3:06 
QuestionHow to set the _CheckinComment with CSOM? Pin
Member 92461551-Apr-14 2:51
memberMember 92461551-Apr-14 2:51 
QuestionNeed help/example using Sharepoint web services Pin
turbosupramk328-Mar-14 1:35
memberturbosupramk328-Mar-14 1:35 
AnswerRe: Need help/example using Sharepoint web services Pin
Eddy Vluggen25-Apr-14 4:30
mveEddy Vluggen25-Apr-14 4:30 
QuestionWiki Site in Sharepoint 2010 Pin
Deeman12316-Mar-14 9:14
memberDeeman12316-Mar-14 9:14 
AnswerRe: Wiki Site in Sharepoint 2010 Pin
Richard Deeming17-Mar-14 2:36
mveRichard Deeming17-Mar-14 2:36 
AnswerRe: Wiki Site in Sharepoint 2010 Pin
vbmike28-Mar-14 4:00
membervbmike28-Mar-14 4:00 
Questionpreview documents in documents library Pin
Member 40596485-Mar-14 1:49
memberMember 40596485-Mar-14 1:49 
AnswerRe: preview documents in documents library Pin
Bernhard Hiller5-Mar-14 21:55
memberBernhard Hiller5-Mar-14 21:55 
GeneralRe: preview documents in documents library Pin
Member 40596485-Mar-14 23:20
memberMember 40596485-Mar-14 23:20 
GeneralRe: preview documents in documents library Pin
Member 40596486-Mar-14 0:23
memberMember 40596486-Mar-14 0:23 
QuestionSharePoint 2010 installation procedure with the valid links to the softwares Pin
Member 1031836725-Feb-14 4:59
memberMember 1031836725-Feb-14 4:59 
AnswerRe: SharePoint 2010 installation procedure with the valid links to the softwares Pin
Richard MacCutchan25-Feb-14 5:35
protectorRichard MacCutchan25-Feb-14 5:35 
GeneralRe: SharePoint 2010 installation procedure with the valid links to the softwares Pin
Member 1031836725-Feb-14 14:24
memberMember 1031836725-Feb-14 14:24 
GeneralRe: SharePoint 2010 installation procedure with the valid links to the softwares Pin
Richard MacCutchan25-Feb-14 21:18
protectorRichard MacCutchan25-Feb-14 21:18 
QuestionCreating People Picker using Client Object Model in Sharepoint Pin
AmanDiwakar18-Feb-14 20:58
memberAmanDiwakar18-Feb-14 20:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.