Skip to content

Instantly share code, notes, and snippets.

View dschach's full-sized avatar

David Schach dschach

View GitHub Profile
@dschach
dschach / CustomMetadataClient classes
Last active February 15, 2024 17:02
Apex class and test class for CustomMetadataClient synchronous update/deletes
/**
* @author https://www.tostring.co.uk/custom-metadata-webservice-client
* @group Configuration
*/
@SuppressWarnings('PMD.ApexDoc,PMD.FieldNamingConventions,PMD.LocalVariableNamingConventions,PMD.ClassNamingConventions,PMD.ExcessiveParameterList')
public inherited sharing class CustomMetadataClient {
static public Database.UpsertResult upsertMetadata(SObjectType objectType, Map<SObjectField, Object> record) {
return upsertMetadata(objectType, new List<Map<SObjectField, Object>>{ record })[0];
}
@dschach
dschach / geocontact.page
Created October 9, 2012 16:29 — forked from joshbirk/geocontact.page
Geolocation
<apex:page StandardController="Contact" showHeader="true" sidebar="false">
<script>
var pos = {};
function success(position) {
pos = position.coords;
console.log(pos);
}
function error(msg) {