components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.description
components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.retrieve-by-id-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.retrieve-by-id-description
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-by-id-react-comment-line1
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-by-id-react-comment-line2
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-by-id-react-comment-line3
import { useViewMetadata } from '@powerportalspro/react';
function MyComponent() {
const { data: viewMetadata, status } = useViewMetadata(viewId);
if (status !== 'success' || !viewMetadata) return null;
const { name, fetchXml, tableName, isDefault } = viewMetadata;
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-by-id-placeholder-comment
}[Inject]
private IViewMetadataCache _viewCache { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
var viewMetadata = await _viewCache.GetAsync(viewId);
if (viewMetadata != null)
{
var viewName = viewMetadata.Name;
var fetchXml = viewMetadata.FetchXml;
var tableName = viewMetadata.TableName;
var isDefault = viewMetadata.IsDefault;
}
}components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.retrieve-all-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.retrieve-all-description
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-all-react-comment-line1
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-all-react-comment-line2
import { useViewsForTable } from '@powerportalspro/react';
import { ViewType } from '@powerportalspro/core';
function MyComponent() {
const { data: allViews } = useViewsForTable('contact');
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-all-public-comment
const publicViews = allViews?.filter((v) => v.type === ViewType.Public) ?? [];
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-all-default-comment
const defaultView = allViews?.find((v) => v.isDefault);
}var allViews = await _viewCache.GetAllViewsForTableAsync("contact");
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-all-public-comment
var publicViews = allViews
.Where(v => v.Type == ViewType.Public)
.ToList();
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.snippet-all-default-comment
var defaultView = allViews
.FirstOrDefault(v => v.IsDefault);components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.tip-label
components.PowerPortalsPro.Demo.Client.Customizations.Pages.Services.ViewMetadataCache.ViewMetadataCacheDemoPage.tip-prefer-cache
IViewMetadataCache Interface
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.methods
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.parameters | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description |
|---|---|---|---|
GetAllViewsForTableAsync | string tableName | Task<IEnumerable<ViewMetadata>> | 指定されたテーブルのすべてのキャッシュされたビューメタデータ(公開ビュー、システムビュー、ユーザー定義ビューを含む)を返します。 |
GetAsync | Guid key CancellationToken token | Task<ViewMetadata> | キーでキャッシュからアイテムを取得します。もしアイテムがキャッシュされていない場合は、基底のソースからフェッチされ、キャッシュされて返されます。 |
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
GetAllViewsForTableAsynccomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.parameters:
string tableName
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
Task<IEnumerable<ViewMetadata>>
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
指定されたテーブルのすべてのキャッシュされたビューメタデータ(公開ビュー、システムビュー、ユーザー定義ビューを含む)を返します。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
GetAsynccomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.parameters:
Guid key
CancellationToken token
CancellationToken token
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
Task<ViewMetadata>
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
キーでキャッシュからアイテムを取得します。もしアイテムがキャッシュされていない場合は、基底のソースからフェッチされ、キャッシュされて返されます。
ViewMetadata components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.class
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.properties
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.default | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description |
|---|---|---|---|
Columns | List<ViewColumn> | グリッドに表示される列、論理名やピクセル幅も含めて。 | |
DisplayName | string? | このビューの表示名はオプションです。設定すると、これはデフォルトのラベルとして使われます。 「選択機能のドロップダウンを見る」ローカライゼーション項目は | |
FetchXml | string | このビューでどのレコードや列が取得されるかを定義するFetchXMLクエリです。 | |
IsDefault | bool | False | これがテーブルのデフォルトビューかどうかを示します。 |
Name | string | ビューの表示名。 | |
QuickFindCompatible | bool | False | このビューがクイックファインド検索に対応しているかどうかを示します。 |
TableName | string | このビューがクエリするDataverseテーブルの論理名。 | |
Type | ViewType? | ビューの種類(Public、AdvancedFind、Associated、QuickFind、Lookupなど)。 | |
UserDefined | bool | False | このビューがユーザーによって作成された(true)かシステムビュー(false)かを示します。 |
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
Columnscomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
List<ViewColumn>
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
グリッドに表示される列、論理名やピクセル幅も含めて。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
DisplayNamecomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
string?
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
このビューの表示名はオプションです。設定すると、これはデフォルトのラベルとして使われます。 「選択機能のドロップダウンを見る」ローカライゼーション項目は テーブル。{TableName}.views。{Id}.label が存在する場合は優先されます。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
FetchXmlcomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
string
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
このビューでどのレコードや列が取得されるかを定義するFetchXMLクエリです。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
IsDefaultcomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
bool
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.default:
False
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
これがテーブルのデフォルトビューかどうかを示します。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
Namecomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
string
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
ビューの表示名。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
QuickFindCompatiblecomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
bool
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.default:
False
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
このビューがクイックファインド検索に対応しているかどうかを示します。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
TableNamecomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
string
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
このビューがクエリするDataverseテーブルの論理名。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
Typecomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
ViewType?
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
ビューの種類(Public、AdvancedFind、Associated、QuickFind、Lookupなど)。
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name:
UserDefinedcomponents.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type:
bool
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.default:
False
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description:
このビューがユーザーによって作成された(true)かシステムビュー(false)かを示します。
