Custom Script for custom button giving error


I have a custom button, which has this custom script attached to it.

Custom Script

cur_frm.cscript['select_slot'] = function(cdt, cdn) {
            method: "newquot.api.get_slot",
                source_doctype: "Slot",    
                get_query_filters: {
                    docstatus: 1

Server Side script
I have an app called newquot, where my file has this code

def get_slot(source_name, target_doc=None):
    ignore_permissions = False
    def update_slot(obj, target_doc, source_parent):
        target.block = obj.block

    doclist = get_mapped_doc("Slot", source_name, {
            "Slot": {
                "doctype": "Quotation Item",
                "validation": {
                    "docstatus": ["=", 1]
                "postprocess": update_slot
        }, target_doc, ignore_permissions=ignore_permissions)

    return doclist

When I am running this, I am able to view the Slots, and also able to pick the slot. But, when I click on Get Item, I am getting this error:

Not found The resource you are looking for is not available

Not sure where I am going wrong…

@UmaG I was hoping you would be able to format your code properly atleast by now :sweat_smile: Fixed.

Haa… haaa… @rmehta … These small things are more difficult to learn for me, i guess… :wink: Thanks for formatting the code for me… :slight_smile:

Please close this issue as I have been able to figure out the cause for error.