< Back

Remove-D365CeODataEntity

Mon Jan 13, 2020 8:45 am

NAME Remove-D365CeODataEntity



SYNOPSIS

Remove a Data Entity from Dynamics 365 Customer Engagement





SYNTAX

Remove-D365CeODataEntity [-EntityName] <String> [-Key] <String> [[-Tenant] <String>] [[-URL] <String>]

[[-ClientId] <String>] [[-ClientSecret] <String>] [-EnableException] [<CommonParameters>]





DESCRIPTION

Removes a Data Entity, defined by the EntityKey, using the OData endpoint of the Dynamics 365 Customer Engagement





PARAMETERS

-EntityName <String>

Name of the Data Entity you want to work against



The parameter is Case Sensitive, because the OData endpoint in D365CE is Case Sensitive



Remember that most Data Entities in a D365CE environment is named by its singular name, but most be retrieve

using the plural name



E.g. The account Data Entity is named "account", but can only be retrieving using "accounts"



Use the XRMToolBox (https://www.xrmtoolbox.com) to help you identify the names of the Data Entities that you

are looking for



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Key <String>

The key that will select the desired Data Entity uniquely across the OData endpoint



The key would most likely be made up from multiple values, but can also be a single value



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Tenant <String>

Azure Active Directory (AAD) tenant id (Guid) that the D365CE environment is connected to, that you want to

access through OData



Required? false

Position? 3

Default value $Script:ODataTenant

Accept pipeline input? false

Accept wildcard characters? false



-URL <String>

URL / URI for the D365CE environment you want to access through OData



Required? false

Position? 4

Default value $Script:ODataUrl

Accept pipeline input? false

Accept wildcard characters? false



-ClientId <String>

The ClientId obtained from the Azure Portal when you created a Registered Application



Required? false

Position? 5

Default value $Script:ODataClientId

Accept pipeline input? false

Accept wildcard characters? false



-ClientSecret <String>

The ClientSecret obtained from the Azure Portal when you created a Registered Application



Required? false

Position? 6

Default value $Script:ODataClientSecret

Accept pipeline input? false

Accept wildcard characters? false



-EnableException [<SwitchParameter>]

This parameters disables user-friendly warnings and enables the throwing of exceptions

This is less user friendly, but allows catching exceptions in calling scripts



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: OData, Data, Entity, Import, Upload



Author: M????tz Jensen (@Splaxi)



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Remove-D365CeODataEntity -EntityName ExchangeRates -EntityKey

"RateTypeName='TEST'","FromCurrency='DKK'","ToCurrency='EUR'","StartDate=2019-01-13T12:00:00Z"



This will remove a Data Entity from the D365CE environment through OData.

It will use the ExchangeRate entity, and its EntitySetName / CollectionName "ExchangeRates".

It will use the "RateTypeName='TEST'","FromCurrency='DKK'","ToCurrency='EUR'","StartDate=2019-01-13T12:00:00Z" as

the unique key for the entity.



It will use the default OData configuration details that are stored in the configuration store.











RELATED LINKS

Add-D365CeODataConfig

Get-D365CeActiveODataConfig

Set-D365CeActiveODataConfig