Skip to content

Instantly share code, notes, and snippets.

View msrivastav13's full-sized avatar
🎯
Focusing

Mohith Shrivastava msrivastav13

🎯
Focusing
View GitHub Profile
@msrivastav13
msrivastav13 / AgentAIInvoker.cls
Last active March 17, 2025 13:53
Sample code that shows how to invoke an Agentforce Agent from Apex
public with sharing class AgentAIInvoker {
public static void invokeAIAgent() {
try {
// Create an instance of the invocable action with type 'generateAiAgentResponse' and name 'Agentforce_Service_Agent_new'
Invocable.Action action = Invocable.Action.createCustomAction(
'generateAiAgentResponse',
'Agentforce_Service_Agent_new'
);
action.setInvocationParameter('userMessage', 'Summarize my case');
@msrivastav13
msrivastav13 / Resources for Implementing Agentforce Service Agents.md
Last active January 4, 2025 22:27
Resources for Implementing Agentforce Service Agents

Resources for Setting Agentforce Service Agents

Below are key resources and a recorded video link to guide you through the implementation process,
from setup to advanced customization.


Recorded Video Session

Watch the recordings of the live-stream for a comprehensive walkthrough:

@msrivastav13
msrivastav13 / Boost Your Developer Productivity with Modern Tools.md
Last active July 17, 2024 14:34
Boost Your Developer Productivity with Modern Tools

Code Builder

Sign up for a Salesforce org

  1. Follow the instructions of your instructor to get a Salesforce org provisioned with Code Builder.

  2. Make sure you write down your user id and password. You'll need them again later in this workshop.

  3. In your browser, go to login.salesforce.com and log in to your org.

Getting Started with Salesforce CLI

Overview

This tutorial will guide you through the process of installing Salesforce CLI, authenticating to a Salesforce Org, creating a Salesforce project, connecting your development org to the project, retrieving metadata, and deploying metadata from your local machine to the Salesforce org.

What Developers Will Do

  1. Install Salesforce CLI (Skip if using Code Builder)
  2. Authenticate to Salesforce Org via CLI
@msrivastav13
msrivastav13 / salesforce_prompt_builder_pocket_guide_for_apex_developers.md
Last active March 1, 2025 17:07
codeLive: A Deep Dive into Apex for Prompt Builder

What is Prompt Builder?

Prompt Builder from Salesforce is a powerful tool that enables organizations to add generative AI capabilities to their business application. It allows organizations to create and manage prompt templates.

What is Prompt Builder?

Prompts

Sets of questions or instructions provided to a large language model to generate relevant content. To learn more complete the trailhead module below

@msrivastav13
msrivastav13 / SavePointReleaseCalloutExample.cls
Last active February 2, 2024 03:52
Example to show the callout after DML rollback in Apex with new Database.releaseSavepoint
// This class works if your class -meta.xml is of 60.0 version
public with sharing class SavePointReleaseCalloutExample {
public void basicAuthCallout() {
// Do a DML before callout
Savepoint sp = Database.setSavepoint();
Account acc = new Account();
acc.Name = 'Test';
@msrivastav13
msrivastav13 / csvtojson.js
Created December 28, 2023 17:35
Converts SnowFakery generated test data to the JSON format for loading via Salesforce CLI
import csvtojson from 'csvtojson';
import fs from 'fs/promises';
// Define a reusable function for converting CSV to JSON
const convertCsvToJson = async (
csvFilePath,
jsonFilePath,
objectType,
idPrefix = ''
) => {
@msrivastav13
msrivastav13 / manifest.YAML
Created November 23, 2021 22:51
Sample manifest for slack app
_metadata:
major_version: 1
minor_version: 1
display_information:
name: Salesforce Slack Starter App
features:
bot_user:
display_name: Salesforce Slack Starter App
always_online: true
shortcuts:
@msrivastav13
msrivastav13 / tasks.json
Created July 15, 2021 04:01
Changeset in Salesforce
{
"version": "2.0.0",
"tasks": [
{
"label": "Retrieve From ChangeSet",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:retrieve",
"-n",
@msrivastav13
msrivastav13 / tasks.json
Created July 15, 2021 03:20
EasySpaces Task for Setting up scratch org
{
"version": "2.0.0",
"tasks": [
{
"label": "Create Scratch org",
"type": "shell",
"command": "sfdx",
"args": [
"force:org:create",
"-s",