Remedyforce dont have any exposed REST API I guess. But you can use the Salesforce REST API for creating the records of the Incident type. You will need to make a POST call on URL something like
http://na1.salesforce.com/services/data/v20.0/sobjects/BMCServiceDesk__Incident__c
In body you will need to pass the fieldnames and its values in JSON format, something like below
{
"fieldname" : "Testrecord"
}
You can start by defining an Account object that you would refer in your createShipment method.
public with sharing class ShipmentExtension {
ApexPages.StandardController standardController;
String accountId;
public Account objAccount {get; set;}
Next, in your constructor you can initialize objAccount.
public ShipmentExtension(ApexPages.StandardController standardController) {
this.standardController = standardController;
this.accountId = ApexPages.currentPage().getParameters().get('accountid');
this.carrier = 'Private Freight'; /* Default Option */
if(!string.isEmpty(this.accountId)){
objAccount = [SELECT Id, Name, Owner.Name, ShippingStreet, ShippingCity, ShippingCountry, ShippingState, ShippingPostalCode FROM Account
WHERE Id = :this.AccountId];
} else {
objAccount = new Account();
}
}
In your VF page, you would need to use {!objAccount.}
instead of {!Account.}
In you createShipment() method, you would be able to get the updated values when you refer the objAccount object.
new_shipment.Account__c = objAccount.Id;
Finally, instead of returning null, you would return the PageReference of the new shipment record.
Best Answer
REST API means that you can use 'GET', 'POST', 'PATCH' or 'DELETE' as HTTP methods for your requested resource. These methods correspond to what you're trying to achieve. GET = describe, POST = insert, PATCH = update, DELETE = delete. Here's an example of how to insert a new Account using the POST method: