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

  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 33
    Replies
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
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!
  • January 25, 2021
  • Like
  • 0
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
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.\\"}]
I am trying to creating a link so that when a user clicks a text (which is a value of SObject), it opens a pop-window that opens a new visualforce page. 
I am new to Visualforce development, so I really appreciate any pointers/ideas on how to do this?
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
I have to write test class for this in one test class:-

public static String getMethod(String name) {
        try {
                HttpRequest request = new HttpRequest();
                Http http = new Http();
                HttpResponse response = new HttpResponse();
                request.setMethod('GET');
                request.setEndpoint('https://any_endpoint_here.com');
                response = http.send(request);
                    Map<String, Object> JSONDataMap=(Map<String, Object>) JSON.deserializeUntyped(response.getBody());
                    return String.valueOf(JSONDataMap.get('status'));
                }
            }
        } catch (Exception e) {
            System.debug('Exception>>' + e.getMessage() + ' at Line Number>>' + e.getLineNumber());
        } return null;
    }
    
    @AuraEnabled
  public static String getMethod2(String name2) {
        try {
                HttpRequest request = new HttpRequest();
                Http http = new Http();
                HttpResponse response = new HttpResponse();
                request.setMethod('GET');
                request.setEndpoint('https://any_endpoint_here.com');
                response = http.send(request);
                    Map<String, Object> JSONDataMap=(Map<String, Object>) JSON.deserializeUntyped(response.getBody());
                    return String.valueOf(JSONDataMap.get('status'));
                }
            }
        } catch (Exception e) {
            System.debug('Exception>>' + e.getMessage() + ' at Line Number>>' + e.getLineNumber());
        } return null;
    }
    
    This is the sample code
    Anyone help me in this?
    Thanks
 

I am trying to send email using einstein chatbot by implementing the action i.e Send email filed all values accordingly but the mail is not send and when I debug the response is IsSuccess=true.After I tried with invicable apex method and tried to send mail via 

 Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
            String emailAddress='abhishek.gupta@cloudanalogy.com';
            message.setSubject('Mail from bot');
            message.setToAddresses(new String[] {emailAddress});
            message.setHtmlBody('hii, thanks for giving us your time.');
            System.debug('message--> ' + message);
            Messaging.SendEmailResult [] r =Messaging.sendEmail(new Messaging.SingleEmailMessage[] { message });
But the issue remains same.
Let me know which permission I am missing here.
Thanks

<lightning:card footer="{!con.Email}" title="{!con.LastName}" iconName="action:add_contact">
            <aura:set attribute="action">
                <lightning:Button Label="View Details" Variant="brand"/>
            </aura:set>
            <p class="slds-p-horizontal-small">
                {!con.FirstName}&nbsp; {!con.LastName} <br/>
                {!con.Phone}
            </p>
        </lightning:card>

For the Above coding i am getting an Error: 
ContactList.cmp: The attribute "action" was not found on the COMPONENT markup://lightning:card: Source.

anyone can help how to solve this.
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!
  • January 25, 2021
  • Like
  • 0
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...
  • January 19, 2021
  • Like
  • 0
How we can check for loop count in apex class?
  • January 18, 2021
  • Like
  • 0
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.
  • January 15, 2021
  • Like
  • 0
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