• Fakeha Quazi
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies
I am trying to subscribe to a Platform event in force.com site page in visualforce page. I am using cometD to subscribe.Using below code. It works internally in org. But when using the page on site page session id is null, so, it is not working. Is there any way to subscribe to platform event and access it on site page? 
cometd.websocketEnabled = false;
                      var auth = 'OAuth ' + '{!$Api.Session_ID}';
                      var cometdURL = window.location.protocol+'//'+window.location.hostname+ (null != window.location.port ? (':'+window.location.port) : '') +'/cometd/48.0/';
                      
                      cometd.configure({
                          url: cometdURL,
                          requestHeaders: { Authorization: auth}
                      });

 
I am using $API.Session_Id in script in a VF page. I will be using this page for guest users. This {!$Api.session_id} returns some value. Is it a wrong way to get session id as this page will be used for site Guest users? Is it vulnerable?
<apex:page controller="ABCcntr"><script> var token={!$Api.Session_ID}</script> </apex:page>
I am using this example: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/code_sample_interactive_vfp_intro.htm . It is working in Sandbox but is not working Production. I have enabled streaming API from setup>user interface and making all setup and everything same as mentioned in the doc. But not working in production. Connection, handshake and subscribe is done successfully but it do not capture change. Please help, it is very urgent.
I want to add a link to make facetime video call in my visualforce page.
I tried adding anchor tage with facetime email address but does not work.
<a href="facetime:{!userFaceTimeEmail}" >video call</a>
I am using Metadata api to retrieve Flows metadata. I am using Andy' solution to call Metadata API through apex. But it has limitation that we can pass an array of Flows fullNames of size 10. 1 callout is reserverd to get all the the flows using ListMetadataQuery and rest 99 can be used further to retrieve metadata. So we can get maximum 990 flows data. As we can have 1000 Flows in an Org. So, if an org has 1000 Flows then this process fails. I am using below code. Is there any way to retrieve all 1000 Flows metadata in apex? 

/*------Retrieve all Flows and Process------*/
MetadataService.ListMetadataQuery mdQuery = new MetadataService.ListMetadataQuery();
mdQuery.type_x = 'Flow';
MetadataService.ListMetadataQuery[] mdqList = new MetadataService.ListMetadataQuery[] {};
mdqList.add(mdQuery);
Double mdVersion = 37.0;
MetadataService.FileProperties[] fpList = service.listMetadata(mdqList, mdVersion);
System.debug('@@@ metadata result size = ' + fpList.size());
for (MetadataService.FileProperties fp: fpList) {
    System.debug('@@@ Flow name: ' + fp.fullName);
}
/*------Get 10 Flows-Process--------*/
MetadataService.Flow flow =
            (MetadataService.Flow) service.readMetadata('Flow',
                flowNameArray).getRecords()[0];
/*------------- some Flow data----------*/
System.debug('Name ' + flow.FullName);
System.debug('recordCreate ' + flow.recordCreates);
 
Is there any way to retrieve fields used in Process builder's like in decisions, actions etc?
I am using $API.Session_Id in script in a VF page. I will be using this page for guest users. This {!$Api.session_id} returns some value. Is it a wrong way to get session id as this page will be used for site Guest users? Is it vulnerable?
<apex:page controller="ABCcntr"><script> var token={!$Api.Session_ID}</script> </apex:page>
I am using this example: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/code_sample_interactive_vfp_intro.htm . It is working in Sandbox but is not working Production. I have enabled streaming API from setup>user interface and making all setup and everything same as mentioned in the doc. But not working in production. Connection, handshake and subscribe is done successfully but it do not capture change. Please help, it is very urgent.
I want to add a link to make facetime video call in my visualforce page.
I tried adding anchor tage with facetime email address but does not work.
<a href="facetime:{!userFaceTimeEmail}" >video call</a>