• Chris Salgado
  • NEWBIE
  • 25 Points
  • Member since 2018

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies
 return Database.getQueryLocator([select userorGroupid from groupmember where group.name='GroupnameXYZ' and userorgroupid in (Select id,contact.AP_Status__c from user where contact.Fieldxyz__c!='Available' and isactive=True)]);

Compile Error: unexpected token: , 
 
TLDR:
  • document.getElementsByClass()[0] returns undefined.
    • My main question is at the bottom.

Requirement:
  • We are trying to make a guide/ tour to onboard new Users through our Customer Community portal.
    • Due to the complex process, it is not intuitive so we want to have a WalkMe like guide.

Background:
  • I found Salesforce uses Hopscotch in the Community Builder when you first use it - it shows you all the tools etc.
  1. I added the Hopscotch zip file as a Static Resource
  2. I load the CSS style and JS scripts to a custom Lightning Component using <ltng:require>
  3. I add the Component to the Community page through the Builder.
Problem:
  • Hopscotch's Tour object has a parameter called Target which takes the DOM Element to point the bubble at.
    • When I use document.getElementsByClassName() on a Custom Component's Elements or on a Salesforce Standard Element (like the Navigation Menu) it works the same, I get an HTML Collection but if I try to get the first record document.getElementsByClassName()[0] it works for Custom Component's Elements but for Standard Elements I get undefined.
 
  • I learned Lightning Locker Service prevents Lightning Components from reaching DOM Elements in differen Namespaces.
    • It still returns a Proxy Object and I am able to use that Proxy Object to get the Element of other Custom Components but for Standard Elements I get undefined.
THE BIG QUESTION:
  • Is there anyway to get the DOM Element of a Standard Salesforce Community Component?
NOTE: I saw a suggestion to drop the API Version to lower than 40.0 but I think Lightning Locker Service is important, I just want a way to work with it.
 return Database.getQueryLocator([select userorGroupid from groupmember where group.name='GroupnameXYZ' and userorgroupid in (Select id,contact.AP_Status__c from user where contact.Fieldxyz__c!='Available' and isactive=True)]);

Compile Error: unexpected token: , 
 
Hi ,

This is my test class for insert a record

Parent Object :Album__c
Child object :Track__c(which has loopup relation with Album__C)

I have written the class and the test class for inserting a record in the child object...but both are giving me error....

In main program
----------------------

public class instrack 
{
track__c al = new track__c(); 
public track__c merch(String name,string name1)  
{
al.Name=name;                             
al.Album__c=name1;
insert al;                 
system.debug('the inserted record is:'+name);
return al;
}
}

Executed as :

instrack mc=new instrack();
mc.merch('Container','GullyBoy');

Error as: Method does not exist  or incorrect signature :void merch(string) from the type instrack....

Test class
-------------
@istest
public class instracktest
{
static testmethod void testmerch()
{
track__c al = new track__c(Name='Surgical'); 
 insert al;   
 Test.startTest();
         al = new track__c (Name = 'Surgical',Album__c='GullyBoy');
         Database.SaveResult result = Database.insert(al, false);
         System.assert(result.getErrors()[0].getMessage().contains('Track already exist with this'));
        Test.stopTest();              

}
}

Error as : System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Album__c]: [Album__c]

Kindly help out on the issue..Thanks in advance...
Hi there, I've got a very specific design outcome I'm trying to achieve in Lightning and I can't find any info relating to this on any of the usual channels.

I want to present a flow as a modal dialog box from a list view. This would mean a user could select multiple records, and run through the flow for each of the items. I have built a version that meets these criteria with the exception of presenting the flow in a modal dialog over the current list. Although this final requirement isn't critical to the functionality of the process, it is important to keep the experience consistent with other lightning processes.

I understand this could be completed through JS if I was using Classic, but our org has migrated to Lightning a while back and won't be moving.

Also, interestingly I can get the desired modal display using an Action, but this can't be added to a list view (only a detail view) in my understanding.


Does anyone have any suggestions as to how this could be achieved? Thanks in advance!




This is the current process:

Visualforce Page, launched by list view button
<apex:page standardController="Contact" lightningStyleSheets="true" tabStyle="Contact" recordSetVar="AllContacts" >
        <!-- Add below each field you reference in your Flow -->   
        <apex:repeat value="{!AllContacts}" var="row" rendered="false">
            {!row.Id}
        </apex:repeat>
        <!-- Runs your Flow -->   
        <flow:interview name="Outbound_Call_Flow_Contact_v2" 
            finishLocation="{!URLFOR($Action.Contact.Tab, $ObjectType.Contact)}">
            <apex:param name="selectedContacts" value="{!Selected}"/>
        </flow:interview>
</apex:page>

Button settings
User-added image


List view
User-added image


Flow once launched (takes its own page, when I would like it to present modally)
User-added image

Desired presentation of flow
User-added image 
Currently I have a Visualforce page that is used to accept parameters from outside Salesforce. The visualforce page calls javascript and opens a tab in a lightnig console.  I am successful opening the lightning console tab when the values are all correct.  I am trying to use ApexPages.addmessage to display a message when the ID is not found.  The issue is that I continue to get 'Error: resolvePage() - Error determining State from pageReference'  An ugly error hits the page that has to be x'ed out of.  Then it says page not found.  Is there a method I could use to redirect to the 'Home Page of the Console?'

I am facing some problem in traversing lightning proxy dom. 

Requirement: To change the lightning icon (SVG use path) when lightning components render as in below lightning icon  Dom screen-shot:

User-added image

Here, I am using lightning approval icon and it generates "approval" id when it renders in the browser by default.
So, I have to access this SVG part of Dom id="approval"  which I am unable to do so with below code.
Couple of below scenarios I used to get this:

1) Component.find()- I tried with the component.find("approval") but it gives undefined as it requires aura:id, which is not my case- as I have to find this dom component in the controller by this "approval" id only.
2) Jquery-I used Jquery to traverse dom but no luck.
3) component.getElements()- This gives proxy dom component(Locker Service) and values of this SVG are coming when I am debugging it as in the last screen-shot, but I am unable to traverse this Dom after.
   

Could you please help me with this and tell me an easy way to do that?

Component Code:
<aura:component >
    <ltng:require scripts="{!$Resource.jQuery + '/jquery.js'}" afterScriptsLoaded="{!c.scriptsLoaded}"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />:
    <div  id="test">
        <lightning:icon iconName="action:approval" size="large" alternativeText="Indicates approval"/>
    </div>
</aura:component>

Controller :
({
 doInit : function(component, event, helper) {
var svg = component.find('approval');
        console.log('i am in doinit');
        console.log(svg);
        //var elements = document.getElementsByClassName("slds-icon-action-approval");
         //console.log(elements);
},
    scriptsLoaded : function(component, event, helper) {
        $(document).ready(
     function()
     {
         //console.log(document.getElementById("sumit"));
     }
        );
         //console.log($( '#test'));

},
})
AfterRender:
({
    afterRender  : function(component,helper){
        component.superAfterRender();
     var svg=component.getElements();
        console.log('i am in afterrender');
        console.log(svg);
        //console.log(elements);
        
         
        }
    
})


User-added image


Thanks in Advance!!