• Sarma Duvvuri
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 33
    Replies
Hi,

Can anyone tell me,  Can we display the list of queues and public groups assigned to the particular user in report or dashboard?

Thanks in Advance.
Sarma
Hi All,

i want to assign the case to particualt queue based on code. 
Code is DEL, I can assign that case to the queue name which contains DEL as a admin

Please help for validation rule..

Thnaks,
Sarma
 
Hi All,

I have one text field. I wnat to insert that field with owner name using Apex or Trigger. Can any one suggest me.

Thanks,
Sarma
Hi All,

I have One Parent Object- Case and Child Object- Case Events. For every status change in case (like new, Pend, Reject) event is created in case events. if status changed 3 times 3 evenmts created in case events object.

Now we have one filed (Time) in case event i want to get that field value in case.

Please Help me how to proceed.

Thanks,
Sarma
Hi All,

User should not edit the reports in public folder and save. I have diabled the below permissions.

Manage Reports in Public Folders & View Reports in Public Folders

Still user able to edit and save as report in public folder. User has to create his own reports in private folder but he should not edit and save as reports in public folder.

Please help.

Thanks Inadvance.

Sarma
Hi All,

Can any one tell me how to Summarize the Formula field (Custom Field) in Reports.

Thanks & Regards,
Sarma
Hi All,

When case status is updated, Total duration hours should be displayed in sub total column of report. Can any one please help me how to write trigger for this scenario. Its very urgent

Thanks In Advance.

Sarma
Hi All,

I want to run the batch from monday to friday in between 9 AM to 5 PM for every one hour. Please tell me how to proceed.

Thanks,
Sarma
Hi All,

Please provide any sample code of Batch class to fetch the records based on time and date.

Thanks,
Sarma
Hi All,

Kindly provide the sample test class for Creating Installation Case records based on Application Status

Thanks & Regards,
Sarma
Hi All,

I have imported the list of accounts in CSV formate in visualforce page. i have 2 tasks.
1. I want to upload only 5 account records if it is more than 5 it should show the error message
2. What are the records i got in visual force page should save in account object once i click on save button in visual force page. please suggest.

code is below..

VisualforcePage:
<apex:page controller="importDataFromCSVController">
    <apex:form >
        <apex:pagemessages />
        <apex:pageBlock >
            <apex:pageBlockSection > 
                  <apex:inputFile value="{!csvFileBody}"  filename="{!csvAsString}"/>
                  <apex:commandButton value="Upload" action="{!importCSVFile}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock >
           <apex:pageblocktable value="{!accList}" var="acc">
              <apex:column value="{!acc.name}" />
              <apex:column value="{!acc.AccountNumber}" />
              <apex:column value="{!acc.Type}" />
              <apex:column value="{!acc.Accountsource}" />
              <apex:column value="{!acc.Industry }" />
        </apex:pageblocktable>
     </apex:pageBlock>
   </apex:form>
</apex:page>

Apex class:
public class importDataFromCSVController {
public Blob csvFileBody{get;set;}
public string csvAsString{get;set;}
public String[] csvFileLines{get;set;}
public List<account> acclist{get;set;}
  public importDataFromCSVController(){
    csvFileLines = new String[]{};
    acclist = New List<Account>(); 
  }
  
  public void importCSVFile(){
       try{      
        
           csvAsString = csvFileBody.toString();
           csvFileLines = csvAsString.split('\n'); 
            
           for(Integer i=1;i<csvFileLines.size();i++){
               Account accObj = new Account() ;
               string[] csvRecordData = csvFileLines[i].split(',');
               accObj.name = csvRecordData[0] ;             
               accObj.accountnumber = csvRecordData[1];
               accObj.Type = csvRecordData[2];
               accObj.AccountSource = csvRecordData[3];   
               accObj.Industry = csvRecordData[4];                                                                             
               acclist.add(accObj);   
           }
        //insert acclist;
        }
        catch (Exception e)
        {
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'Please upload the csv format file');
            ApexPages.addMessage(errorMessage);
        }  
  }
}




 
Hi All,

