• Surender reddy Salukuti
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 5
    Likes Received
  • 0
    Likes Given
  • 66
    Questions
  • 16
    Replies

Hi all,

Using the wraperr class, I'm getting two maps; one contains ID and toggle value(true or false) and the other contains user id and name in both maps id value same . In one list or map, I need to store the Id, Username, and toggle value and do the Aura iteration. How can I do that,

Thank you ,
Surender reddy 

Hi all,


We have a requirement where AgentOwner should be able to give assign permissionset to AgentStaff.

We created a lightning component with toggle button, when Agent set checks the toggle 'ON', we are updating a custom checkbox create on user object as true.

While doing so we are getting an error message

common.apex.runtime.impl.DmlExecutionException: Update failed. First exception on row 0 with id 0053i00000213MhAAI; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id:

Please let us know how to address this with out giving manage user permission

P.S: We already checked field permission. and we are following territory based hierarchy

Thank you,

Surender Reddy

Hi all ,

I have one requirement i need to bypass validation rule for one profile using apex class code not trigger how can i do that .
can any one help me on this 

 

Hi ,
i have one requirement i need to get id value which i passing  to pass 
  <lightning:input type="toggle" name="{!Names.key}"  onchange="{!c.selectChange}" messageToggleActive="On" messageToggleInactive="Off" checked ="{!Names}" style="float:right;text-align: center;" ariaLabel="Enhance Goals Permission"/>

i am trying like below 

var fieldName1 = event.getSource().get("v.name");

help me any one on this 

Hi all ,

i have one requirement i need to by pass one validation rule for particular users  by using apex class how can i do that .

 

Thank you 

Surender Reddy

Hi i have a one requirement i need to saparate values in a map i am geeting id and value in salesforce lightning 
'{"0053i00000213MhAAI":"Sarah Orosco","0053i00000215NfAAI":"Diana Chavez","0053i00000218YZAAY":"Shannon Fortner","0053i0000021AQ6AAM":"Sharon Snyder","0053i00000215HJAAY":"Diana Karch"}'

getting output like above i need to store names in one list how can i do that in salesforce lightning aura component .
below is my code 
doInit: function(component, event, helper) {
        // Create the action
        let action = component.get("c.retrieveAgentDMName");
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            let state = response.getState();
            console.log('response.getState()'+state);
            if (state === "SUCCESS") {
                console.log("Success" +response.getReturnValue());
                 console.log("stringify"+JSON.stringify(response.getReturnValue()));
                component.set("v.agentsNameWrapper", response.getReturnValue());
                component.set("v.agentsNames", JSON.stringify(response.getReturnValue().useridToNames));
                             
            }

please help me on this .

Thank you ,
Surender Reddy 

Hi all 

i have one requirement i am converting lead to account using custom logic preventing  Opportunity creation i need to prevent contact convertion also by suing any logic any one have any idea
please find below code which i am using 

 @AuraEnabled 
    public static id convertlead (Id recordId){
        id accountid;
        lead le = new lead();
        le.Id=recordId;
        le.RecordTypeId = Schema.SObjectType.Lead.getRecordTypeInfosByDeveloperName().get('Business_Insurance').getRecordTypeId();
         system.debug('recordtypeid--> '+le.RecordTypeId);
        Database.LeadConvert lc = new Database.LeadConvert();
        lc.setLeadId(le.Id);
         system.debug('lc value --> '+lc);
        LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
        lc.setConvertedStatus(convertStatus.MasterLabel);
        lc.setDoNotCreateOpportunity(true);
        Database.LeadConvertResult lcr = Database.convertLead(lc);
        accountid =lcr.getAccountId();   
        return accountid;
    }

 

Thanks 

surender Reddy

Hi all ,
I have a one requirement i am converting account to lead by using quick action component after convertion navigating to record page   this requiremnet i have completed but after navigating to record page i need to call custom quick action component and open popup how can i do this ,
please find the below code for your reference .

handleClick : function(component, event, helper) {
       component.set('v.showProgressbar', true); 
        var recordid = component.get("v.recordId");
         var action = component.get("c.convertlead"); 
        action.setParams({
            recordId : component.get("v.recordId")
        });
        action.setCallback(this, function(a) {
            $A.get("e.force:closeQuickAction").fire();
            if (a.getState() === "SUCCESS") {
                var output = a.getReturnValue();
                component.set('v.showProgressbar', false);
                component.set('v.accountid',output);
                var navEvt = $A.get("e.force:navigateToSObject");
                navEvt.setParams({
                    "recordId": component.get("v.accountid")
                });
                navEvt.fire();
            }
            else if(a.getState() == "ERROR"){
                 var errorMsg = a.getError()[0].pageErrors[0].message;
                var toastEvent = $A.get("e.force:showToast");
                toastEvent.setParams({
                    "type" : "error",
                    "message": errorMsg
                });
                toastEvent.fire();
            }
            
        });
        $A.enqueueAction(action);
        
    },

Hi any one can help me on this requirement 

I am using  <lightning:recordViewForm to show the records i need to show only 3 records in below picture it's showing four recoredes 

i am using  code

 <lightning:recordViewForm density="compact" aura:id="recordHandler" recordId="{!item.Id}" objectApiName="Quote__c">
                            <lightning:outputField fieldName="Quote_Number__c" />
                            <lightning:outputField fieldName="Quote_Status__c" /> 
                            <lightning:outputField fieldName="Total_Quote_Premium__c" /> 
                    </lightning:recordViewForm> 

User-added image

Hi i have a requirement how can i pass record id value in url plese help me on this i have tried with below code but not working 

var recordid= component.get("v.recordId");
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url": "https://farmersagent--intdev.lightning.force.com/lightning/r/Account/0011b00000xc84cAAA/related/Quotes__r/view?0.source=alohaHeader"
        });
        urlEvent.fire();
       
    },
