Loading...

Power Pages – Delete Operation using WebAPI

Power Pages – Delete Operation using WebAPI
Delete Operation: The DELETE method deletes an existing record by its ID. The record ID is included in the URL, and the response indicates whether the deletion was successful. Use DELETE to remove a record based on its ID. To delete an existing record, you can use the DELETE method. Below is a sample code snippet to delete a contact record by its ID. Delete Operation Using JQuery: $(document).ready(function() {$(‘#deleteButton’).click(function() {const contactId = ‘your-contact-id-here’; }); Delete Record (DELETE) function deleteContactRecord(contactId) {$.ajax({type: “DELETE”,url: /_api/contacts(${contactId}),headers: {“Accept”: “application/json”,“OData-MaxVersion”: “4.0”,“OData-Version”: “4.0”},success: function () {console.log(“Record Deleted”);},error: function (xhr) {console.error(“Error Deleting Record: “, xhr.responseText);}});} Web Template: Delete Record (DELETE) Scenario: Delete a Contact Record Using Web Template <script> function deleteContact(contactId) { […]

Published on:

Learn more
Invent CRM
Invent CRM

Surya's MS CRM Blog

Share post:

Related posts

Dynamic File Attachment Grid in Power Pages Using JavaScript and Web API

Managing and displaying file attachments in Power Pages is a common requirement for business applications built on the Dataverse. In this blog...

12 hours ago

Updating record using Custom Button Power Pages

Requirement Power Pages provides a flexible platform to build low-code, externally facing web applications on top of Dataverse. A common requi...

3 days ago

The refresh token has expired due to inactivity when connecting to Power Pages using Power Apps CLI – Quick Fix

Hi Folks, This post is about a quick fix for an error occurred with Power Apps CLI. I was trying to connect to my organization using CLI and t...

10 days ago

Power Pages – Hide/Show fields, Controls, Tabs using reusable code for basic form, web page, liquid template, multistep form.

Using reusable code especially in platforms like Power Pages or any web-based environment gives several significant advantages in terms of eff...

10 days ago

Microsoft Power Pages: The authentication key for your portal will expire

I saw the below Notification today, while I was working on the Portal requirements. Notification:The authentication key for your portal will e...

23 days ago

Power Pages Fundamentals #20: Step-by-Step Guide to Create Dataverse Records in Power Pages: Quick Read Series

In Power Pages to create records and store them in dataverse , we can use power of WebAPI and use it inside liquid in web template. I will exp...

1 month ago

How to Create Reusable Custom Component using Web Template in Power Pages

In this blog, we’ll show you how to create a reusable, dynamic review card component in Power Pages using custom web templates. This allows yo...

1 month ago

Power Pages Actions in Visual Studio Code

Two years ago I posted about the features within Visual Studio Code to create assets in Power Pages. Since that time the team at Microsoft has...

1 month ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy