Frappe HTTP API "Delete" Not Working

67 views
Skip to first unread message

Ashraful Alam

unread,
Aug 12, 2014, 3:29:04 AM8/12/14
to erpnext-dev...@googlegroups.com
I am working a new project. My Project Process showing here::

1. At first Create a doctype with fields and button
2. 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"));
            }
        }
  })
 
});


After sending HTTP request it will return "500 INTERNAL SERVER ERROR".

I am following HTTP API suggestion but it's not working. How to solve this .....


You Will find a attach file for check my page design .... :)
1559241_832734556737619_1380505647_o.jpg

Anand Doshi

unread,
Sep 2, 2014, 12:23:50 PM9/2/14
to ERPNext Developer's Forum
I don't think DELETE is designed to be used to delete a child row. It is to delete the main doc.

-Anand.


--
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...@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.

Reply all
Reply to author
Forward
0 new messages