if i hardcode id it working fine 
in place of 0011b00000xc84cAAA this id replace with recordid it's not working can any one help me on this 

Thanks ,

Surender Reddy 

Hi every one i am facing one issue related to styling find the below screen shot and information User-added imageWhen i over on the Q- 60724483 but popup is showing above plese find the code below 

 <a  onmouseenter="{!c.handleMouseHover}" onmouseout="{!c.handleMouseOut}" >{!item.Name}</a>
                     
                          <aura:if isTrue="{!v.togglehover==true}">
                              <div   class="slds-popover slds-nubbin_bottom"
                                   role="tooltip" id="help" style="position: absolute; right: 225px; bottom: 100%; width: 22rem; padding: inherit;">
                                  <lightning:icon iconName="custom:custom64" title="Quotes" /> <br/>
                                  Line of Business: {!item.Line_of_Business__c}<br/>
                                  Quote Status:{!item.Quote_Status__c}<br/>
                                  Premium:{!item.Total_Quote_Premium__c}<br/>
                              </div>
                      </aura:if>
please help if i coded wrong 

Thanks 

Surender 

Hi all i have one requirement related to styling of <lightning:buttonMenu >  please find below screen shotUser-added imagei need to show button menu below the new button can any one help me on this 

Hi all i have one requirement we need to show hyperlink for quote number when we hover on it it will show lightning card like below screen shot 
User-added imageplease help me on this use case 

 

Thanks 

surender 

Hi i have one requrement i need to create custom lightning component using lightning data service User-added imageabove type i need to develop please help me any one on this use case 

Thanks 

surender 

Hi all i have one requirement i need to show related list information using lightning data service please find below screen shot User-added imagecreate custom lightning component .

Thanks 

surender 

Hi i have a one requirement i need to create lightning custom component to show  as look like below screen shot .
User-added imagecan any one help me on this .

Thanks 

Surender 

Hi all,

i have one requirement i need to assign a permission set when a new user is insrted with a particular role in system how can i do this by using a trigger ? 

Thanks 

 

Hi all,

how can i assign permission set to particular user role using bacth apex help me any one ? 

Thank you

 

Hi all,

i have one requirement  how can i assign permission set to two
different roles by using batch apex can any one help me on this 

Thank you 

Surender reddy.

Hi all,

I have a one Permission Set Group name is AFTR_Baseline i need to assign this permission set to licence to more users how can i assign them it can be batch class or bulk api or any other solutions help me on this scenario .

Thank you,

Surender Reddy.

Hi all , 

i have one requiremnt i need to get numaric value from string field how can i get in apex
Eg: String name= 'Auto - New Business - Count;Premium - 500';
from above string name i nedd to fetch 500 how can i do that 
i used one method 
String name= 'Auto - New Business - Count;Premium - 500';
String substr = name.substringAfter('-');
system.debug('substr'+substr);
but hear i am getting - New Business - Count;Premium - 500' total value but i need only 500 .
how can i do that some one help me please 

Thank you 
Surender Reddy

 

Hi Every one,

