SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Custom Event Handling with
Visualforce
Opportunity Contact Roles
Ritesh Aswaney, Technical Solution Architect, salesforce.com
@techtrekker
Safe harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any
litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our
relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our
service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to
larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is
included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent
fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor
Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions
based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these
forward-looking statements.
Ritesh Aswaney
Technical Solution Architect
@techtrekker
About : me
Technical Solution Architect
§  Salesforce Services
•  Based in London
•  Certified Advanced Developer
•  On the Road to CTA
§  Experience
•  10 years of Enterprise Software
•  4 years of working on the Force.com Platform
•  StackExchange junkie
Second among equals
Object Types
§  ‘First Class’ Objects
•  Triggers, Workflow
•  Custom Fields
§  Non ‘First Class’ Objects
•  No Triggers or Workflow
•  ‘Junction’ Objects
•  No Custom Fields
Business Need
Junction Objects model real world business relationships, hotbed
of custom business logic
§  Opportunity / Account Contact Role
•  Sales Team need to know if Business Decision Maker Changes
•  Downstream Systems notified of changes in OCR
§  Account Team
•  Custom Business Logic when people are added to Account Teams
Solution Option 1: Custom Junction Object
§  Lose OOTB functionality such as sharing with teams
§  Triggers, Workflow can be created
§  Custom Fields can be added
§  Overhead of keeping (Custom & Standard Object) records in sync
Solution Option 2: Custom Visualforce Section
§  Retain OOTB functionality
§  ‘Touch’ Parent Object and update custom field
§  Multiplex Triggers, Wokflows to cater for Junction Objects
§  Integration Hooks to trigger Outbound Messages to External Systems
Meet the Paramters
§  saveURL
•  Redirect to this URL when a user hits Save
§  retURL
•  Redirect to this URL when a user hits Cancel
§  https://cs1.salesforce.com/02Z/e?retURL=
%2FRECORD_ID&saveURL=/apex/VF_PAGE_NAME
Solution Design : How does it flow
Demo
Solution Elements : URL Decoration
$j( 'input[type="button"]', this ).each(function()
$j( this ).attr('onclick', "window.parent.location=" + onclicklink +
"&saveURL=/apex/SavePage?actionURI={!objId}_" + rlName + "';");!
});!
!
$j( 'a.actionLink', this ).each(function() {!
onClickUrl += '&saveURL=/apex/SavePage?actionURI={!objId}_'+ rlName;!
$j( this ).attr('onclick', "window.parent.location='" + onClickUrl +
"'" ); });!
!
Solution Elements : Save Handler
String[] tokens = actionURI.split('_');!
Id entityId = tokens[0];!
String relatedList = tokens[1];!
!
if(entityId.getSObjectType() == Opportunity.sObjectType){!
! !if(relatedList == 'Contact Roles')!
handleOpportunityContactRole(entityId); //callback!
else if(relatedList == 'Opportunity Team')!
handleOpportunityTeam(entityId); //callback!
!
}!
Solution Element: Visualforce Event Handler Page
§  Invoking Apex Code (Controller) on Page Load
§  Use action attribute
<apex:page action="{!handleOnLoad}"
controller="SavePageCon”>
Solution Elements : Dynamic Visualforce Controller
if(objId.getSObjectType() == Opportunity.sObjectType)!
!Schema.DescribeSObjectResult R =!
!Opportunity.SObjectType.getDescribe();!
!
List<Schema.ChildRelationship> C = R.getChildRelationships(); !
List<String> relations = new List<String>();!
! ! for (Schema.ChildRelationship cr: C) {//only some relationships!
! ! !if ( (cr.getRelationshipName().contains('Role’) ) !
relations.add(relName);!
! ! }!
Solution Elements : Dynamic Visualforce Controller
public Component.Apex.OutputPanel getOpportunityRelatedLists() {!
!Component.Apex.OutputPanel dynOutPanel= new
!Component.Apex.OutputPanel();!
for(String rel: relations) {!
Component.Apex.RelatedList dynRelList = new
! ! ! !Component.Apex.RelatedList();!
dynRelList.list = rel;!
dynOutPanel.childComponents.add(dynRelList);!
}!
return dynOutPanel; !
!}!
Solution Element: Dynamic Visualforce Page
§  Visualforce Markup generated dynamically in the Controller
§  Dynamic generation of custom related lists based on the relationship
<apex:dynamicComponent componentValue="{!
OpportunityRelatedLists}"/>!
!
!
Ritesh Aswaney
Technical Solution Architect,
@techtrekker
Visualforce Hack for Junction Objects

Mais conteúdo relacionado

Mais procurados

Build custom user interfaces for your Salesforce data with the UI API
 Build custom user interfaces for your Salesforce data with the UI API Build custom user interfaces for your Salesforce data with the UI API
Build custom user interfaces for your Salesforce data with the UI APISalesforce Developers
 
Building Complex Traversing & Branching Apps Using Visual Workflows and Apex
Building Complex Traversing & Branching Apps Using Visual Workflows and ApexBuilding Complex Traversing & Branching Apps Using Visual Workflows and Apex
Building Complex Traversing & Branching Apps Using Visual Workflows and ApexSalesforce Developers
 
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with SalesforceLightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with SalesforceSalesforce Developers
 
Javascript Security and Lightning Locker Service
Javascript Security and Lightning Locker ServiceJavascript Security and Lightning Locker Service
Javascript Security and Lightning Locker ServiceSalesforce Developers
 
Build Smarter Apps with Einstein Platform Services
Build Smarter Apps with Einstein Platform ServicesBuild Smarter Apps with Einstein Platform Services
Build Smarter Apps with Einstein Platform ServicesSalesforce Developers
 
Build Smarter Apps with Einstein Object Detection
Build Smarter Apps with Einstein Object DetectionBuild Smarter Apps with Einstein Object Detection
Build Smarter Apps with Einstein Object DetectionSalesforce Developers
 
#DF17Recap series: Integrate apps easier with the Salesforce platform
#DF17Recap series: Integrate apps easier with the Salesforce platform#DF17Recap series: Integrate apps easier with the Salesforce platform
#DF17Recap series: Integrate apps easier with the Salesforce platformSalesforce Developers
 
#Df17 Recap Series Build Apps Faster with the Salesforce Platform
#Df17 Recap Series Build Apps Faster with the Salesforce Platform #Df17 Recap Series Build Apps Faster with the Salesforce Platform
#Df17 Recap Series Build Apps Faster with the Salesforce Platform Salesforce Developers
 
Lightning Updates: Summer, Winter & Beyond
Lightning Updates: Summer, Winter & BeyondLightning Updates: Summer, Winter & Beyond
Lightning Updates: Summer, Winter & BeyondSalesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentSalesforce Developers
 
Lightning customization with lightning app builder
Lightning customization with lightning app builderLightning customization with lightning app builder
Lightning customization with lightning app builderSalesforce Developers
 
Lightning Developer Experience, Eclipse IDE Evolved
Lightning Developer Experience, Eclipse IDE EvolvedLightning Developer Experience, Eclipse IDE Evolved
Lightning Developer Experience, Eclipse IDE EvolvedSalesforce Developers
 
SalesforceDX Demo by Manish
SalesforceDX Demo by ManishSalesforceDX Demo by Manish
SalesforceDX Demo by ManishManish Thaduri
 
Embed Customer Support into your Apps with Snap-ins
Embed Customer Support into your Apps with Snap-insEmbed Customer Support into your Apps with Snap-ins
Embed Customer Support into your Apps with Snap-insSalesforce Developers
 
Build and Package Lightning Components for Lightning Exchange
Build and Package Lightning Components for Lightning ExchangeBuild and Package Lightning Components for Lightning Exchange
Build and Package Lightning Components for Lightning ExchangeSalesforce Developers
 
Easy No-Code Integrations with External Services and Visual Flow
Easy No-Code Integrations with External Services and Visual FlowEasy No-Code Integrations with External Services and Visual Flow
Easy No-Code Integrations with External Services and Visual FlowSalesforce Developers
 
Custom Metadata Data Types
Custom Metadata Data TypesCustom Metadata Data Types
Custom Metadata Data TypesSamuel Moyson
 
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe OzilQuit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe OzilCzechDreamin
 
A Developer's Guide to Visual Workflow
A Developer's Guide to Visual WorkflowA Developer's Guide to Visual Workflow
A Developer's Guide to Visual WorkflowSalesforce Developers
 

Mais procurados (20)

Build custom user interfaces for your Salesforce data with the UI API
 Build custom user interfaces for your Salesforce data with the UI API Build custom user interfaces for your Salesforce data with the UI API
Build custom user interfaces for your Salesforce data with the UI API
 
Building Complex Traversing & Branching Apps Using Visual Workflows and Apex
Building Complex Traversing & Branching Apps Using Visual Workflows and ApexBuilding Complex Traversing & Branching Apps Using Visual Workflows and Apex
Building Complex Traversing & Branching Apps Using Visual Workflows and Apex
 
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with SalesforceLightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
 
Einstein Analytics for Developers
Einstein Analytics for DevelopersEinstein Analytics for Developers
Einstein Analytics for Developers
 
Javascript Security and Lightning Locker Service
Javascript Security and Lightning Locker ServiceJavascript Security and Lightning Locker Service
Javascript Security and Lightning Locker Service
 
Build Smarter Apps with Einstein Platform Services
Build Smarter Apps with Einstein Platform ServicesBuild Smarter Apps with Einstein Platform Services
Build Smarter Apps with Einstein Platform Services
 
Build Smarter Apps with Einstein Object Detection
Build Smarter Apps with Einstein Object DetectionBuild Smarter Apps with Einstein Object Detection
Build Smarter Apps with Einstein Object Detection
 
#DF17Recap series: Integrate apps easier with the Salesforce platform
#DF17Recap series: Integrate apps easier with the Salesforce platform#DF17Recap series: Integrate apps easier with the Salesforce platform
#DF17Recap series: Integrate apps easier with the Salesforce platform
 
#Df17 Recap Series Build Apps Faster with the Salesforce Platform
#Df17 Recap Series Build Apps Faster with the Salesforce Platform #Df17 Recap Series Build Apps Faster with the Salesforce Platform
#Df17 Recap Series Build Apps Faster with the Salesforce Platform
 
Lightning Updates: Summer, Winter & Beyond
Lightning Updates: Summer, Winter & BeyondLightning Updates: Summer, Winter & Beyond
Lightning Updates: Summer, Winter & Beyond
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
Lightning customization with lightning app builder
Lightning customization with lightning app builderLightning customization with lightning app builder
Lightning customization with lightning app builder
 
Lightning Developer Experience, Eclipse IDE Evolved
Lightning Developer Experience, Eclipse IDE EvolvedLightning Developer Experience, Eclipse IDE Evolved
Lightning Developer Experience, Eclipse IDE Evolved
 
SalesforceDX Demo by Manish
SalesforceDX Demo by ManishSalesforceDX Demo by Manish
SalesforceDX Demo by Manish
 
Embed Customer Support into your Apps with Snap-ins
Embed Customer Support into your Apps with Snap-insEmbed Customer Support into your Apps with Snap-ins
Embed Customer Support into your Apps with Snap-ins
 
Build and Package Lightning Components for Lightning Exchange
Build and Package Lightning Components for Lightning ExchangeBuild and Package Lightning Components for Lightning Exchange
Build and Package Lightning Components for Lightning Exchange
 
Easy No-Code Integrations with External Services and Visual Flow
Easy No-Code Integrations with External Services and Visual FlowEasy No-Code Integrations with External Services and Visual Flow
Easy No-Code Integrations with External Services and Visual Flow
 
Custom Metadata Data Types
Custom Metadata Data TypesCustom Metadata Data Types
Custom Metadata Data Types
 
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe OzilQuit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
 
A Developer's Guide to Visual Workflow
A Developer's Guide to Visual WorkflowA Developer's Guide to Visual Workflow
A Developer's Guide to Visual Workflow
 

Semelhante a Visualforce Hack for Junction Objects

Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Mark Adcock
 
Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Salesforce Developers
 
How We Built AppExchange and our Communities on the App Cloud (Platform)
How We Built AppExchange and our Communities on the App Cloud (Platform)How We Built AppExchange and our Communities on the App Cloud (Platform)
How We Built AppExchange and our Communities on the App Cloud (Platform)Dreamforce
 
Elevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackElevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackCarolEnLaNube
 
Force.com Friday : Intro to Visualforce
Force.com Friday : Intro to VisualforceForce.com Friday : Intro to Visualforce
Force.com Friday : Intro to VisualforceSalesforce Developers
 
Force.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comForce.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comSalesforce Developers
 
Coding for Declarative Customizations: How We Do It in Salesforce.com IT
Coding for Declarative Customizations: How We Do It in Salesforce.com ITCoding for Declarative Customizations: How We Do It in Salesforce.com IT
Coding for Declarative Customizations: How We Do It in Salesforce.com ITSalesforce Developers
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsTour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsSalesforce Developers
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforceMark Adcock
 
Five Developer Tips Every Admin Needs To Know
Five Developer Tips Every Admin Needs To KnowFive Developer Tips Every Admin Needs To Know
Five Developer Tips Every Admin Needs To KnowSalesforce Developers
 
Knock! Knock! Who's There? Lightning Components!
Knock! Knock! Who's There? Lightning Components!Knock! Knock! Who's There? Lightning Components!
Knock! Knock! Who's There? Lightning Components!Salesforce Admins
 
Decluttering your Salesfroce org
Decluttering your Salesfroce orgDecluttering your Salesfroce org
Decluttering your Salesfroce orgRoy Gilad
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceSalesforce Developers
 
[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter Chittum[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter ChittumBeMyApp
 
Txd19 speaker session template v1
Txd19 speaker session template v1Txd19 speaker session template v1
Txd19 speaker session template v1rikkehovgaard
 
TrailheaDX Global Gathering London 2018
TrailheaDX Global Gathering London 2018TrailheaDX Global Gathering London 2018
TrailheaDX Global Gathering London 2018Keir Bowden
 

Semelhante a Visualforce Hack for Junction Objects (20)

Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex
 
Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17
 
Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17
 
How We Built AppExchange and our Communities on the App Cloud (Platform)
How We Built AppExchange and our Communities on the App Cloud (Platform)How We Built AppExchange and our Communities on the App Cloud (Platform)
How We Built AppExchange and our Communities on the App Cloud (Platform)
 
Elevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackElevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance Track
 
Force.com Friday : Intro to Visualforce
Force.com Friday : Intro to VisualforceForce.com Friday : Intro to Visualforce
Force.com Friday : Intro to Visualforce
 
Force.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comForce.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.com
 
Coding for Declarative Customizations: How We Do It in Salesforce.com IT
Coding for Declarative Customizations: How We Do It in Salesforce.com ITCoding for Declarative Customizations: How We Do It in Salesforce.com IT
Coding for Declarative Customizations: How We Do It in Salesforce.com IT
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsTour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration Methods
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
 
Five Developer Tips Every Admin Needs To Know
Five Developer Tips Every Admin Needs To KnowFive Developer Tips Every Admin Needs To Know
Five Developer Tips Every Admin Needs To Know
 
Knock! Knock! Who's There? Lightning Components!
Knock! Knock! Who's There? Lightning Components!Knock! Knock! Who's There? Lightning Components!
Knock! Knock! Who's There? Lightning Components!
 
Introduction to Force.com
Introduction to Force.comIntroduction to Force.com
Introduction to Force.com
 
Decluttering your Salesfroce org
Decluttering your Salesfroce orgDecluttering your Salesfroce org
Decluttering your Salesfroce org
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter Chittum[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter Chittum
 
Force.com Friday - Intro to Visualforce
Force.com Friday - Intro to VisualforceForce.com Friday - Intro to Visualforce
Force.com Friday - Intro to Visualforce
 
Txd19 speaker session template v1
Txd19 speaker session template v1Txd19 speaker session template v1
Txd19 speaker session template v1
 
TrailheaDX Global Gathering London 2018
TrailheaDX Global Gathering London 2018TrailheaDX Global Gathering London 2018
TrailheaDX Global Gathering London 2018
 

Último

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Último (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

Visualforce Hack for Junction Objects

  • 1. Custom Event Handling with Visualforce Opportunity Contact Roles Ritesh Aswaney, Technical Solution Architect, salesforce.com @techtrekker
  • 2. Safe harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
  • 3. Ritesh Aswaney Technical Solution Architect @techtrekker
  • 4. About : me Technical Solution Architect §  Salesforce Services •  Based in London •  Certified Advanced Developer •  On the Road to CTA §  Experience •  10 years of Enterprise Software •  4 years of working on the Force.com Platform •  StackExchange junkie
  • 5. Second among equals Object Types §  ‘First Class’ Objects •  Triggers, Workflow •  Custom Fields §  Non ‘First Class’ Objects •  No Triggers or Workflow •  ‘Junction’ Objects •  No Custom Fields
  • 6. Business Need Junction Objects model real world business relationships, hotbed of custom business logic §  Opportunity / Account Contact Role •  Sales Team need to know if Business Decision Maker Changes •  Downstream Systems notified of changes in OCR §  Account Team •  Custom Business Logic when people are added to Account Teams
  • 7. Solution Option 1: Custom Junction Object §  Lose OOTB functionality such as sharing with teams §  Triggers, Workflow can be created §  Custom Fields can be added §  Overhead of keeping (Custom & Standard Object) records in sync
  • 8. Solution Option 2: Custom Visualforce Section §  Retain OOTB functionality §  ‘Touch’ Parent Object and update custom field §  Multiplex Triggers, Wokflows to cater for Junction Objects §  Integration Hooks to trigger Outbound Messages to External Systems
  • 9. Meet the Paramters §  saveURL •  Redirect to this URL when a user hits Save §  retURL •  Redirect to this URL when a user hits Cancel §  https://cs1.salesforce.com/02Z/e?retURL= %2FRECORD_ID&saveURL=/apex/VF_PAGE_NAME
  • 10. Solution Design : How does it flow
  • 11. Demo
  • 12. Solution Elements : URL Decoration $j( 'input[type="button"]', this ).each(function() $j( this ).attr('onclick', "window.parent.location=" + onclicklink + "&saveURL=/apex/SavePage?actionURI={!objId}_" + rlName + "';");! });! ! $j( 'a.actionLink', this ).each(function() {! onClickUrl += '&saveURL=/apex/SavePage?actionURI={!objId}_'+ rlName;! $j( this ).attr('onclick', "window.parent.location='" + onClickUrl + "'" ); });! !
  • 13. Solution Elements : Save Handler String[] tokens = actionURI.split('_');! Id entityId = tokens[0];! String relatedList = tokens[1];! ! if(entityId.getSObjectType() == Opportunity.sObjectType){! ! !if(relatedList == 'Contact Roles')! handleOpportunityContactRole(entityId); //callback! else if(relatedList == 'Opportunity Team')! handleOpportunityTeam(entityId); //callback! ! }!
  • 14. Solution Element: Visualforce Event Handler Page §  Invoking Apex Code (Controller) on Page Load §  Use action attribute <apex:page action="{!handleOnLoad}" controller="SavePageCon”>
  • 15. Solution Elements : Dynamic Visualforce Controller if(objId.getSObjectType() == Opportunity.sObjectType)! !Schema.DescribeSObjectResult R =! !Opportunity.SObjectType.getDescribe();! ! List<Schema.ChildRelationship> C = R.getChildRelationships(); ! List<String> relations = new List<String>();! ! ! for (Schema.ChildRelationship cr: C) {//only some relationships! ! ! !if ( (cr.getRelationshipName().contains('Role’) ) ! relations.add(relName);! ! ! }!
  • 16. Solution Elements : Dynamic Visualforce Controller public Component.Apex.OutputPanel getOpportunityRelatedLists() {! !Component.Apex.OutputPanel dynOutPanel= new !Component.Apex.OutputPanel();! for(String rel: relations) {! Component.Apex.RelatedList dynRelList = new ! ! ! !Component.Apex.RelatedList();! dynRelList.list = rel;! dynOutPanel.childComponents.add(dynRelList);! }! return dynOutPanel; ! !}!
  • 17. Solution Element: Dynamic Visualforce Page §  Visualforce Markup generated dynamically in the Controller §  Dynamic generation of custom related lists based on the relationship <apex:dynamicComponent componentValue="{! OpportunityRelatedLists}"/>! ! !
  • 18. Ritesh Aswaney Technical Solution Architect, @techtrekker