Can anyone ell me how to convert the lead from Web to Lead form to Direct account and contact please.

Its Urgent.

Sarma
Hi,

I am not able to run the batch for the below quesry.

i am getting below error messages after modifications also. kindly help.
1. First error: Only variable references are allowed in dynamic SOQL/SOSL.
2. First error: unexpected token: '='
3. IF i mention IN instead of = i got error message like First error: unexpected token: 'IN'
4. First error: expecting a colon, found 'NULLStatus__c'
5.First error: Too many query rows: 50001 (Main Error)

I want to  get all the ACTIVE status customers from orders.

Code:
global with sharing class Batch_ProductVolumeTarget_Stats implements Database.Batchable<sObject>
{
  public class X_Exception extends Exception{}

  global Database.QueryLocator start(Database.BatchableContext BC)
  {
    string  strQuery =
      ' select  Id'  +
      ' from     Order__c ' +
      ' where    Customer__C= NULL';
      
    return Database.getQueryLocator(strQuery);
  }

Regards,
Sarma
Hi,

I am not able to update the contact details for existing account in Lead Conversion. Kindly help in this issue.

This is the code i am using.

Public class AutoConvertLeads
{
    @InvocableMethod
    public static void LeadAssign(List<Id> LeadIds)
    {
        LeadStatus CLeadStatus= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true Limit 1];
        List<Database.LeadConvert> MassLeadconvert = new List<Database.LeadConvert>();
        for(id currentlead: LeadIds){
                Database.LeadConvert Leadconvert = new Database.LeadConvert();
                Leadconvert.setLeadId(currentlead);                
                Leadconvert.setConvertedStatus(CLeadStatus.MasterLabel);
                Leadconvert.setDoNotCreateOpportunity(TRUE); //Remove this line if you want to create an opportunity from Lead Conversion 
                MassLeadconvert.add(Leadconvert);
        }
        
        if (!MassLeadconvert.isEmpty()) {
            List<Database.LeadConvertResult> lcr = Database.convertLead(MassLeadconvert);
        }
    }
}
Hi All,

How to do lead conversion without creating an opportunity. (Only account and contact has to be created)

If the account is already exists contact detailes has to updated to that exisiting account and if the details are already there in salesforce and different from the requirement, we need to update those details in account and contacts.

Lead Conversion Code:

