The target view cannot be configured as a mobile view.

Open
#886 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
tooling

Research direction

Start by reproducing the provisioning failure with the supplied View XML, then inspect PnP.Framework.Provisioning.ObjectHandlers.ObjectListInstance.CreateView and ProcessViews from the stack trace. Determine why the MobileView="TRUE" and Type="GRID" combination is rejected, and add coverage for the reported configuration if the project has a suitable test location.

Written by the indexing model from the issue text.

Description

Category

  • Bug

When deploying a template with a list view with parameters MobileView="TRUE" and Type="GRID" gives a ServerException.

If the MobileView is changed to "False" or the Type to "HTML" it works. Like

  • MobileView="FALSE" and Type="GRID"
  • MobileView="TRUE" and Type="HTML"

Is there any reason why this is not accepted?

Example

<View Name="{DAB0E315-6F4A-412C-9287-285F67B3B482}" MobileView="TRUE" Type="GRID" DisplayName="All Items" Url="{site}/Lists/Event Itinerary/All Items.aspx" Level="1" ContentTypeID="0x">
              <Query />
              <ViewFields>
                <FieldRef Name="LinkTitle" />
                <FieldRef Name="SessionCode" />
                <FieldRef Name="SessionType" />
                <FieldRef Name="Description" />
                <FieldRef Name="Speakers" />
                <FieldRef Name="StartDateAndTime" />
                <FieldRef Name="EndDateAndTime" />
                <FieldRef Name="Duration" />
                <FieldRef Name="Capacity" />
                <FieldRef Name="Location" />
                <FieldRef Name="Notes" />
              </ViewFields>
              <RowLimit Paged="TRUE">30</RowLimit>
              <CustomFormatter><![CDATA[
{
	"additionalRowClass": {
		"operator": ":",
		"operands": [{
			"operator": "==",
			"operands": [{
				"operator": "%",
				"operands": ["@rowIndex", 2]
			}, 0]
		}, "sp-css-backgroundColor-neutralBackground", {
			"operator": ":",
			"operands": [{
				"operator": "==",
				"operands": [{
					"operator": "%",
					"operands": ["@rowIndex", 2]
				}, 1]
			}, "", ""]
		}]
	},
	"rowClassTemplateId": "BgColorAlternateRows"
}]]></CustomFormatter>

Error

(ServerException) The target view cannot be configured as a mobile view.

 --- Server Error Details:
 - ServerErrorCode: -2146232832
 - ServerErrorTraceCorrelationId: 4d94b8a0-908a-6000-a328-75f154a12cc7
 - ServerErrorTypeName: Microsoft.SharePoint.SPException
 - Source: Microsoft.SharePoint.Client.Runtime

 --- StackTrace:    at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
    at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
    at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServerAsync(ChunkStringBuilder sb)
    at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryAsync()
    at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQueryAsync()
    at Microsoft.SharePoint.Client.ClientContext.ExecuteQueryAsync()
    at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, String userAgent)
    at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryRetry(ClientRuntimeContext clientContext, Int32 retryCount, String userAgent)
    at PnP.Framework.Provisioning.ObjectHandlers.ObjectListInstance.CreateView(Web web, View view, ViewCollection existingViews, List createdList, PnPMonitoredScope monitoredScope, TokenParser parser, Int32 currentViewIndex, Int32 total)
    at PnP.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ProcessViews(Web web, TokenParser parser, PnPMonitoredScope scope, ListInfo listInfo)
    at PnP.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation)
    at PnP.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo, Boolean calledFromHierarchy, TokenParser tokenParser)
Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pnp/pnpframework

All issues in pnp/pnpframework

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.