• Saranyan V Narayanan
  • 0 Points
  • Member since 2017
  • Architect
  • Wilcosource

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 6

Hello friends. A very beginner question on Platform Events. My org is using Process Builder to send Platform Events that are being consumed by another system. 

The developers of that system are now asking if we can include deletes. Process Builder cannot do that. My first idea is to write a before trigger on the object that would create a new platform event of the same type but with new a field that would indicate the event as 'DELETE'.  However, I don't know if using the Streaming API is the better way to go because I have no experience with that. 


So, just looking for a little advice from someone that has that experience. Thanks!

I am trying to create a related list button with default values with sforce.one, however when I try to click Save button I am getting this error "Review the errors on this page". But no errors listed, and all the required fields have been filled properly.

VF Page:

<apex:page standardController="Opportunity" recordSetVar="opps"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <apex:includeScript value="/soap/ajax/28.0/connection.js"/> <apex:includeScript value="/soap/ajax/28.0/apex.js"/> <script type="text/javascript"> sforce.connection.sessionId = "{!$Api.Session_ID}"; $( window ).ready(function() { createOpportunity(); }); var recordId = '{!$CurrentPage.parameters.Id}'; var OBJECT_NAME_HERE ='Opportunity'; var RECORDTYPE_NAME_HERE ='Internship Seats'; var url ='/006/e?retURL=%2F&' try{ //Query the record type var RecordTypeIds = sforce.connection.query("SELECT Id FROM RecordType WHERE SObjectType='" + OBJECT_NAME_HERE + "' AND Name='" + RECORDTYPE_NAME_HERE + "' LIMIT 1"); var rtTypes= RecordTypeIds.getArray("records"); var RecordTypeId = rtTypes[0].Id; //Query the parent record var cons = sforce.connection.query("SELECT Id,Name FROM Account WHERE Id = '" + recordId + "'"); var stats= cons.getArray("records"); //Internship Seats Opportunity url +='RecordType='+RecordTypeId; url +='&CF00N50000001oGFd='+stats[0].Name; url +='&CF00N50000001oGFd_lkid='+stats[0].Id; url +='&opp11=Open'; //Default values var defaultValues = { 'AccountId':stats[0].Id, 'Corporate_Account__c' : stats[0].Id, 'StageName':'Open', 'retURL':'/006', 'nooverride':'1' } } catch(e){ alert('An Error has Occured. Error:' +e); } function createOpportunity(){ if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) { sforce.one.createRecord('Opportunity',RecordTypeId,defaultValues); }else{ window.location='{!URLFOR($Action.Opportunity.New, null, [RecordType='+RecordTypeId+',save=1], true)}'; } } </script> </apex:page>

User-added image
  • December 18, 2017
  • Like
  • 0
I have a lightning component that implements lightning:actionOverride how do I get the recordId of the parent when the action is triggered from a related list?