Trigger web2LeadConvert on Lead (after Update) {
     LeadStatus convertStatus = [
          select MasterLabel
          from LeadStatus
          where IsConverted = true 
          limit 1
     ];
     List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>();

     for (Lead lead: Trigger.new) {
          if (!lead.isConverted && lead.Status == 'Qualified') {
               Database.LeadConvert lc = new Database.LeadConvert();
              
               
               lc.setLeadId(lead.Id);
              
               lc.setConvertedStatus(convertStatus.MasterLabel);
               
               leadConverts.add(lc);
          }
     }

     if (!leadConverts.isEmpty()) {
          List<Database.LeadConvertResult> lcr = Database.convertLead(leadConverts);
     }

Please help to slove above problems.

Regards,
Sarma
Hi Everyone,

Kindly provide the Pseudo code for Trigger to conversion from Lead to Account.

Thanks inadvance.

Regards,
Sarma

Hi All,

Please resolve the below issue. I am unable to search the values.

Component:
<aura:component controller="SearchApexClass" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <aura:attribute name="SkillsRequired" type="String"/>
    <aura:attribute name="Salary" type="Decimal"/>
    <aura:attribute name="RelatedExperience" type="Integer"/>
    <aura:attribute name="Search" type="String" default=""/>

    <form class="slds-form--Stacked form">
        <div class="slds Search">
            <div class="Seprator"> &nbsp; </div>
            <div class="slds-grid seprate">
                <div class="slds-form-element">
                    <h1> <b>Search Options</b> </h1>
                </div>              
            </div>       
        </div>
        <div> <br/>
            <p> Skills Required </p>
            <p><ui:outputText class="result" aura:id="singleResult" value="" /></p>
            <ui:inputSelect class="single" aura:id="SkillsRequired" change="{!c.SkillChange}">
                <ui:inputSelectOption text=" "/>
                <ui:inputSelectOption text="Salesforce Admin"/>
                <ui:inputSelectOption text="Salesforce Developer"/>
                <ui:inputSelectOption text="SFDC-Integration"/>
                <ui:inputSelectOption text="SFDC-Lightning"/>
            </ui:inputSelect>
            <br/><br/>
            <p> Salary (in LPA) </p>
            <p><ui:outputText class="result" aura:id="singleResult" value="" /></p>
            <ui:inputSelect class="single" aura:id="Salary" change="{!c.CurrencyChange}">
                <ui:inputSelectOption text=" "/>
                <ui:inputSelectOption text="4"/>
                <ui:inputSelectOption text="5"/>
                <ui:inputSelectOption text="6-7"/>
                <ui:inputSelectOption text="8-10"/>
            </ui:inputSelect>
            <br/><br/>
            <p> Related Experience(In Years)</p>
            <p><ui:outputText class="result" aura:id="singleResult" value="" /></p>
            <ui:inputSelect class="single" aura:id="RelatedExp" change="{!c.ExpChange}">
                <ui:inputSelectOption text=" "/>
                <ui:inputSelectOption text="1-2"/>
                <ui:inputSelectOption text="3-4"/>
                <ui:inputSelectOption text="5-6"/>
            </ui:inputSelect>            
        </div>    <br/>
       
        <div class="slds-grid buttons">   
            <lightning:button variant="brand" label="Search" onclick="{!c.SearchButtomClick}" />
        </div>  
    </form>
</aura:component>

Controller:
({
    doInit: function(component, event, helper) {
        helper.fetchPickListVal(component, 'Industry', 'accIndustry');
    },
    SkillChange: function(component, event, helper) {
        // get the value of select option
        alert(event.getSource().get("v.value"));
    },
    CurrencyChange: function(component, event, helper) {
        // get the value of select option
        alert(event.getSource().get("v.value"));
    },
    ExpChange: function(component, event, helper) {
        // get the value of select option
        alert(event.getSource().get("v.value"));
    },
    
    SearchButtomClick: function(component, event, helper) {
        //var Search = component.get("v.search");
        var action = component.get("c.Search");
        
        action.setParams({"SkillsRequired": component.find("SkillsRequired").get("v.value"),
                          "Salary" : component.find("Salary").get("v.value"),
                          "RelatedExp" : component.find("RelatedExp").get("v.value")});
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === 'SUCCESS') {
                var ids = response.getReturnValue();
                console.log('>>>>>' +ids);
            }
        });       
        $A.enqueueAction(action);
    }
    
})

