Re: [erpnext-dev] Frappe HTTP API "Delete" Not Working

I don't think DELETE is designed to be used to delete a child row. It is to delete the main doc.

-Anand.


On Tue, Aug 12, 2014 at 12:59 PM, Ashraful Alam <as...@gmail.com> wrote:
I am working a new project. My Project Process showing here::

1. At first Create a doctype with fields and button
  1. after clicking the button there show some row( comes from database ). And every row have a delete button.
    2. Add an jquery onclick event for this delete button
    3. When click delete button send a ajax HTTP API request for delete this. URL : (http://0.0.0.0:8000/api/resource/Visit/V-140805000001)



There is my codes for delete a row by sending HTTP API.


$(‘html’).on(‘click’, ‘.deleteSlotRow’, function(){
var DelID = $(this).attr(‘data-deletevalue’);


$.ajax({
type:"DELETE",
url: 'api/resource/Patient Visit/'+DelID,
statusCode: {
200: function(data) {
console.log(data);
msgprint(__("Delete Successful"));

        }<br>        }<br>  })<br> <br>});<br><br><br>After sending HTTP request it will return &quot;500 INTERNAL SERVER ERROR&quot;.</div><br>I am following HTTP API suggestion but it&#39;s not working. How to solve this .....<br>



You Will find a attach file for check my page design … :slight_smile:



Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/328e1bf9-dd09-4b8d-b8f9-703c3ed41875%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF00%2BbZKLh%2BXnqXmFO068sW9-JUabCUqdGmKVmP%3D4rJntw%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.