• Balagopal G
  • NEWBIE
  • 35 Points
  • Member since 2015
  • Developer
  • BEO Software Private Limited

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 27
    Replies

Hi, so I am storing an array in an aura attribute that is set up like so:

<aura:attribute name="events" type="Asset[]" />

but when I call component.get('v.events') a javascript proxy is returned, which is fine, but I'm not sure how to get the target array out of the proxy. Thanks in advance.
Will this LDS works other than Component Load or page Load.

For example : In a custom vf page, a Lightning App is loaded and then inside a component in  the same app, on a button click in that component , in modal (without component refresh or page load) CRUD operations are included.
Is it possible to use LDS in the above scenario or LDS will work only on Page Load?!.

In developing an AppExchange Product , There is a requirement to insert huge amount of data on a button click and after insert for each record  an information has to be brought from a third party system and process and calculate and update the record.
What is the best way , kindly help.

There is a requirement to insert a record in custom object and then on button click it retrieve some information from an API which is outside salesforce and stores in the custom object.

Is it possible to bulkify the Process, like collection of record data , processed one by one (for each record need to retrieve information)and stored and process runs in backround.

Is there any way to automate it for bulk records?!.

In an App, how can we provide a page to to the non users to view a data .

for example if i have a custom object and the details in that is related a non-salesforce  user , how can we show the details to those users without any log in or anyother restriction (consider there is a unique ID to match the record which is entered by the user in the page).
Kindly Help .

Please let me know hoe to resolve this error as I am new in SFDC developement

Create a field on the Account object called 'Number_of_Contacts__c' of type Number. This field will hold the total number of Contacts for the Account.
Create an Apex class called 'AccountProcessor' that contains a 'countContacts' method that accepts a List of Account IDs. This method must use the @future annotation.
For each Account ID passed to the method, count the number of Contact records associated to it and update the 'Number_of_Contacts__c' field with this value.
public class AccountProcessor {
    @future
    public static void countContacts(List<ID> accid1)
    {
      List<Account> acc = [select Id,name from account where Id In: accid1];
       List<Account> updateacc = new List<Account>();
        for (Account a1 : acc)
        {
            a1.Number_of_Contacts__c = [select count() from contact where accountId IN: a1.Id];
            updateacc.add(a1);
            
        }
        update updateacc;
    }

}


Thanks :)

 

Hello everyone,
I'm new in saleforce and Here i got a problem regarding "Variable does not exist: Name"
I just want to create a visual page and here code and controller class.
Please take a look 

Visualpage code:
<apex:page standardController="Registration__c" extensions="Controller">
     <apex:form > 
         <apex:pageBlock ><center><h1>Registration Form</h1></center></apex:pageBlock>
         <apex:pageBlock title="Student Details" id="1">
                <apex:pageBlockSection title="Jadu">
                        <apex:inputField value="{! Registration__c.Name }"/>
                        <apex:inputField value="{! Registration__c.Father_s_Name__c }"/>        
                        <apex:inputField value="{! Registration__c.Mother_s_Name__c }"/>
                        <apex:inputField value="{! Registration__c.Phone__c }"/>   
                        <apex:inputField value="{! Registration__c.Birth_Date__c}"/>
                        <apex:inputField value="{! Registration__c.Gender__c}"/> 
                        <apex:inputField value="{! Registration__c.Email__c}"/>    
                        <apex:inputField Value="{! Registration__c.Address__c}"/>
                        <apex:inputField value="{! Registration__c.Pincode__c}"/>
                        <apex:inputField value="{! Registration__c.City__c}"/>
                        <apex:inputField value="{! Registration__c.Country__c}"/>
                        <apex:inputField Value="{! Registration__c.State__c}"/> 
                    </apex:pageBlockSection> 
                    <apex:pageBlockButtons location="bottom" >
                         <apex:commandButton action="{!save}" value="Save" />
                         <apex:commandButton action="{!show}" value="Show Registered Student " reRender="a" />
                    </apex:pageBlockButtons> 
            </apex:pageBlock>
            <apex:pageBlock title="Registrated Student" id="a">    
                {! Name} {! FatherName}         
             </apex:pageBlock>
        </apex:form>  