Helper :
({
    doInit: function(component, fieldName, elementId) {
        var action = component.get("c.getselectOptions");
        action.setParams({
            "objObject": component.get("v.objInfo"),
            "fld": fieldName
        });
        var opts = [];
        action.setCallback(this, function(response) {
            if (response.getState() == "SUCCESS") {
                var allValues = response.getReturnValue();
 
                if (allValues != undefined && allValues.length > 0) {
                    opts.push({
                        class: "optionClass",
                        label: "",
                        value: ""
                    });
                }
                for (var i = 0; i < allValues.length; i++) {
                    opts.push({
                        class: "optionClass",
                        label: allValues[i],
                        value: allValues[i]
                    });
                }
                component.find(elementId).set("v.options", opts);
            }
        });
        $A.enqueueAction(action);
    },
})
Class:
public class SearchApexClass {
    @AuraEnabled
    public static List <String> getselectOptions(sObject objObject, string fld) {
        system.debug('objObject --->' + objObject);
        system.debug('fld --->' + fld);
        List <String> allOpts = new list < String > ();       
        Schema.sObjectType objType = objObject.getSObjectType();
        Schema.DescribeSObjectResult objDescribe = objType.getDescribe();
        map < String, Schema.SObjectField > fieldMap = objDescribe.fields.getMap();        
        list < Schema.PicklistEntry > values = fieldMap.get(fld).getDescribe().getPickListValues();             
        for (Schema.PicklistEntry a: values) {
            allOpts.add(a.getValue());
        }
        system.debug('allOpts ---->' + allOpts);
        allOpts.sort();
        return allOpts;
    }
public static string Search(String SkillsRequired, Integer Salary, String RelatedExp) {
         string returnvariable;
        list<Naukri__c> naukriList = new list<Naukri__c>();
        naukriList =  [SELECT Id,Skills_Required__c,Salary__c,Related_Experience__c FROM Naukri__c limit 10];            
        if(naukriList != null && !naukriList.isEmpty()){
            if(SkillsRequired==naukriList[0].Skills_Required__c && Salary==naukriList[0].Salary__c && RelatedExp==naukriList[0].Related_Experience__c){
                system.debug('Hiii');
                returnvariable = 'Welcome';
            }
            else{
                returnvariable = 'Please enter valid credentials';
            }
        }
        system.debug('Hiii'+ returnvariable);
        return returnvariable;   
    }
}

I am getting the error message like "This page has an error. You might just need to refresh it. Unable to find 'Search' on 'compound://c.Search'. Failing descriptor: {markup://c:Search}" while clicking on Search button.

Please look into it.

Thnaks,
Sarma

I have to create the login page with User name and pass word in salesforce lightning (Like Naukri home page).

I have created  the fields, but i am not able to do in controller for login button.

<div class="slds Naukri">
    <ui:inputtext aura:id="User" label=" User Name " class="" value="" maxlength="30" placeholder="Enter Email Id" required="false" size="20"/> <br/>
        <ui:inputSecret aura:id="pwd" label=" Password " class="" value="" maxlength="10" placeholder="Enter upto 10 character" required="false" size="20"/> <br/>
            <div class="slds-float--right slds-button_brand">
                <div class="slds-grid buttons">   
            <lightning:button variant="brand" label="Login" onclick="{!c.handleLoginButtomClick}" />
        </div>
    </div>
 </div>
Can you please help me in this.

Regards,
Sarma
Hi,

How to add space between two fields in lightning-SLDS.

Thanks,
Sarma
Hi,

Can anyone tell me,  Can we display the list of queues and public groups assigned to the particular user in report or dashboard?

Thanks in Advance.
Sarma
Hi All,

i want to assign the case to particualt queue based on code. 
Code is DEL, I can assign that case to the queue name which contains DEL as a admin

Please help for validation rule..

Thnaks,
Sarma
 
Hi All,

I have One Parent Object- Case and Child Object- Case Events. For every status change in case (like new, Pend, Reject) event is created in case events. if status changed 3 times 3 evenmts created in case events object.

Now we have one filed (Time) in case event i want to get that field value in case.

Please Help me how to proceed.

Thanks,
Sarma
Hi All,

When case status is updated, Total duration hours should be displayed in sub total column of report. Can any one please help me how to write trigger for this scenario. Its very urgent

Thanks In Advance.

Sarma
Hi All,

Please provide any sample code of Batch class to fetch the records based on time and date.

Thanks,
Sarma
Hi All,

Kindly provide the sample test class for Creating Installation Case records based on Application Status

Thanks & Regards,
Sarma
Hi All,

I have imported the list of accounts in CSV formate in visualforce page. i have 2 tasks.
1. I want to upload only 5 account records if it is more than 5 it should show the error message
2. What are the records i got in visual force page should save in account object once i click on save button in visual force page. please suggest.

code is below..