I need to disable keyboard functionalites in salesforce lightning how can we do that ? 
Like  key E functionaliy while clicking E it's opening Edit details.. 
 If any one know please  help me .
 
Thanks
Surender reddy
Hi Everyone,

When i am writting Pd1 maintance exam i got error 


When executed, the BatchLeadConvertTest test class has test failures. All tests should pass.

Thank you
Hi Every one,

i am new to lightning i am learning know

i wrote apex class-

public class Lightning_3 {
   
    @AuraEnabled
    public static List<contact> show(){
        List<contact> contacts=[select id,FirstName,LastName,phone from contact limit 5];
        return contacts;
    }
  }
and after i design my component
.<aura:component controller="Lightning_3" >
    <aura:attribute name="contacts" type="List"/>
    <aura:attribute name="columns" type="List"/>
    <aura:handler name="init" value="{!this}" action="{!c.callme}"/>
    <lightning:DataTable keyfield="id" data="{!v.contacts}" columns="{!v.columns}"/>
</aura:component>
and after my controller
({
    callme : function(component, event, helper) {
        
        component.set('v.columns',[
            
            {label: 'FirstName', fieldName: 'FirstName', type: 'text'},
            {label: 'LastName', fieldName: 'LastName', type: 'text'},
            {label: 'phone', fieldName: 'phone', type: 'text'},
            
        ]);
            var action=component.get("c.show");
            action.setCallback(this,function(response){
               var state=response.getState();
               if(state==='SUCCESS'){
              
                var result=response.getReturnValue();
                component.set("v.data",result);
              }
            });
            $A.enqueueAction(action);
          }
})

actuall my task is to show contact recorrds on data table using apex in lightning
when i running this program it snot showing any error but i am not getting out put it s showing blank page.
if you know any one help me.

Thank you
Surender reddy.

 
Hello,
I have a component which has a list of Account records. I just want to collect all selected records ids and pass those to Apex class.

Thank you in advance!

List of Account records

Hi i have a one requirement i need to create lightning custom component to show  as look like below screen shot .
User-added imagecan any one help me on this .

Thanks 

Surender 

Hi all,

i have one requirement i need to assign a permission set when a new user is insrted with a particular role in system how can i do this by using a trigger ? 

Thanks 

 

Hi all,

I have one requirement i want to get only integer values and only Decimal values from string 

Eg :
string str = 'Commercial-(Aug)Quoted-Count300Premium - 250.00-Sarah Orosc';
from hear i want only integer value 300 

string str 2= 'Commercial-(Aug)Quoted-Count500Premium - 350.00-Sarah Orosc';

from hear i want only Decimal value 350.00
i am trying with one solution 

String numberOnly = str2.replaceAll('[^0-9]', '');or 
String numberOnly = str.1replaceAll('[^0-9]', '');
by using above conditions i am getting integer and Decimal values 

Please me on this any one 

Thank you, 

Surender Reddy


 

Hi Everyone 

I have a requirement I need to show error messages in UI Based on error codes 

Error codes are provided from the client I am following the method 

if(errorcode == '20002'){
component.set ('v.message','Detailes are not correct');

}

But hard coding error codes are not good practice how can I implement this functionality 

 

Thank you 
Surender reddy

 

HI ,

How can i close popup when i click ESC button on Key boar in salesforce lightning .

Please provie me solution 

Thank you
Surender reddy
 
Hi,

i wrote this in appexclass
public class Trigger_Opportunity_Handler{
    public static void afUpdate(map<Id,Opportunity>  oldMap, map<Id,Opportunity>  newMap){
        set<id> optyids=oldMap.keyset();
        User u=[select id from User where alias='udemo'];
           list<OpportunityTeamMember> teams=new list<OpportunityTeamMember>(); 
        for(Id key:optyIds){
            Opportunity old=oldMap.get(key);
            Opportunity optyNew=newMap.get(key);
            if(old.StageName!='Closed Won'&&optyNew.StageName=='Closed Won'){
                OpportunityTeamMember ot=new OpportunityTeamMember();
                ot.opportunityId=key;
                ot.UserId=u.Id;
                ot.TeamMemberRole='Account Manager';
                ot.OpportunityAccessLevel='Edit';
                teams.add(ot);
                }
        }
        insert teams;
    }
}
Error-
Variable does not exist: StageName
Hi ,
i wrote program using combination of appex and visual force 

