Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_SbRequestBody
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_ApiName
string ls_ETag
string ls_DisplayValue
string ls_Value
string ls_Active__cDisplayValue
string ls_Active__cValue
string ls_AnnualRevenueDisplayValue
string ls_AnnualRevenueValue
string ls_BillingCityDisplayValue
string ls_BillingCityValue
string ls_BillingCountryDisplayValue
string ls_BillingCountryValue
string ls_BillingPostalCodeDisplayValue
string ls_BillingPostalCodeValue
string ls_BillingStateDisplayValue
string ls_BillingStateValue
string ls_BillingStreetDisplayValue
string ls_BillingStreetValue
string ls_CreatedByDisplayValue
string ls_ApiName
string ls_ETag
string ls_IdDisplayValue
string ls_IdValue
string ls_NameDisplayValue
string ls_NameValue
string ls_Id
string ls_LastModifiedById
string ls_LastModifiedDate
string ls_RecordTypeId
string ls_RecordTypeInfo
string ls_SystemModstamp
integer li_WeakEtag
string ls_CreatedByIdDisplayValue
string ls_CreatedByIdValue
string ls_CreatedDateDisplayValue
string ls_CreatedDateValue
string ls_CustomerPriority__cDisplayValue
string ls_CustomerPriority__cValue
string ls_DescriptionDisplayValue
string ls_DescriptionValue
string ls_FaxDisplayValue
string ls_FaxValue
string ls_IndustryDisplayValue
string ls_IndustryValue
string ls_LastModifiedByDisplayValue
string ls_ValueApiName
string ls_ValueETag
string ls_ValueId
string ls_ValueLastModifiedById
string ls_ValueLastModifiedDate
string ls_ValueRecordTypeId
string ls_ValueRecordTypeInfo
string ls_ValueSystemModstamp
integer li_ValueWeakEtag
string ls_LastModifiedByIdDisplayValue
string ls_LastModifiedByIdValue
string ls_LastModifiedDateDisplayValue
string ls_LastModifiedDateValue
string ls_NumberOfEmployeesDisplayValue
string ls_NumberOfEmployeesValue
string ls_NumberofLocations__cDisplayValue
string ls_NumberofLocations__cValue
string ls_OwnerDisplayValue
string ls_OwnerIdDisplayValue
string ls_OwnerIdValue
string ls_OwnershipDisplayValue
string ls_OwnershipValue
string ls_ParentDisplayValue
string ls_ParentValue
string ls_ParentIdDisplayValue
string ls_ParentIdValue
string ls_PhoneDisplayValue
string ls_PhoneValue
string ls_RatingDisplayValue
string ls_RatingValue
string ls_SLAExpirationDate__cDisplayValue
string ls_SLAExpirationDate__cValue
string ls_SLASerialNumber__cDisplayValue
string ls_SLASerialNumber__cValue
string ls_SLA__cDisplayValue
string ls_SLA__cValue
string ls_ShippingCityDisplayValue
string ls_ShippingCityValue
string ls_ShippingCountryDisplayValue
string ls_ShippingCountryValue
string ls_ShippingPostalCodeDisplayValue
string ls_ShippingPostalCodeValue
string ls_ShippingStateDisplayValue
string ls_ShippingStateValue
string ls_ShippingStreetDisplayValue
string ls_ShippingStreetValue
string ls_SicDisplayValue
string ls_SicValue
string ls_SiteDisplayValue
string ls_SiteValue
string ls_TickerSymbolDisplayValue
string ls_TickerSymbolValue
string ls_TypeDisplayValue
string ls_TypeValue
string ls_UpsellOpportunity__cDisplayValue
string ls_UpsellOpportunity__cValue
string ls_WebsiteDisplayValue
string ls_WebsiteValue
string ls_Id
string ls_LastModifiedById
string ls_LastModifiedDate
string ls_RecordTypeId
string ls_RecordTypeInfo
string ls_SystemModstamp
integer li_WeakEtag
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "allowSaveOnDuplicate": false,
// "fields": {
// "FieldAPIName": "FieldValue"
// }
// }
loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")
loo_Json.UpdateBool("allowSaveOnDuplicate",0)
loo_Json.UpdateString("fields.FieldAPIName","FieldValue")
// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"
loo_Http.SetRequestHeader("Content-Type","application/json")
loo_SbRequestBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbRequestBody.ConnectToNewObject("Chilkat.StringBuilder")
loo_Json.EmitSb(loo_SbRequestBody)
loo_Resp = loo_Http.PTextSb("PATCH","https://domain.com/services/data/v{{version}}/ui-api/records/:RECORD_ID",loo_SbRequestBody,"utf-8","application/json",0,0)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_Json
destroy loo_SbRequestBody
return
end if
loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")
loo_Resp.GetBodySb(loo_SbResponseBody)
loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")
loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0
Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()
li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
Write-Debug "Response Header:"
Write-Debug loo_Resp.Header
Write-Debug "Failed."
destroy loo_Resp
destroy loo_Http
destroy loo_Json
destroy loo_SbRequestBody
destroy loo_SbResponseBody
destroy loo_JResp
return
end if
destroy loo_Resp
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "apiName": "Account",
// "childRelationships": {},
// "eTag": "1be6f040e46732e79a0999d6fea9fe7d",
// "fields": {
// "AccountNumber": {
// "displayValue": null,
// "value": null
// },
// "Active__c": {
// "displayValue": null,
// "value": null
// },
// "AnnualRevenue": {
// "displayValue": null,
// "value": null
// },
// "BillingCity": {
// "displayValue": null,
// "value": null
// },
// "BillingCountry": {
// "displayValue": null,
// "value": null
// },
// "BillingPostalCode": {
// "displayValue": null,
// "value": null
// },
// "BillingState": {
// "displayValue": null,
// "value": null
// },
// "BillingStreet": {
// "displayValue": null,
// "value": null
// },
// "CreatedBy": {
// "displayValue": "Philippe Ozil",
// "value": {
// "apiName": "User",
// "childRelationships": {},
// "eTag": "cc07f7ef1b08ddbd75074c69512dd388",
// "fields": {
// "Id": {
// "displayValue": null,
// "value": "005B0000003TOI6IAO"
// },
// "Name": {
// "displayValue": null,
// "value": "Philippe Ozil"
// }
// },
// "id": "005B0000003TOI6IAO",
// "lastModifiedById": "005B0000003TOI6IAO",
// "lastModifiedDate": "2023-02-02T10:32:12.000Z",
// "recordTypeId": null,
// "recordTypeInfo": null,
// "systemModstamp": "2023-09-27T15:47:51.000Z",
// "weakEtag": 1695829671000
// }
// },
// "CreatedById": {
// "displayValue": null,
// "value": "005B0000003TOI6IAO"
// },
// "CreatedDate": {
// "displayValue": "27/09/2023 18:01",
// "value": "2023-09-27T16:01:14.000Z"
// },
// "CustomerPriority__c": {
// "displayValue": null,
// "value": null
// },
// "Description": {
// "displayValue": null,
// "value": null
// },
// "Fax": {
// "displayValue": null,
// "value": null
// },
// "Industry": {
// "displayValue": null,
// "value": null
// },
// "LastModifiedBy": {
// "displayValue": "Philippe Ozil",
// "value": {
// "apiName": "User",
// "childRelationships": {},
// "eTag": "cc07f7ef1b08ddbd75074c69512dd388",
// "fields": {
// "Id": {
// "displayValue": null,
// "value": "005B0000003TOI6IAO"
// },
// "Name": {
// "displayValue": null,
// "value": "Philippe Ozil"
// }
// },
// "id": "005B0000003TOI6IAO",
// "lastModifiedById": "005B0000003TOI6IAO",
// "lastModifiedDate": "2023-02-02T10:32:12.000Z",
// "recordTypeId": null,
// "recordTypeInfo": null,
// "systemModstamp": "2023-09-27T15:47:51.000Z",
// "weakEtag": 1695829671000
// }
// },
// "LastModifiedById": {
// "displayValue": null,
// "value": "005B0000003TOI6IAO"
// },
// "LastModifiedDate": {
// "displayValue": "27/09/2023 18:04",
// "value": "2023-09-27T16:04:41.000Z"
// },
// "Name": {
// "displayValue": null,
// "value": "My Renamed Account"
// },
// "NumberOfEmployees": {
// "displayValue": null,
// "value": null
// },
// "NumberofLocations__c": {
// "displayValue": null,
// "value": null
// },
// "Owner": {
// "displayValue": "Philippe Ozil",
// "value": {
// "apiName": "User",
// "childRelationships": {},
// "eTag": "cc07f7ef1b08ddbd75074c69512dd388",
// "fields": {
// "Id": {
// "displayValue": null,
// "value": "005B0000003TOI6IAO"
// },
// "Name": {
// "displayValue": null,
// "value": "Philippe Ozil"
// }
// },
// "id": "005B0000003TOI6IAO",
// "lastModifiedById": "005B0000003TOI6IAO",
// "lastModifiedDate": "2023-02-02T10:32:12.000Z",
// "recordTypeId": null,
// "recordTypeInfo": null,
// "systemModstamp": "2023-09-27T15:47:51.000Z",
// "weakEtag": 1695829671000
// }
// },
// "OwnerId": {
// "displayValue": null,
// "value": "005B0000003TOI6IAO"
// },
// "Ownership": {
// "displayValue": null,
// "value": null
// },
// "Parent": {
// "displayValue": null,
// "value": null
// },
// "ParentId": {
// "displayValue": null,
// "value": null
// },
// "Phone": {
// "displayValue": null,
// "value": null
// },
// "Rating": {
// "displayValue": null,
// "value": null
// },
// "SLAExpirationDate__c": {
// "displayValue": null,
// "value": null
// },
// "SLASerialNumber__c": {
// "displayValue": null,
// "value": null
// },
// "SLA__c": {
// "displayValue": null,
// "value": null
// },
// "ShippingCity": {
// "displayValue": null,
// "value": null
// },
// "ShippingCountry": {
// "displayValue": null,
// "value": null
// },
// "ShippingPostalCode": {
// "displayValue": null,
// "value": null
// },
// "ShippingState": {
// "displayValue": null,
// "value": null
// },
// "ShippingStreet": {
// "displayValue": null,
// "value": null
// },
// "Sic": {
// "displayValue": null,
// "value": null
// },
// "Site": {
// "displayValue": null,
// "value": null
// },
// "TickerSymbol": {
// "displayValue": null,
// "value": null
// },
// "Type": {
// "displayValue": null,
// "value": null
// },
// "UpsellOpportunity__c": {
// "displayValue": null,
// "value": null
// },
// "Website": {
// "displayValue": null,
// "value": null
// }
// },
// "id": "0011Q00002Z2P5jQAF",
// "lastModifiedById": "005B0000003TOI6IAO",
// "lastModifiedDate": "2023-09-27T16:04:41.000Z",
// "recordTypeId": "012000000000000AAA",
// "recordTypeInfo": null,
// "systemModstamp": "2023-09-27T16:04:41.000Z",
// "weakEtag": 1695830681000
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
ls_ApiName = loo_JResp.StringOf("apiName")
ls_ETag = loo_JResp.StringOf("eTag")
ls_DisplayValue = loo_JResp.StringOf("fields.AccountNumber.displayValue")
ls_Value = loo_JResp.StringOf("fields.AccountNumber.value")
ls_Active__cDisplayValue = loo_JResp.StringOf("fields.Active__c.displayValue")
ls_Active__cValue = loo_JResp.StringOf("fields.Active__c.value")
ls_AnnualRevenueDisplayValue = loo_JResp.StringOf("fields.AnnualRevenue.displayValue")
ls_AnnualRevenueValue = loo_JResp.StringOf("fields.AnnualRevenue.value")
ls_BillingCityDisplayValue = loo_JResp.StringOf("fields.BillingCity.displayValue")
ls_BillingCityValue = loo_JResp.StringOf("fields.BillingCity.value")
ls_BillingCountryDisplayValue = loo_JResp.StringOf("fields.BillingCountry.displayValue")
ls_BillingCountryValue = loo_JResp.StringOf("fields.BillingCountry.value")
ls_BillingPostalCodeDisplayValue = loo_JResp.StringOf("fields.BillingPostalCode.displayValue")
ls_BillingPostalCodeValue = loo_JResp.StringOf("fields.BillingPostalCode.value")
ls_BillingStateDisplayValue = loo_JResp.StringOf("fields.BillingState.displayValue")
ls_BillingStateValue = loo_JResp.StringOf("fields.BillingState.value")
ls_BillingStreetDisplayValue = loo_JResp.StringOf("fields.BillingStreet.displayValue")
ls_BillingStreetValue = loo_JResp.StringOf("fields.BillingStreet.value")
ls_CreatedByDisplayValue = loo_JResp.StringOf("fields.CreatedBy.displayValue")
ls_ApiName = loo_JResp.StringOf("fields.CreatedBy.value.apiName")
ls_ETag = loo_JResp.StringOf("fields.CreatedBy.value.eTag")
ls_IdDisplayValue = loo_JResp.StringOf("fields.CreatedBy.value.fields.Id.displayValue")
ls_IdValue = loo_JResp.StringOf("fields.CreatedBy.value.fields.Id.value")
ls_NameDisplayValue = loo_JResp.StringOf("fields.CreatedBy.value.fields.Name.displayValue")
ls_NameValue = loo_JResp.StringOf("fields.CreatedBy.value.fields.Name.value")
ls_Id = loo_JResp.StringOf("fields.CreatedBy.value.id")
ls_LastModifiedById = loo_JResp.StringOf("fields.CreatedBy.value.lastModifiedById")
ls_LastModifiedDate = loo_JResp.StringOf("fields.CreatedBy.value.lastModifiedDate")
ls_RecordTypeId = loo_JResp.StringOf("fields.CreatedBy.value.recordTypeId")
ls_RecordTypeInfo = loo_JResp.StringOf("fields.CreatedBy.value.recordTypeInfo")
ls_SystemModstamp = loo_JResp.StringOf("fields.CreatedBy.value.systemModstamp")
li_WeakEtag = loo_JResp.IntOf("fields.CreatedBy.value.weakEtag")
ls_CreatedByIdDisplayValue = loo_JResp.StringOf("fields.CreatedById.displayValue")
ls_CreatedByIdValue = loo_JResp.StringOf("fields.CreatedById.value")
ls_CreatedDateDisplayValue = loo_JResp.StringOf("fields.CreatedDate.displayValue")
ls_CreatedDateValue = loo_JResp.StringOf("fields.CreatedDate.value")
ls_CustomerPriority__cDisplayValue = loo_JResp.StringOf("fields.CustomerPriority__c.displayValue")
ls_CustomerPriority__cValue = loo_JResp.StringOf("fields.CustomerPriority__c.value")
ls_DescriptionDisplayValue = loo_JResp.StringOf("fields.Description.displayValue")
ls_DescriptionValue = loo_JResp.StringOf("fields.Description.value")
ls_FaxDisplayValue = loo_JResp.StringOf("fields.Fax.displayValue")
ls_FaxValue = loo_JResp.StringOf("fields.Fax.value")
ls_IndustryDisplayValue = loo_JResp.StringOf("fields.Industry.displayValue")
ls_IndustryValue = loo_JResp.StringOf("fields.Industry.value")
ls_LastModifiedByDisplayValue = loo_JResp.StringOf("fields.LastModifiedBy.displayValue")
ls_ValueApiName = loo_JResp.StringOf("fields.LastModifiedBy.value.apiName")
ls_ValueETag = loo_JResp.StringOf("fields.LastModifiedBy.value.eTag")
ls_IdDisplayValue = loo_JResp.StringOf("fields.LastModifiedBy.value.fields.Id.displayValue")
ls_IdValue = loo_JResp.StringOf("fields.LastModifiedBy.value.fields.Id.value")
ls_NameDisplayValue = loo_JResp.StringOf("fields.LastModifiedBy.value.fields.Name.displayValue")
ls_NameValue = loo_JResp.StringOf("fields.LastModifiedBy.value.fields.Name.value")
ls_ValueId = loo_JResp.StringOf("fields.LastModifiedBy.value.id")
ls_ValueLastModifiedById = loo_JResp.StringOf("fields.LastModifiedBy.value.lastModifiedById")
ls_ValueLastModifiedDate = loo_JResp.StringOf("fields.LastModifiedBy.value.lastModifiedDate")
ls_ValueRecordTypeId = loo_JResp.StringOf("fields.LastModifiedBy.value.recordTypeId")
ls_ValueRecordTypeInfo = loo_JResp.StringOf("fields.LastModifiedBy.value.recordTypeInfo")
ls_ValueSystemModstamp = loo_JResp.StringOf("fields.LastModifiedBy.value.systemModstamp")
li_ValueWeakEtag = loo_JResp.IntOf("fields.LastModifiedBy.value.weakEtag")
ls_LastModifiedByIdDisplayValue = loo_JResp.StringOf("fields.LastModifiedById.displayValue")
ls_LastModifiedByIdValue = loo_JResp.StringOf("fields.LastModifiedById.value")
ls_LastModifiedDateDisplayValue = loo_JResp.StringOf("fields.LastModifiedDate.displayValue")
ls_LastModifiedDateValue = loo_JResp.StringOf("fields.LastModifiedDate.value")
ls_NameDisplayValue = loo_JResp.StringOf("fields.Name.displayValue")
ls_NameValue = loo_JResp.StringOf("fields.Name.value")
ls_NumberOfEmployeesDisplayValue = loo_JResp.StringOf("fields.NumberOfEmployees.displayValue")
ls_NumberOfEmployeesValue = loo_JResp.StringOf("fields.NumberOfEmployees.value")
ls_NumberofLocations__cDisplayValue = loo_JResp.StringOf("fields.NumberofLocations__c.displayValue")
ls_NumberofLocations__cValue = loo_JResp.StringOf("fields.NumberofLocations__c.value")
ls_OwnerDisplayValue = loo_JResp.StringOf("fields.Owner.displayValue")
ls_ValueApiName = loo_JResp.StringOf("fields.Owner.value.apiName")
ls_ValueETag = loo_JResp.StringOf("fields.Owner.value.eTag")
ls_IdDisplayValue = loo_JResp.StringOf("fields.Owner.value.fields.Id.displayValue")
ls_IdValue = loo_JResp.StringOf("fields.Owner.value.fields.Id.value")
ls_NameDisplayValue = loo_JResp.StringOf("fields.Owner.value.fields.Name.displayValue")
ls_NameValue = loo_JResp.StringOf("fields.Owner.value.fields.Name.value")
ls_ValueId = loo_JResp.StringOf("fields.Owner.value.id")
ls_ValueLastModifiedById = loo_JResp.StringOf("fields.Owner.value.lastModifiedById")
ls_ValueLastModifiedDate = loo_JResp.StringOf("fields.Owner.value.lastModifiedDate")
ls_ValueRecordTypeId = loo_JResp.StringOf("fields.Owner.value.recordTypeId")
ls_ValueRecordTypeInfo = loo_JResp.StringOf("fields.Owner.value.recordTypeInfo")
ls_ValueSystemModstamp = loo_JResp.StringOf("fields.Owner.value.systemModstamp")
li_ValueWeakEtag = loo_JResp.IntOf("fields.Owner.value.weakEtag")
ls_OwnerIdDisplayValue = loo_JResp.StringOf("fields.OwnerId.displayValue")
ls_OwnerIdValue = loo_JResp.StringOf("fields.OwnerId.value")
ls_OwnershipDisplayValue = loo_JResp.StringOf("fields.Ownership.displayValue")
ls_OwnershipValue = loo_JResp.StringOf("fields.Ownership.value")
ls_ParentDisplayValue = loo_JResp.StringOf("fields.Parent.displayValue")
ls_ParentValue = loo_JResp.StringOf("fields.Parent.value")
ls_ParentIdDisplayValue = loo_JResp.StringOf("fields.ParentId.displayValue")
ls_ParentIdValue = loo_JResp.StringOf("fields.ParentId.value")
ls_PhoneDisplayValue = loo_JResp.StringOf("fields.Phone.displayValue")
ls_PhoneValue = loo_JResp.StringOf("fields.Phone.value")
ls_RatingDisplayValue = loo_JResp.StringOf("fields.Rating.displayValue")
ls_RatingValue = loo_JResp.StringOf("fields.Rating.value")
ls_SLAExpirationDate__cDisplayValue = loo_JResp.StringOf("fields.SLAExpirationDate__c.displayValue")
ls_SLAExpirationDate__cValue = loo_JResp.StringOf("fields.SLAExpirationDate__c.value")
ls_SLASerialNumber__cDisplayValue = loo_JResp.StringOf("fields.SLASerialNumber__c.displayValue")
ls_SLASerialNumber__cValue = loo_JResp.StringOf("fields.SLASerialNumber__c.value")
ls_SLA__cDisplayValue = loo_JResp.StringOf("fields.SLA__c.displayValue")
ls_SLA__cValue = loo_JResp.StringOf("fields.SLA__c.value")
ls_ShippingCityDisplayValue = loo_JResp.StringOf("fields.ShippingCity.displayValue")
ls_ShippingCityValue = loo_JResp.StringOf("fields.ShippingCity.value")
ls_ShippingCountryDisplayValue = loo_JResp.StringOf("fields.ShippingCountry.displayValue")
ls_ShippingCountryValue = loo_JResp.StringOf("fields.ShippingCountry.value")
ls_ShippingPostalCodeDisplayValue = loo_JResp.StringOf("fields.ShippingPostalCode.displayValue")
ls_ShippingPostalCodeValue = loo_JResp.StringOf("fields.ShippingPostalCode.value")
ls_ShippingStateDisplayValue = loo_JResp.StringOf("fields.ShippingState.displayValue")
ls_ShippingStateValue = loo_JResp.StringOf("fields.ShippingState.value")
ls_ShippingStreetDisplayValue = loo_JResp.StringOf("fields.ShippingStreet.displayValue")
ls_ShippingStreetValue = loo_JResp.StringOf("fields.ShippingStreet.value")
ls_SicDisplayValue = loo_JResp.StringOf("fields.Sic.displayValue")
ls_SicValue = loo_JResp.StringOf("fields.Sic.value")
ls_SiteDisplayValue = loo_JResp.StringOf("fields.Site.displayValue")
ls_SiteValue = loo_JResp.StringOf("fields.Site.value")
ls_TickerSymbolDisplayValue = loo_JResp.StringOf("fields.TickerSymbol.displayValue")
ls_TickerSymbolValue = loo_JResp.StringOf("fields.TickerSymbol.value")
ls_TypeDisplayValue = loo_JResp.StringOf("fields.Type.displayValue")
ls_TypeValue = loo_JResp.StringOf("fields.Type.value")
ls_UpsellOpportunity__cDisplayValue = loo_JResp.StringOf("fields.UpsellOpportunity__c.displayValue")
ls_UpsellOpportunity__cValue = loo_JResp.StringOf("fields.UpsellOpportunity__c.value")
ls_WebsiteDisplayValue = loo_JResp.StringOf("fields.Website.displayValue")
ls_WebsiteValue = loo_JResp.StringOf("fields.Website.value")
ls_Id = loo_JResp.StringOf("id")
ls_LastModifiedById = loo_JResp.StringOf("lastModifiedById")
ls_LastModifiedDate = loo_JResp.StringOf("lastModifiedDate")
ls_RecordTypeId = loo_JResp.StringOf("recordTypeId")
ls_RecordTypeInfo = loo_JResp.StringOf("recordTypeInfo")
ls_SystemModstamp = loo_JResp.StringOf("systemModstamp")
li_WeakEtag = loo_JResp.IntOf("weakEtag")
destroy loo_Http
destroy loo_Json
destroy loo_SbRequestBody
destroy loo_SbResponseBody
destroy loo_JResp
Curl Command
curl -X PATCH
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
-d '{
"allowSaveOnDuplicate": false,
"fields": {
"FieldAPIName": "FieldValue"
}
}'
https://domain.com/services/data/v{{version}}/ui-api/records/:RECORD_ID
Postman Collection Item JSON
{
"name": "Update a Record",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"allowSaveOnDuplicate\": false,\n \"fields\": {\n \"FieldAPIName\": \"FieldValue\"\n }\n}"
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/ui-api/records/:RECORD_ID",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"ui-api",
"records",
":RECORD_ID"
],
"variable": [
{
"key": "RECORD_ID",
"value": "",
"description": "Record ID"
}
]
},
"description": "Update a record's data.\nUser Interface API enforces Salesforce validation rules. If a validation rule fails, the response is an Error with Output.\n\nWhen you make a PATCH request to update a record, make sure that the record hasn’t changed since the user started editing it. To find out whether it’s safe to save a record, pass the If-Modified-Since HTTP header in the request.\n\nAs of API version 43.0, if you pass read-only fields in a request body, the response is an Error with Output."
},
"response": [
{
"name": "Update a Record",
"originalRequest": {
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"allowSaveOnDuplicate\": false,\n \"fields\": {\n \"Name\": \"My Renamed Account\"\n }\n}"
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/ui-api/records/:RECORD_ID",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"ui-api",
"records",
":RECORD_ID"
],
"variable": [
{
"key": "RECORD_ID",
"value": "0011Q00002Z2P5jQAF",
"description": "Record ID"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Date",
"value": "Wed, 27 Sep 2023 16:04:41 GMT"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000; includeSubDomains"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "X-Robots-Tag",
"value": "none"
},
{
"key": "Cache-Control",
"value": "no-cache,must-revalidate,max-age=0,no-store,private"
},
{
"key": "ETag",
"value": "\"1be6f040e46732e79a0999d6fea9fe7d\""
},
{
"key": "Content-Type",
"value": "application/json;charset=UTF-8"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
}
],
"cookie": [
],
"body": "{\n \"apiName\": \"Account\",\n \"childRelationships\": {},\n \"eTag\": \"1be6f040e46732e79a0999d6fea9fe7d\",\n \"fields\": {\n \"AccountNumber\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Active__c\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"AnnualRevenue\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"BillingCity\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"BillingCountry\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"BillingPostalCode\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"BillingState\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"BillingStreet\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"CreatedBy\": {\n \"displayValue\": \"Philippe Ozil\",\n \"value\": {\n \"apiName\": \"User\",\n \"childRelationships\": {},\n \"eTag\": \"cc07f7ef1b08ddbd75074c69512dd388\",\n \"fields\": {\n \"Id\": {\n \"displayValue\": null,\n \"value\": \"005B0000003TOI6IAO\"\n },\n \"Name\": {\n \"displayValue\": null,\n \"value\": \"Philippe Ozil\"\n }\n },\n \"id\": \"005B0000003TOI6IAO\",\n \"lastModifiedById\": \"005B0000003TOI6IAO\",\n \"lastModifiedDate\": \"2023-02-02T10:32:12.000Z\",\n \"recordTypeId\": null,\n \"recordTypeInfo\": null,\n \"systemModstamp\": \"2023-09-27T15:47:51.000Z\",\n \"weakEtag\": 1695829671000\n }\n },\n \"CreatedById\": {\n \"displayValue\": null,\n \"value\": \"005B0000003TOI6IAO\"\n },\n \"CreatedDate\": {\n \"displayValue\": \"27/09/2023 18:01\",\n \"value\": \"2023-09-27T16:01:14.000Z\"\n },\n \"CustomerPriority__c\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Description\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Fax\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Industry\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"LastModifiedBy\": {\n \"displayValue\": \"Philippe Ozil\",\n \"value\": {\n \"apiName\": \"User\",\n \"childRelationships\": {},\n \"eTag\": \"cc07f7ef1b08ddbd75074c69512dd388\",\n \"fields\": {\n \"Id\": {\n \"displayValue\": null,\n \"value\": \"005B0000003TOI6IAO\"\n },\n \"Name\": {\n \"displayValue\": null,\n \"value\": \"Philippe Ozil\"\n }\n },\n \"id\": \"005B0000003TOI6IAO\",\n \"lastModifiedById\": \"005B0000003TOI6IAO\",\n \"lastModifiedDate\": \"2023-02-02T10:32:12.000Z\",\n \"recordTypeId\": null,\n \"recordTypeInfo\": null,\n \"systemModstamp\": \"2023-09-27T15:47:51.000Z\",\n \"weakEtag\": 1695829671000\n }\n },\n \"LastModifiedById\": {\n \"displayValue\": null,\n \"value\": \"005B0000003TOI6IAO\"\n },\n \"LastModifiedDate\": {\n \"displayValue\": \"27/09/2023 18:04\",\n \"value\": \"2023-09-27T16:04:41.000Z\"\n },\n \"Name\": {\n \"displayValue\": null,\n \"value\": \"My Renamed Account\"\n },\n \"NumberOfEmployees\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"NumberofLocations__c\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Owner\": {\n \"displayValue\": \"Philippe Ozil\",\n \"value\": {\n \"apiName\": \"User\",\n \"childRelationships\": {},\n \"eTag\": \"cc07f7ef1b08ddbd75074c69512dd388\",\n \"fields\": {\n \"Id\": {\n \"displayValue\": null,\n \"value\": \"005B0000003TOI6IAO\"\n },\n \"Name\": {\n \"displayValue\": null,\n \"value\": \"Philippe Ozil\"\n }\n },\n \"id\": \"005B0000003TOI6IAO\",\n \"lastModifiedById\": \"005B0000003TOI6IAO\",\n \"lastModifiedDate\": \"2023-02-02T10:32:12.000Z\",\n \"recordTypeId\": null,\n \"recordTypeInfo\": null,\n \"systemModstamp\": \"2023-09-27T15:47:51.000Z\",\n \"weakEtag\": 1695829671000\n }\n },\n \"OwnerId\": {\n \"displayValue\": null,\n \"value\": \"005B0000003TOI6IAO\"\n },\n \"Ownership\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Parent\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"ParentId\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Phone\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Rating\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"SLAExpirationDate__c\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"SLASerialNumber__c\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"SLA__c\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"ShippingCity\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"ShippingCountry\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"ShippingPostalCode\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"ShippingState\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"ShippingStreet\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Sic\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Site\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"TickerSymbol\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Type\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"UpsellOpportunity__c\": {\n \"displayValue\": null,\n \"value\": null\n },\n \"Website\": {\n \"displayValue\": null,\n \"value\": null\n }\n },\n \"id\": \"0011Q00002Z2P5jQAF\",\n \"lastModifiedById\": \"005B0000003TOI6IAO\",\n \"lastModifiedDate\": \"2023-09-27T16:04:41.000Z\",\n \"recordTypeId\": \"012000000000000AAA\",\n \"recordTypeInfo\": null,\n \"systemModstamp\": \"2023-09-27T16:04:41.000Z\",\n \"weakEtag\": 1695830681000\n}"
}
]
}