• Scott McArthur 8
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 2
    Replies
I have a batch Apex job that was failing however I did not get any error emails even though I have got myself set up to receive 'Apex Exception Email'  Any ideas on how to set up proper alerting for this or why this did not work? 
I am attempting to query Topics assigned to a custom object in the  Apex controller of a Lightning Component being used in a Community using the Napili template. The user is using the 'Customer Community Plus License'. The code is like below but does not seem to return any results. I am wondering if there is some restrictions on a Customer Community user accessing Topics?
 
List<TopicAssignment> topicAssignments = [SELECT Id, Topic.Name FROM TopicAssignment WHERE EntityId = :objectId];

 
I have a Lightning component to display a list of Knowledge Articles. The code runs ok and seems to enter the `<aura:iteration` as the colons are displayed and looking at the debug log the query is returning results however the fields themselves like Title are not displayed when I run this in developer console.

component
  
<aura:component description="ArticleList" implements="forceCommunity:availableForAllPageTypes"  controller="ArticleListController">
  
    <aura:attribute name="articles" type="SObject[]"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />

    <aura:iteration var="article" items="{!v.articles}">
        <p>{!article.Id} : {!article.Title} : {!article.ArticleType}</p>
    </aura:iteration>

    </aura:component>

controller
 
({

    doInit: function(component, event){
        var action = component.get("c.getArticles");
        action.setCallback(this, function(response){
        component.set("v.articles", response.getReturnValue());

        });
     $A.enqueueAction(action);
    }

})
  
apex controller
 
public with sharing class ArticleListController {

    @AuraEnabled
    public static List<List<SObject>> getArticles() {
        String searchVar = 'Unpredictable';
        List<List<SObject>> articles = [FIND :searchVar RETURNING      KnowledgeArticleVersion
        (Id, Title, ArticleType WHERE PublishStatus='online' AND Language = 'en_US' AND ArticleType IN ('Knowledge__kav','Attachment__kav'))];
        return articles;

    }

 }



   
    

 
I am looking to implement a many to many relationship with the opportunity product and a custom object. This can't be done in the standard way with a junction object as there seem to be limitations around the opportunity product. I did find a way to do it with an intermediate object but i was a bit complicated from a user experience point of view. Also on the opportunity product does not appear to be possible to have an inline visualforce page or a button to a visualforce page. I am guessing re-implmenting that whole standard page in Visualforce page or doing somethign with a Javascript button might be on the only way. Any ideas appreciated
Any good examples of callling a rest web service using OAuth 2 from Apex?
We are looing at setting up Single Sign on with AWS Icognito as the Identity Provider for a customer community portal. The user will need to login both to Salesforce and to AWS.  The following scenario has been suggested as a way to create users, creating the community user in Salesforce first and then having a button on the contact record in Salesforce which makes a web service callout to AWS to create the user there. I am not sure if this is the best solution. I would have thought having a button on the Contact record which sends out an email to a registration page on AWS, where the user registers  creating the AWS user and at that point the IDP uses Just in Time Provisioning to create the community user.
Do Lightning components support iframes? I tried putting an iframe tag on a component and nothing displayed. I am aware that you can host a visualforce page from Lightning and have an iframe in that although not recommended by Salesforce. My scenario is to display iframe content in a customer community using the Napili template and I was thinking of using a custom Lightning component as a means of doing so. Trying to put an iframe directly into the 'Rich Content Editor' component does not work. Possibly the 'force:canvasApp' Lightning component could be an alternative. Any advice on the feasiblity/right direction on this appreciated
Does anyone have any examples of how to make a jQuery get from a Lightning component using code similar to the below where the data will be returned from SOQL query in Salesforce

 jQuery.ajax({
            url: '/MCS/GetCar', 
            type: "GET",
            dataType: "json",

I am already aware of how to import the jquery library using '<ltng:require' and creating an @AuraEnabled method in Apex but it was wiring the rest together I was unsure about, I am relatively new to Lightning although aware of the basics.
Any good examples of callling a rest web service using OAuth 2 from Apex?
I have a Lightning component to display a list of Knowledge Articles. The code runs ok and seems to enter the `<aura:iteration` as the colons are displayed and looking at the debug log the query is returning results however the fields themselves like Title are not displayed when I run this in developer console.

component
  
<aura:component description="ArticleList" implements="forceCommunity:availableForAllPageTypes"  controller="ArticleListController">
  
    <aura:attribute name="articles" type="SObject[]"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />

    <aura:iteration var="article" items="{!v.articles}">
        <p>{!article.Id} : {!article.Title} : {!article.ArticleType}</p>
    </aura:iteration>

    </aura:component>

controller
 
({

    doInit: function(component, event){
        var action = component.get("c.getArticles");
        action.setCallback(this, function(response){
        component.set("v.articles", response.getReturnValue());

        });
     $A.enqueueAction(action);
    }

})
  
apex controller
 
public with sharing class ArticleListController {

    @AuraEnabled
    public static List<List<SObject>> getArticles() {
        String searchVar = 'Unpredictable';
        List<List<SObject>> articles = [FIND :searchVar RETURNING      KnowledgeArticleVersion
        (Id, Title, ArticleType WHERE PublishStatus='online' AND Language = 'en_US' AND ArticleType IN ('Knowledge__kav','Attachment__kav'))];
        return articles;

    }

 }



   
    

 
Do Lightning components support iframes? I tried putting an iframe tag on a component and nothing displayed. I am aware that you can host a visualforce page from Lightning and have an iframe in that although not recommended by Salesforce. My scenario is to display iframe content in a customer community using the Napili template and I was thinking of using a custom Lightning component as a means of doing so. Trying to put an iframe directly into the 'Rich Content Editor' component does not work. Possibly the 'force:canvasApp' Lightning component could be an alternative. Any advice on the feasiblity/right direction on this appreciated