Skip to content

Commit d634c7b

Browse files
Update restore-deleted-records.md
1 parent 4200828 commit d634c7b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

powerapps-docs/developer/data-platform/restore-deleted-records.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,11 @@ You can use this static `SetCleanupIntervalInDays` method to set the `CleanupInt
431431
/// Updates the CleanupIntervalInDays value for a specified table
432432
/// </summary>
433433
/// <param name="service">The authenticated IOrganizationService instance</param>
434-
/// <param name="tableLogicalName">The logical name of the table</param>
434+
/// <param name="entityId">The entityId of the table</param>
435435
/// <param name="cleanupIntervalInDays">The new CleanupIntervalInDays value</param>
436436
static void SetCleanupIntervalInDays(
437437
IOrganizationService service,
438-
string tableLogicalName,
438+
Guid entityId,
439439
int cleanupIntervalInDays)
440440
{
441441

@@ -447,9 +447,9 @@ static void SetCleanupIntervalInDays(
447447
Conditions = {
448448
{
449449
new ConditionExpression(
450-
attributeName: "name",
450+
attributeName: "extensionofrecordid",
451451
conditionOperator: ConditionOperator.Equal,
452-
value: tableLogicalName)
452+
value: entityId)
453453
}
454454
}
455455
}
@@ -482,21 +482,21 @@ static void SetCleanupIntervalInDays(
482482

483483
### [Web API](#tab/webapi)
484484

485-
This `Set-CleanupIntervalInDays` PowerShell function retrieves the `recyclebinconfig` row that has the name value that matches the `$tableLogicalName` parameter. Then it updates the `cleanupintervalindays` column property of the record to the value of the `$cleanupIntervalInDays` parameter.
485+
This `Set-CleanupIntervalInDays` PowerShell function retrieves the `recyclebinconfig` row that has the entityId that matches the `$tableEntityId` parameter. Then it updates the `cleanupintervalindays` column property of the record to the value of the `$cleanupIntervalInDays` parameter.
486486

487487
This function depends on the `Get-Records` and `Update-Record` functions described in [Create table operations functions](webapi/use-ps-and-vscode-web-api.md#create-table-operations-functions).
488488

489489
```powershell
490490
function Set-CleanupIntervalInDays{
491491
param(
492492
[Parameter(Mandatory)]
493-
[string]$tableLogicalName,
493+
[string]$tableEntityId,
494494
[Parameter(Mandatory)]
495495
[int]$cleanupIntervalInDays
496496
)
497497
$records = (Get-Records `
498498
-setName 'recyclebinconfigs' `
499-
-query "?`$filter=name eq '$($tableLogicalName)'").value
499+
-query "?`$filter=_extensionofrecordid_value eq '$($tableEntityId)'").value
500500
501501
if ($records.Count -eq 1) {
502502
$recyclebinconfigId = $records[0].recyclebinconfigid
@@ -509,7 +509,7 @@ function Set-CleanupIntervalInDays{
509509
}
510510
}
511511
else {
512-
Write-Host "Recycle bin configuration for table $tableLogicalName not found."
512+
Write-Host "Recycle bin configuration for table $tableEntityId not found."
513513
}
514514
}
515515
```
@@ -525,7 +525,7 @@ function Set-CleanupIntervalInDays{
525525
To disable the recycle bin for a table, disable the `recyclebinconfig` record for the table by setting the [statecode](reference/entities/recyclebinconfig.md#BKMK_statecode) and [statuscode](reference/entities/recyclebinconfig.md#BKMK_statuscode) properties to their **Inactive** values: `2` and `1` respectively.
526526

527527
> [!NOTE]
528-
> The following queries compare the `LogicalName` value against the [Entity.Name](reference/entities/entity.md#BKMK_Name) column value, which stores the table `SchemaName`. `LogicalName` is the lower-case version of the `SchemaName`. String value comparisons are case insensitive, so it does't matter which format of name you use.
528+
> The following queries compare the `EntityId` value against the [Entity.EntityId](reference/entities/entity.md#-entityid) column value, which stores the table `EntityId`.
529529
530530
### [SDK for .NET](#tab/sdk)
531531

@@ -536,18 +536,18 @@ Use this static `DisableRecycleBinForTable` method to disable the recycle bin fo
536536
/// Disable the Recycle bin for a specified table
537537
/// </summary>
538538
/// <param name="service">The authenticated IOrganizationService instance</param>
539-
/// <param name="tableLogicalName">The logical name of the table</param>
539+
/// <param name="tableEntityId">The entityId of the table</param>
540540
static void DisableRecycleBinForTable(
541541
IOrganizationService service,
542-
string tableLogicalName)
542+
Guid tableEntityId)
543543
{
544544

545545
QueryExpression query = new("recyclebinconfig")
546546
{
547547
ColumnSet = new ColumnSet("recyclebinconfigid")
548548
};
549549
LinkEntity entityLink = query.AddLink("entity", "extensionofrecordid", "entityid");
550-
entityLink.LinkCriteria.AddCondition("name", ConditionOperator.Equal, tableLogicalName);
550+
entityLink.LinkCriteria.AddCondition("extensionofrecordid", ConditionOperator.Equal, tableEntityId);
551551

552552
EntityCollection recyclebinconfigs = service.RetrieveMultiple(query);
553553

@@ -568,7 +568,7 @@ static void DisableRecycleBinForTable(
568568
}
569569
else
570570
{
571-
string message = $"Recycle bin configuration for table '{tableLogicalName}' not found.";
571+
string message = $"Recycle bin configuration for table '{extensionofrecordid}' not found.";
572572
throw new Exception(message);
573573
}
574574
}
@@ -1006,4 +1006,4 @@ The following tables are the result of the query found in [Detect which tables d
10061006
`workflowcardconnections`<br />
10071007
`workqueue`<br />
10081008
:::column-end:::
1009-
:::row-end:::
1009+
:::row-end:::

0 commit comments

Comments
 (0)