apexprogram-
public class Example_pr2 {
    public account acc {set;get;}
    public opportunity opty {set;get;}
    
    
    public Example_pr2(){
        acc= new account();
        opty =new opportunity();
    }

}
and visual force program 
<apex:page controller="Example_pr2">
    <apex:form>
    <apex:pageblock>
        <apex:pageBlockSection title="Account">
         <apex:inputField value="{!acc.name}"/>
         <apex:inputField value="{!acc.phone}"/>
         <apex:inputField value="{!acc.industry}"/>
          <apex:inputField value="{!acc.rating}"/>
          <apex:inputField value="{!acc.ownership}"/>
        
        </apex:pageBlockSection>
        <apex:pageBlockSection title="opportunity">
            <apex:inputField value="{!opty.name}"/>
            <apex:inputField value="{!opty.StageName}"/>
            <apex:inputField value="{!opty.closedate}"/>
            <apex:inputField value="{!opty.Amount}"/>
          </apex:pageBlockSection>
        </apex:pageblock>
    </apex:form>
 </apex:page>

but i am getting error in opportunity fields 
error message-
Could not resolve the entity from <apex:inputField> value binding '{!opty.name}'.  <apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable.


 
when i written the below  program using batch apex topic its getting error in line 1 and 6
global class Batch_Example implements Database.Batchable<sobject>{
    global Database.QueryLocator start(Database.BatchableContext bc){
        String query='Select id,name.stagename,CloseDate from opportunity Where Createddate=THIS_MONTH';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext bc,List<opportunity> optList){
        for(opportunity op:optList)
        {
            op.StageName='closed Won';
            op.Closedate=system.today();
        }
        update optList;
    }
    global void finish(Database.BatchableContext bc){
        
    }

}

error message -1.Class Batch_Example must implement the method: void Database.Batchable<SObject>.execute(Database.BatchableContext, List<SObject>) 
2.global methods do not support parameter type of List<Opportunity>
i written this in appex class 
public class Soql_Example3 {
    public List<Account> accounts      {set;get;}
    public List<selectoption> options  {set;get;}
    
    public Soql_Example3(){
        accounts = [select id,Name,phone from account];
        options = new List<selectoption>();
        
       selectoption n = new selectoption('none','-None-');
        options.add(n);
        
        for(account a:accounts){
            selectoption op = new selectoption (a.Phone,a.name);
            options.add(op);
            
        }
        
        
        
        
        
        
    }
     
    

}

i written this in visual force
<apex:page controller="Soql_Example3" >
    <apex:form>
    <apex:selectList size="1">
        <apex:selectOptions value="{!options}"/>
        
        
        </apex:selectList>
    
    </apex:form>
</apex:page>

when i execute this program iots getting error message 
Error-
Argument 1 cannot be null 
An unexpected error has occurred. Your development organization has been notified.
<apex:page standardController="Loan" >
    <apex:sectionHeader title="Loan" subtitle="Loan details"/>
    <apex:form>
    <apex:pageBlock title="Loan Edit">
       <apex:pageBlockButtons location="top">
           <apex:commandButton value="Save"/>
           <apex:commandButton value="cancel"/>
           <apex:commandButton value="save&New"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection>
        <apex:inputField value="{!Loan__c.Loan_Type__c}" />
            <apex:inputField value="{!Loan__c.payment__c}"/>
            <apex:inputField value="{!Loan__c.Payment_date__c}"/>    
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
</apex:page>

When i run this program its showing error
errorMessage-Loan does not exisit
Hi Everyone,

My Scenario is create two fields
product category” as the first lookup(Product2) and then the “Product Name/Code” as the second lookup(Product2) into Child Object (Request__c).

Note:  here main problem is reffering same Parent Object(Product2) in Child Object

Here my client expecting first lookup user going to select perticuler Category 

Product Category 
Samsung
IPHONE
SONY

Samsung :(user Clicks First lookup values is Samsung in second lookup need to display some dependeny mentioned below )

Product  Name/code(Lookup)
S-3652
S-2564
S-1234

IPHONE:(user Clicks First lookup values is IPHONE in second lookup need to display some dependeny mentioned below )

Product name/code(Lookup)
I6
I7
I8

Sony:(user Clicks First lookup values is Sony in second lookup need to display some dependeny mentioned below )

Product Name/code(Lookup)
Sony-1234
Sony-5664
Sony-4568

I'm implemented same functionlity using picklist dependency its working fine but my client expecting above scenario. 

Can you please guide me how to achive this scenrion in Salesforce .


PFA

User-added image