</apex:page>
Class code: 
public with sharing class Controller {
    public String Name;
    public String FatherName;
    public void show(){
       List<Registration__c> Reg = new List<Registration__c>();
        for(Registration__c obj :[select id, Father_s_Name__c,Name from Registration__c])
        {
          Reg.add(obj); 
        }
        Name = Reg.Name;
        FatherName = Reg.Father_s_Name__c;
    }
}
Problem:
Variable does not exist: Name.
Variable does not exist: Father_s_Name__c.
1 in line 0 of Registration page

Hi!

Please help me on how to query this. The scenario is:
If any if the child record has true value, then update parent record to true. But if all child record is false, then update parent record to false.
 
List<Campaign__c> campList = new List<Campaign__c>();
if (!parentIds.isEmpty()) {
	for (Campaign__c parentCamp : [SELECT Id, Do_Not_Notify_Subscriber__c FROM Campaign__c WHERE Id IN :parentIds]) {
		Campaign__c childCamp = childMatterMap.get(parentCamp.Id);
		parentCamp.Do_Not_Notify_Subscriber__c = childCamp.Do_Not_Notify_Subscriber__c;
		campList.add(parentCamp);
	}
	if (!campList.isEmpty()) {
		update campList;
	}
}

 
I have been using the lightning:listView componenet and have successfully got one to display within a community page.

However, the nature of the lightning:listView component is that it links itself directly to an existing List View.

I would like to use the functionlaity of a lightning:listView component within my community but I want to be able to select the data from potentially more than one object, so I might need a SOQL query.

Is there a way to achieve this, or if I have to create something that gives my the ordering and search capability of a List View what's the best way to create it?

Regards
 
  • January 21, 2019
  • Like
  • 0
Hi, I'm trying to associate two objects that are coming from an external system.  I'm puzzled as to how a Master-Detail set of objects in Salesforce as even associated.  In MSSQL or other database software (or even Access!) I can create a join between two objects on a specific criteria.  In Salesforce I have no apparent options between two objects in the Schema Builder or Object Design to "Join" the Master-Detail objects together.  It is just a mandatory relationship, but what criteria is the join created with?  Seems like somewhere in the Schema Builder would specify what field the association of a Master-Detail is using.  

