I want to list my "Custom Action" as the first item in the "Site Action" menu, so I thought of creating a new "Custom Action Group" and inside the group, I will add my "Custom Action" using the below code in elements.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomActionGroup
Description = "Display the Site Owner's Name, SharePoint Group and E-mail ID"
Id = "SiteActions1"
Location = "Microsoft.SharePoint.StandardMenu"
Sequence = "0"
Title = "View Site Owner(S)">
</CustomActionGroup>
<CustomAction
Id="ViewSiteOwner"
GroupId="SiteActions1"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="0"
Title="View Site Owner"
Description="Display the Site Owner's Name, SharePoint Group and E-mail ID." >
<UrlAction Url="javascript:OpenPopUpPageWithTitle('{SiteUrl}/_Layouts/15/Common/SiteOwnerPage.aspx?IsDlg=1','RefreshOnDialogClose',600, 200,'View Site Owner')"/>
</CustomAction>
</Elements>
But for some reason, it doesn't create custom group and the custom action, so I removed the "Custom Action Group" and created a custom action with the sequence to be "0", but SharePoint for some reason it displays as the last item in the menu,
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="ViewSiteOwner"
GroupId="SiteActions"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="20"
Title="View Site Owner"
Description="Display the Site Owner's Name, SharePoint Group and E-mail ID." >
<UrlAction Url="javascript:OpenPopUpPageWithTitle('{SiteUrl}/_Layouts/15/Common/SiteOwnerPage.aspx?IsDlg=1','RefreshOnDialogClose',600, 200,'View Site Owner')"/>
</CustomAction>
</Elements>
Is it a bug in SharePoint or is this how it works.?