Menu

Delete Module

Kola Oyewumi

Basic Usage

This sample usage shows how to delete "Bugs" module entity data. For more request options make changes to the Options parameter.

This implements the set_entry SugarCRM REST API method.

package com.sugaronrest.tests;

import com.sugaronrest.*;
import com.sugaronrest.modules.Bugs;


String url = "http://demo.suiteondemand.com/service/v4_1/rest.php";
String username = "will";
String password = "will";

SugarRestClient client = new SugarRestClient(url, username, password);
SugarRestRequest request = new SugarRestRequest("Bugs", RequestType.Delete);
String bugId = "2e1cbd26-a8ed-755b-23f1-5883cc4de3ae";

request.setParameter(bugId);

SugarRestResponse response = client.execute(request);

Response (getData())

String deletedBugId = (String)response.getData();

Response (getJData())

"2e1cbd26-a8ed-755b-23f1-5883cc4de3ae"

Response (getJsonRawRequest())

{
  "method": "set_entry",
  "input_type": "json",
  "response_type": "json",
  "rest_data": {
    "session": "sneh9ve4o0fdoup5ui8fe192c1",
    "module_name": "Bugs",
    "name_value_list": {
      "name": {
        "name": "deleted",
        "value": 1
      },
      "id": {
        "name": "id",
        "value": "2e1cbd26-a8ed-755b-23f1-5883cc4de3ae"
      }
    }
  }
}

Response (getJsonRawResponse())

{
  "id": "2e1cbd26-a8ed-755b-23f1-5883cc4de3ae",
  "entry_list": {
    "deleted": {
      "name": "deleted",
      "value": 1
    },
    "id": {
      "name": "id",
      "value": "2e1cbd26-a8ed-755b-23f1-5883cc4de3ae"
    }
  }
}

Related

Wiki: Home
Wiki: Request Options
Wiki: _Sidebar

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.