• Dhanik Lal Sahni
  • NEWBIE
  • 40 Points
  • Member since 2017
  • Technical Architect
  • Conduent Business Service


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
I have used lightning:datatable to show table data. This component's properties like maxRowSelection, showRowNumberColumn are not working. I am getting error The attribute "maxRowSelection" was not found on the COMPONENT markup://lightning:datatable. Is any one faced same issue? Please suggest on this issue.  
I want to update Account.Name with ( FirstName__C + LastName__C) whenever FirstName__C or LastName__C is changed or new account is created.

Workflow/process builder/trigger will not work as it will work when event is raised and Account.Name is mandatory field. Any suggestion. 
I am trying to install package for TrailHead https://trailhead.salesforce.com/trails/microsoft_dotnet/projects/transform-sql-queries-to-soql-queries-in-a-lightning-app/steps/set-up-your-trailhead-playground but it is showing error 
Installing this package requires the following feature and its associated permissions: Apex Classes

Apex Classes(classes/Books4EveryoneSampleDataControllerTest.cls-meta.xml) Missing feature
I have creating new TrailHead Playground but still getting same error.  Please help.
 
I am trying to implement an onclick listener that will take the div clicked and get the data-id from the element and call an apex method with it.
Here is my code snippet.
<aura:iteration var="convo" items="{!v.conversations}">
                <a href="#" data-id="{!convo.Id}" onclick="{!c.fireAppEvent}" style="text-decoration:none;">
                <div class="{!convo.ReadFlag__c == 	True ? 'slds-box slds-no-flex
 slds-theme--shade' : 'slds-box slds-no-flex slds-theme--default'}" >
                    <li class="slds-list__item">
                        <div class="slds-media slds-tile">
                            <div class="slds-media__figure">
                                <img src="/resource/SLDS100/assets/images/avatar2.jpg" style="height:60px;" alt="Placeholder" />
                            </div>

                            <div class="slds-media__body ">
                                <p class="slds-tile__title slds-truncate">
                                    {!convo.Name}
                                </p>
                                <ul class="slds-tile__detail slds-list--horizontal slds-has-dividers slds-text-body--small">
                                    <li class="slds-truncate slds-list__item">From : {!convo.FromNumber__c}</li>
                                    <li class="slds-truncate slds-list__item">To : {!convo.ToNumber__c}</li>
                                </ul>

                                <div class="{!convo.ReadFlag__c == True ? 'slds-media__body slds-text-body--regular' : 'slds-media__body slds-text-header--small'}">
                                    <p class="slds-truncate">{!convo.Messages__r[0].MessageText__c}</p>
                                    <p>{!convo.Messages__r[0].Direction__c == 'TOSF' ? 'Received at' : 'Sent at'} : {!convo.Messages__r[0].Time__c}</p>
                                </div>
                            </div>
                        </div>
                    </li>
                </div>
               </a>     
            </aura:iteration>
fireAppEvent : function(cmp, event) {
        var appEvent = $A.get("e.c:ConversationEvent");
        var convoId = event.target.getAttribute("data-id");
        console.log(event.target);
        console.log(convoId);
        appEvent.setParams({
            "message" : convoId });
        appEvent.fire();
    },

The problem is that it uses the element that I clicked on instead of the div that I set the onclick to. By that I mean if I click on the text part of the div, the event.target is the <p> tag, if I click on the image, the event.target is the  <img> tag, but what I want is for it to always get the data from the original <div> tag. 
 

How can I go about doing this?

I am having issues with Creating  an Apex class that returns Account objects for the Mapping.net concepts challenge.  I am a VB and Javascript programmer and I can't seem to get the syntax right.   
public class AccountUtils {
    
    public static void accountsByState(String st){
       List<String> accts = [SELECT Id, Name FROM Account WHERE billingState = :st];
 }
  
}
I believe the first part is correct, but I cannot seem to get a return value.  I am confused by the constructors.  I have tried the documentation but I can't get a return value.  Please help.  I need to get this challenge complete.
 
Hai guys,
The repeater must use the <li> HTML list tag
The repeater must use the apex:outputLink component to link to the respective record detail page
HINT: Record detail pages can be reached by placing a record ID at the root of the URL (e.g. '/<record id>').
how can i achieve it.
my vf page code is
<apex:page standardController="Account" recordSetVar="accounts">
  <apex:form >
  <apex:repeat value="{!accounts}" var="a">
 
  
 <li> <apex:outputLink value="/apex/AccountList?id=00128000005LpU9">
  
  {!Account.Name}
  
  </apex:outputLink>
</li>
  </apex:repeat>
  
  
  </apex:form>
</apex:page>
can any one help me

Hi All,

 

Typically I write my apex code in eclipse. When I try to format the code using ctrl+shift+f, it is not working. Is there any way to format apex code in eclipse.

 

Please let me know. An help in this regard really appreciated.

 

Regards,

Naren

  • January 24, 2012
  • Like
  • 0
Does salesforce Apex support iterating over a map using a for loop?