Any advice welcome!
Hi ,
help me on this below issue , how to resolve 
      field API name passing from design:attribut to fieldname attribute

       var fields = component.get("v.fieldname");

        console.log('fieldapiname'+fields); // getting field api name

        var action = component.get("c.getimagesresponse");
        
        action.setParams({
            recId: recordId,
            fieldName:fields
        });
        action.setCallback(this, function(a) {
  var sobjectrecord = a.getReturnValue().fields; // Not working 
 console.log('fieldname '+sobjectrecord ); // getting undefined
 var sobjectrecord = a.getReturnValue().No_of_licencess__c ; //hardcoded field API name, when passing field API name returnning correct result 
 console.log('fieldname '+sobjectrecord );  // sucess 

  i want to pass field API name dynamically , how to resolve this issue .
Thanks in Advance 
The error I got here is 
SELF_REFERENCE_FROM_TRIGGER, Object is currently in trigger AccountTrigger, therefore it cannot recursively update itself: []: Class.classname.automateAccOwnership: line xx, column 1
public static void automateAccOwnership(Account[] updatedAccounts){
            set<id> accIds = new set<id>();
            for(account acc:updatedAccounts){
                if(!acc.Account_Team_Exception__c) accIds.add(acc.id);
            }
    Map<id, user> userMap = new map<id,user>([select id, name from user where isActive=true]);
          
            
             list<account> accWithTeam= new list<account>([select id,name, checkbox1__c,type,Account_Team_Exception__c,(SELECT AccountAccessLevel,AccountId, Id,TeamMemberRole,UserId FROM AccountTeamMembers) from account  where id in:accIds]); 
           
            for(account acc: accWithTeam){
                for(AccountTeamMember ATM : acc.AccountTeamMembers ){               
            
        if(acc.checkbox1==true  && atm.TeamMemberRole=='RSD-BPSTN/CPSTN' ) {                        
                        acc.ownerid = atm.UserId ;
                        }                      
            }
           if(acc.type=='Reg Co - Tax Haven' ){ 
        
           for(user user:userMap.values())if(user.name== 'username') 
           acc.ownerId = user.id;             
             }     
          }  
     update accWithTeam; // this update statemet causing recursion

I appreciate your help.
Thank you.

Hi, so I am storing an array in an aura attribute that is set up like so:

<aura:attribute name="events" type="Asset[]" />

but when I call component.get('v.events') a javascript proxy is returned, which is fine, but I'm not sure how to get the target array out of the proxy. Thanks in advance.
I am trying to build my first Lightning Component for my production Org by following along with Trailhead and modifying my code to fit the data I need from my sandbox.  My component will not display and I swear I have been over my code 100 times. Any help would be great. 

Lightning Component
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="DivisionHealthCheckController" >
    <aura:attribute name="Divisions" type="Division__c"/>
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    <lightning:card title="Division Health Checks">
        <aura:set attribute="body">
        <table class="slds-table slds-table_bordered slds-table_cell-buffer">
            <thead>
               <tr class="slds-text-title_caps">
          		  <th scope="col">Division</th>
           		  <th scope="col">Grade</th>
           		  <th scope="col">Total Influencers</th>
               </tr>
            </thead>
            <tbody>
            <aura:iteration items="{!v.Divisions}" var ="div">
                <tr scope="row">
                    <td> {!div.Name}</td>
                    <td> {!div.Grade__c}</td>                
                </tr>
                 </aura:iteration>
            </tbody>               
          </table>
        </aura:set>       
    </lightning:card>	
</aura:component>

Controller
public with sharing class DivisionHealthCheckController {
    @AuraEnabled
    public static List<Division__c> divisionHealth(){
        return [SELECT Id,
               Name,
               Grade__c               
               FROM Division__c            
        ];
    }

}

JS Controller
({
	doInit : function(component, event, helper) {
        var action = component.get("c.divisionHealth");
        action.setCallback(this, function(data){
            component.set("v.Divisions", data.getReturnValue());
            console.log(data.getReturnValue());
        });
        $A.enqueueAction(action);
		
	}
})


 
Hi,
While creating New Custom Object Tab, there is a field named Tab Style which is to be selected from a bunch of icons.
What is the significance of this Tab style? Whichever icon I choose, I don't feel any difference.

User-added image
 
I am trying to creating a progress bar in lightning with 4 stages... somehow it's not appearing properly ... Pls look at my code and suggest what is wrong...

I am following this - https://developer.salesforce.com/events/webinars/singlepagelightning

The output is not even close ... I don't see any progress bar ... just text with large box...


    <div class="c-container">
        <lightning:layout horizontalAlign="space">
            <lightning:layoutItem flexibility="auto" padding="around-small">
                <h3 class="slds-section-title--divider">Patient Journey</h3>
            </lightning:layoutItem>
            <lightning:layoutItem flexibility="auto" padding="around-small">
                
                <!-- Progress Bar-->
                        <div class="slds-grid">
                          <div class="slds-tabs--path" role="application">
                            <ul class="slds-tabs--path__nav" role="tablist">
                              <li aura:id="accountIndicator" class="slds-tabs--path__item slds-is-current" role="presentation">
                                <a class="slds-tabs--path__link" id="tabs-path-1" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive">
                                  <span class="slds-tabs--path__stage">
                                    <lightning:icon iconName="utility:check  " size="x-small" alternativeText="Account Intake"/>
                                  </span>
                                    <span class="slds-tabs--path__title">Create  A/C</span>
                                </a>
                              </li>
                              <li aura:id="caseIndicator" class="slds-tabs--path__item slds-is-incomplete" role="presentation">
                                <a class="slds-tabs--path__link" id="tabs-path-2" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive">
                                  <span class="slds-tabs--path__stage">
                                    <lightning:icon iconName="utility:check  " size="x-small" alternativeText="Account Intake"/>
                                  </span>
                                  <span class="slds-tabs--path__title">Create Account Case</span>
                                </a>
                              </li>
                              <li aura:id="stageIndicator" class="slds-tabs--path__item slds-is-incomplete" role="presentation">
                                <a class="slds-tabs--path__link" id="tabs-path-3" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive">
                                  <span class="slds-tabs--path__stage">
                                    <lightning:icon iconName="utility:check  " size="x-small" alternativeText="Patient Intake"/>
                                  </span>
                                  <span class="slds-tabs--path__title">Create Account Stage</span>
                                </a>
                              </li>
                              <li aura:id="reviewIndicator" class="slds-tabs--path__item slds-is-incomplete" role="presentation">
                                <a class="slds-tabs--path__link" id="tabs-path-4" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive">
                                  <span class="slds-tabs--path__stage">
                                    <lightning:icon iconName="utility:check  " size="x-small" alternativeText="Patient Intake"/>
                                  </span>
                                  <span class="slds-tabs--path__title">Review</span>
                                </a>
                              </li>
                            </ul>
                          </div>
                        </div>
                
                
                
            </lightning:layoutItem>
        </lightning:layout>
    </div>
  • July 23, 2018
  • Like
  • 0
Hey,

I have used lighning datatable to show my custom object fields on thr browser but I am not getting any data on my screen.

Below is the code I have written:

This is my main component:

<aura:component implements="force:appHostable" controller="EntitlementListControllerx">
    
    <!-- attributes -->
    <aura:attribute name="data" type="Object"/>
    <aura:attribute name="columns" type="List"/>
    
    <!-- handlers-->
    <aura:handler name="init" value="{!c.doInit }" action="{!this }"/>


    <!-- the container element determine the height of the datatable -->
    <div style="height: 300px">
        <lightning:layout horizontalAlign="space">
            <lightning:layoutItem size="12">
                <lightning:datatable
                                    keyField="id"
                                    data="{! v.data }"
                                    columns="{! v.columns }"
                                    hideCheckboxColumn="true"/>
                </lightning:layoutItem>
        </lightning:layout>
    </div>
</aura:component>

Controller:

({
    doInit: function (cmp, event, helper) {
        cmp.set('v.columns', [
            {label: 'Entitlement Name', fieldName: 'Name', type: 'text'},
            {label: 'Entitlement Number', fieldName: 'Entitlement_Name__c', type: 'text'},
            {label: 'Entitlement Amount', fieldName: 'Entitlement_Amount__c', typeAttributes: { currencyCode: 'USD'}},
            {label: 'Entitlement Type', fieldName: 'Entitlement_Type__c', type: 'text'},
        ]);

        helper.getEntitlement(cmp,helper);
    }
})

Helper:\

({
    getEntitlement : function(cmp) {
        helper.callServer(cmp,"c.getEntitlementList",
                                   function(response){
                                       for(var i=0; i>response.length; i++){
                                           var row = response[i];
                                           row.Owner = row.Contact__r.Name;
                                       }
                                        cmp.set("v.data", response);//set data in the page variable
        });
    }
})

Controller to fetch the data:

public with sharing class EntitlementListControllerx     
{
     @AuraEnabled//Annotation to use method in lightning component
    
    public static List<Entitlement__c> getEntitlementList() 
    {//Fetch data
        return [SELECT Id,Name,Entitlement_Name__c, Entitlement_Amount__c, Entitlement_Type__c, CreatedDate FROM Entitlement__c];
    }    
}

Please help!
How can i round or truncate off the decimal? I don't want the decimal to show. If a user input 1.5 I want it to show either 2 or 1 so either round up or truncate off the decimal, either one works. 

Right now I have:
<lightning:input type="number"  value="{!v.customNumber__c}"/>

Any help is greatly appreciated, thank you.
 
Hello everyone, 
Has someone exemple of validate required fields in lightning component?
Thank you.
Hi, I am new to Salesforce,
As for my requirement, stored total object data in a field as JSON format. Then deserialized that string and return into jshelper .But iam not able get the values.
please help in this.
User-added image
Thanks in advance.
Raj.