Skip to content

Instantly share code, notes, and snippets.

Avatar

Gorav Seth goravseth

View GitHub Profile
@goravseth
goravseth / Screensteps API External Service Definition - Beta2
Last active Aug 7, 2020
external service definition to pull in screensteps articles to flow. can search title, tags, text, and can pass site ID as a parameter.
View Screensteps API External Service Definition - Beta2
{
"swagger": "2.0",
"info": {
"description": "defaultDescription",
"version": "0.1",
"title": "defaultTitle"
},
"paths": {
"/{site}/search": {
"get": {
View License_Upgrade
global class License_Upgrade implements Database.Batchable<sObject> {
global Database.QueryLocator start(Database.BatchableContext BC){
// Query all active users with Profile : 'Base Programs'
String query ='Select UsersId,Users.ProfileId,Users.UserPermissionsMarketingUser,Users.Name, LastModifiedDate,LoginType,createddate,SessionType From AuthSession Where LoginType = \'Application\' and SessionType = \'UI\' and createddate = today and lastmodifieddate = today Order by lastmodifieddate';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<AuthSession> AuthSesuserLst){
Profile p = [SELECT Id, Name FROM Profile WHERE Name= 'Base Programs' LIMIT 1];
@goravseth
goravseth / Screensteps API Response w Links
Last active Aug 4, 2020
sample api response from screensteps - used to create external service definition via swagger inspector
View Screensteps API Response w Links
@goravseth
goravseth / ExternalService_2
Last active May 29, 2020
adding response schema
View ExternalService_2
{
"swagger": "2.0",
"info": {
"title": "Sample API",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"paths": {
"/": {
"post": {
View flow text template
// must be plain text, not rich text.
// ff user id is formula field to pull $user.Id, you can pass any id
{"id" : "{!ffUserID}"}
View request body json schema
{
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
}
View external service
{
"swagger": "2.0",
"info": {
"title": "Sample API",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"paths": {
"/": {
"post": {
View Compromised User or Davice SOP
Compromised User / Davice SOP
Freeze user
Notify techsupport (to freeze active directory account)
Revoke activations (setup - security controls - activations). note that both login IPs and activated browsers need to be revoked.
Revoke all oAuth connections (user detail - oAuth connected apps)
Revoke Third Party Account Links (ensures they need to reauthorize for SSO)
Review login history for any anomalies
If there are no anomalies
Add two factor authentication to user profile (permission set - system : two factor authentication required)
View chatterGroupPublisherDemo
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
<forceChatter:publisher context="RECORD" recordId="0F94F0000008QLySAM" />
<forceChatter:feed type="Record" subjectId="0F94F0000008QLySAM" feedDesign="DEFAULT"/>
</aura:component>
@goravseth
goravseth / findDupes
Created Oct 25, 2017
invocable apex to find duplicate contacts using the new findDuplicates apex stuff
View findDupes
public class Flow_FindDupes {
//https://developer.salesforce.com/forums/?id=906F0000000AzDeIAK
@InvocableMethod(label='Get Dupes' description='Returns something')
public static List<Contact> getDuplicateContacts(List<Contact> contacts) {
system.debug('contacts size = ' + contacts.size());
list<sObject> dasContacts = new list<sobject>();
dasContacts.addall((List<sObject>)(contacts));
list<Contact> duplicateContacts = new list<Contact>();