• Akshay Dhiman 63
  • NEWBIE
  • 350 Points
  • Member since 2020

  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 33
    Replies
If there are two javascript methods fun1() and fun2() in same LWC component, is it possible to call method fun2() from fun1() where Function fun1() gets called with click of button? If not what can be the possible workaround for this?
I am trying to upload a custom component on the community site page, but it's not visible on the community site.
​​​​​​Can anyone help me to solve this issue. 

Thanks in advance
see below some code  of wrapper class
 public void ProcessSelected(){
selectedAccounts=new list<account>();
for(wrapaccount wrapobj:wrapaccountlist){ if(wrapobj.isSelected==true){
selectedAccounts.add(wrapobj.accn);
}
}

public class wrapaccount{
public account accn{get;set;}
public boolean isSelected{get;set;}
public wrapaccount(account a){
accn=a;
isselected=false;
}
}
}
it is not full code , so my question is 
selectedAccounts.add(wrapobj.accn);
in above codeLine  why we did this wrapobj.accn
can any one  answer me .
Thank You
I created a new Process Builder Closed Won Opportunities. Now it gave instructions to add a trigger - click Add Object - after I created the new Process Builder I do not have any buttons that have Add Object - where do I go from here? I am a bit confused.
Thank you for any and all help!
I an new to Datatable. I have managed to populate data and display the table with checkbox ,now I want the user to select atlest one of the checkbox if he/she doesn't then throw an alert saying the user has to select atlest one checkbox. How do I add the required selection to the datatable code
Hi, I want my phone number field number to display the number in the format of +XX (XXX) XXX-XXXX. Can someone help me how to achieve this.

Thanks in Advance...
How we can check for loop count in apex class?
Below code doesn't get the value from the aura:iteration
    <aura:iteration items="{!v.contactList}" var="item">
                <ul class="slds-has-dividers_bottom-space">
                    <li class="slds-item">
                        <lightning:tile label="{!item.Contact__r.Name}">
                        </lightning:tile>
                    </li>
                </ul>
            </aura:iteration>
            
            In Js Helper:- c.set("v.contactList",storedResponse);
            
                    callDetails=[SELECT Name, Contact__r.Name FROM PersonDetails__c ORDER BY CreatedDate desc LIMIT 20 ];
    I want get the contact assoicated information but doesn't get it.
How write test class for the following code it:-
    
        public static void script(){
            List<OpportunityLineItem> oppLine= new List<OpportunityLineItem>();
    oppLine=[Select TotalPrice from OpportunityLineItem where Name like '%abc%' AND OpportunityId IN (Select id from Opportunity Where StageName='Closed Won')];
     System.debug(oppLine);

     Decimal tp=0;

    for(OpportunityLineItem op1:oppLine){
        tp=tp+op1.TotalPrice;
    }
    System.debug(tp);
        }
    
    I could not reach the 75% for above code.
    Thanks