VisualforcePage:
<apex:page controller="importDataFromCSVController">
    <apex:form >
        <apex:pagemessages />
        <apex:pageBlock >
            <apex:pageBlockSection > 
                  <apex:inputFile value="{!csvFileBody}"  filename="{!csvAsString}"/>
                  <apex:commandButton value="Upload" action="{!importCSVFile}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock >
           <apex:pageblocktable value="{!accList}" var="acc">
              <apex:column value="{!acc.name}" />
              <apex:column value="{!acc.AccountNumber}" />
              <apex:column value="{!acc.Type}" />
              <apex:column value="{!acc.Accountsource}" />
              <apex:column value="{!acc.Industry }" />
        </apex:pageblocktable>
     </apex:pageBlock>
   </apex:form>
</apex:page>

Apex class:
public class importDataFromCSVController {
public Blob csvFileBody{get;set;}
public string csvAsString{get;set;}
public String[] csvFileLines{get;set;}
public List<account> acclist{get;set;}
  public importDataFromCSVController(){
    csvFileLines = new String[]{};
    acclist = New List<Account>(); 
  }
  
  public void importCSVFile(){
       try{      
        
           csvAsString = csvFileBody.toString();
           csvFileLines = csvAsString.split('\n'); 
            
           for(Integer i=1;i<csvFileLines.size();i++){
               Account accObj = new Account() ;
               string[] csvRecordData = csvFileLines[i].split(',');
               accObj.name = csvRecordData[0] ;             
               accObj.accountnumber = csvRecordData[1];
               accObj.Type = csvRecordData[2];
               accObj.AccountSource = csvRecordData[3];   
               accObj.Industry = csvRecordData[4];                                                                             
               acclist.add(accObj);   
           }
        //insert acclist;
        }
        catch (Exception e)
        {
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'Please upload the csv format file');
            ApexPages.addMessage(errorMessage);
        }  
  }
}




 
Hi All,

Can anyone ell me how to convert the lead from Web to Lead form to Direct account and contact please.

Its Urgent.

Sarma
Hi,

I am not able to run the batch for the below quesry.

i am getting below error messages after modifications also. kindly help.
1. First error: Only variable references are allowed in dynamic SOQL/SOSL.
2. First error: unexpected token: '='
3. IF i mention IN instead of = i got error message like First error: unexpected token: 'IN'
4. First error: expecting a colon, found 'NULLStatus__c'
5.First error: Too many query rows: 50001 (Main Error)

I want to  get all the ACTIVE status customers from orders.

Code:
global with sharing class Batch_ProductVolumeTarget_Stats implements Database.Batchable<sObject>
{
  public class X_Exception extends Exception{}

  global Database.QueryLocator start(Database.BatchableContext BC)
  {
    string  strQuery =
      ' select  Id'  +
      ' from     Order__c ' +
      ' where    Customer__C= NULL';
      
    return Database.getQueryLocator(strQuery);
  }

Regards,
Sarma
Hi All,

How to do lead conversion without creating an opportunity. (Only account and contact has to be created)

If the account is already exists contact detailes has to updated to that exisiting account and if the details are already there in salesforce and different from the requirement, we need to update those details in account and contacts.

Lead Conversion Code:

Trigger web2LeadConvert on Lead (after Update) {
     LeadStatus convertStatus = [
          select MasterLabel
          from LeadStatus
          where IsConverted = true 
          limit 1
     ];
     List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>();

     for (Lead lead: Trigger.new) {
          if (!lead.isConverted && lead.Status == 'Qualified') {
               Database.LeadConvert lc = new Database.LeadConvert();
              
               
               lc.setLeadId(lead.Id);
              
               lc.setConvertedStatus(convertStatus.MasterLabel);
               
               leadConverts.add(lc);
          }
     }

     if (!leadConverts.isEmpty()) {
          List<Database.LeadConvertResult> lcr = Database.convertLead(leadConverts);
     }

Please help to slove above problems.

Regards,
Sarma