Hi guys
I'm new to Visualforce development.I'm trying to creating a link so that when a user clicks a text (bachtuoc (https://bachtuoc.tv/)), it opens a pop-window that opens a new visualforce page. Appreciate any help.
Please help me to cover the percantage for the below line of code:-

public class testing1 {
  @AuraEnabled
    public static List<String> getObjectName(){
 List<String> objects=new List<String>();
       List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();  
        for(SObjectType sot:gd){
           objects.add(sot.getDescribe().getName());
           objects.sort();  
        }
        return objects;
    }
    
    @AuraEnabled
        public static List<String> getAllFields(String fld){
        List<String> fieldList = new List<String>();
Map<String,Schema.SObjectType> gd = Schema.getGlobalDescribe();
Schema.SObjectType sobjType = gd.get(fld);
Schema.DescribeSObjectResult describeResult = sobjType.getDescribe();
Map<String,Schema.SObjectField> fieldsMap = describeResult.fields.getMap();
    for(string str: fieldsMap.keySet()){
                fieldList.add(fieldsMap.get(str).getDescribe().getName());                
            }
    return fieldList;
}
    
    
       @AuraEnabled
        public static String getAllFieldsName(String fld1, String fld2){
       String ObjectName= fld2;
             system.debug('ObjectName '+ObjectName);
            String FieldName= fld1;
            system.debug('FieldName '+FieldName);
             system.debug('FieldName '+Schema.getGlobalDescribe().get(ObjectName).getDescribe().fields.getMap().get(FieldName).getDescribe().getLabel());
        return Schema.getGlobalDescribe().get(ObjectName).getDescribe().fields.getMap().get(FieldName).getDescribe().getLabel();
 
            //  Schema.DisplayType fielddataType;
      //      return  fielddataType.Schema.getGlobalDescribe().get(FieldName).getDescribe().getType();    
            
       // List<String> fieldList = new List<String>();
//Map<String,Schema.SObjectType> gd = Schema.getGlobalDescribe();
//Schema.SObjectType sobjType = gd.get(fld1);
//Schema.DescribeSObjectResult describeResult = sobjType.getDescribe();
//Map<String,Schema.SObjectField> fieldsMap = describeResult.fields.getMap();
   // for(string str: fieldsMap.keySet()){
        //        fieldList.add(fieldsMap.get(str).getDescribe().getName());                
     //       }
 //   return fieldList;
            
            //Schema.SObjectField F = fieldNameMap.get(fieldAPIName); //where fieldAPIName is API name of field
//Schema.DescribeFieldResult R = F.getDescribe();
//String fieldLabel=R.getLabel();
//return fieldLabel;
}
    
      @AuraEnabled
        public static String getAllFieldsDataType(String fld11, String fld12){
     Map<String,Schema.SObjectType> gd = Schema.getGlobalDescribe();
        //String ac='Account';
     
        System.debug('sObject' +fld12);
        System.debug('fieldname' +fld11);
        Schema.SObjectType sobjType = gd.get(fld12);
        System.debug(sobjType);
        Schema.DescribeSObjectResult describeResult = sobjType.getDescribe();
        Map<String,Schema.SObjectField> fieldsMap = describeResult.fields.getMap();
        Schema.DisplayType fielddataType = fieldsMap.get(fld11).getDescribe().getType();
        String a;
        System.debug(fielddataType);
       // return Schema.getGlobalDescribe().get(objIdd).getDescribe().fields.getMap().get(fldId).getDescribe().getType();
         System.debug('return ' +fielddataType);
        return String.valueOf(fielddataType);
        }
}

Thanks
I tried to fetch multiple class in a vf page but don't get idea how to fetch it Please help me?
Hey I am a beginner I don't know how to solve this please help me
For this array:-
[{\\"stage\\":\\"10 - Application\\",\\"oppId\\":\\"2dwd23d231d2w\\",\\"message\\":\\"Opportunity status created.\\"},{\\"stage\\":closedwon,\\"oppId\\":\\"2dwd23d231d2w\\",\\"message\\":\\"Opportunity not found or permission denied.\\"}]
Hi. I am trying to get an access token for working with API

I always get the message 

{"error":"invalid_grant","error_description":"authentication failure"}*

I tried postman and curl 
 
curl -v https://login.salesforce.com/services/oauth2/token 
      -d "grant_type=password" -d "client_id=consumer_key" 
      -d "client_secret=consumer_secret" 
      -d "username=username" -d "password=password"

curl I repeat instruction from https://developer.salesforce.com/docs/atlas.en-us.api_iot.meta/api_iot/qs_auth_access_token.htm, but it still doesn't work 

what is wrong here? 
 
Hi,
I am new to SF and want to learn how to create new button on Product object page layout with Buttons, Links, & Actions.

I tried to create the btn on the page, which worked using this:
<aura:component implements="force:lightningQuickAction"> 
   <center><b>This is a Lightning component </b></center>
</aura:component>

But now how do I get the fields from my product object into the pop up window and then a save btn pls?  This is what shows now :
(I put this under topic - Apex code development - is that correct?)

Thanks so much in advance!!

User-added image
Hello,

I created a custom Lightning Component as i wanted to implement a Client Side Search functionality.
However, when i click "Preview" in Developer Console to test it i receive a white blank page. (code is correct and i have also have myDomain deployed.

Any ideas?

User-added image
global Database.QueryLocator start(Database.BatchableContext bc){

return Database.getQueryLocator(SELECT id,Email,name,MailingCountry,active__C,Flag__c,Chrun_Indicator__c,Sales_Program_Type__c FROM contact where AccountId!= null and account.Active__c='yes' and ( Account.Type  like 'Customer%') and Active__c='Yes' and Email!= null and  (NOT Email  like '%cexz.com'));

    }

User-added image