• Subodh Kumar 42
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 2
    Replies
Hi All,
when ever we are selecting any record from list view and changing the lead status.
suppose lead status value:Open - Not Contacted 
and dependent value : A,B
User-added image

and after changing lead status value:Working - Contacted​​​​​​​ 
we are not chaning the depend field so the value is still same A ,B
which is not correct because for Working - Contacted we have dependent value :C and D
User-added image

how can we change dependent value also or restrict  wrong value ?

as we can see the extra picklist value is coming as below : A is not correct value for Working - Contacted​​​​​​​ .
User-added image
 
Hi All,

Suppose we have record type1 : values :a,b,c,d,e,f,g,h,i
                              record type2 : values:a,b,c,d,e,Z

from backend we are able to update Z value in record type1.

How can we stop that.
Can we use valdaition rule?
Thanks,
Hi All,

I want to restrict change status picklist value for every diffeent record type
User-added image

Suppose record type1 : a,b,c (picklist values)
        record type2 :a,b,c,d

for when I select  record type1 in the record the change status tab should have value a,b,c only.
User-added image

in above screenshot i dont want negotiation piclist value.

How can we achieve this funtionality.

Thanks
Hi All,

I have two fields 
1.abc (Date)
2.def (picklist) (2020,2021,2022,2023,2024......2050).
I want to create 3rd field (FORMULA FILED) where I want to update def based on abc whenever I choose any date from abc field the year should get coppied to the field def.

example :
abc : 1/2/2020
def : 2020

I have same logic on process builder which I want to deactivate and
write formula field.

Thanks,
Subodh

 
Hi All,

Whenever we are giving input to comment field ,it is overflowing the value as below screenshot.
User-added image
below is lightning code used for this.Can someone suggest me what is causing this issue ?

<div class="slds-section slds-is-open">           
               <div class="slds-grid slds-wrap slds-grid--pull-padded">                                                               
                              <div class="slds-p-horizontal--small slds-size--1-of-2">
                                             <div class="slds-form-element slds-hint-parent slds-has-divider--bottom slds-p-around--x-small hasDiv">
                                                            <label class="slds-form-element__label">comment</label>
                                                            <div class="slds-form-element__control" style="min-height: 18px;">
                                                                           <aura:if isTrue="{!v.isEditPage}">
                                                                                          <ui:inputText class="slds-output" value="{!v.Oppty.Comment__c}" maxlength="100"/>
                                                                                          <aura:set attribute="else">
                                                                                                         <ui:outputText class="slds-output" value="{!v.Oppty.Comment__c}" />
                                                                                                         <span class="slds-float--right litIcon editIcon" onclick="{!c.changeEditLayout}">
                                                                                                                        <lightning:icon iconName="utility:edit" size="xx-small" alternativeText="Indicates approval"/>
                                                                                                         </span>
                                                                                          </aura:set>
                                                                           </aura:if>
                                                            </div>
                                             </div>
                              </div>                  
               </div>
</div>

Thanks,
Subodh
 
I am writing Batch Apex Query String where the soql limit I want to avoid.How can we avoid the limit in below batch code ?

     DateTime currentTime = System.now();
      DateTime ddd = currentTime.addHours(-2);
      list<Total__c> campaignInfluenceList = new List<Total__c>();
      campaignInfluenceList = [select Id,CampaignId__c,OpportunityId__c,CampaignId__r.unique__c from Total__c where lastmodifieddate>=:ddd];
            Set<Id> oppIds = new Set<Id>();
//how to avoid soql limit in below for loop.
            for(Total__c d:campaignInfluenceList){
                oppIds.add(d.OpportunityId__c);
             }
             
                  String str = 'opportunityCreatedFromLead';
     string query='Select Id,Name,unique__c,Type,Lead_ID__c,createdby.profile.Name,(select Id,CampaignId__c,OpportunityId__c,CampaignId__r.Source__c from Total__r ) from Opportunity where id=: oppIds ';
     
     return Database.getQueryLocator(query); 

Thanks,
How to write test class for below class

 global void execute(Database.BatchableContext bc, List<opportunity> scope){
 List<opportunity>  ls=new list<opportunity>();
  Map<Id,opportunity> update = new Map<Id,opportunity>();
  for(opportunity oppty:scope){
 if(oppty.abc=='P' && oppty.abc!='M' 
                           && oppty.createdby.profile.Name=='Custom: TCT'){
                            oppty.abc='M';
                             //Updated below opptyListUpdate List to update Map as to avoid duplicate values
                             update.put(oppty.Id,oppty);
                             ls.add(oppty);
                             break;
Hi All,
How to find opportunity id for last 2 or 3 hours in soql ?
I want to use this in batch apex as query string in where clause.

Currently I am using below code for retriving id for one day with help of custom setting:
=============================
from Opportunity where\t'; query += 'createddate = '+day; //custom setting

Thanks,
Subodh
It is shwing error "suken--crmdev1.cs97.my.salesforce.com refused to connect."

can we do any changes in code ?
<apex:page>
  
  <script type="text/javascript">
  var one = true;
  var window;
  
window.onload = function() {

if(one == true) {
 var Id= "{!$CurrentPage.Parameters.Id}";                    

var newwindow = window.open('/apex/managed_package_visualforce_page1?Id='+Id,target="_self");
  newwindow.focus(); 
  
if(newwindow != '' && newwindow != null){
var newwindow1 = window.open('/apex/managed_package_visualforce_page1?Id='+Id, '_self');
newwindow1.focus(); 
}
one = false;
}  
};
</script>  
</apex:page>
After deploy in QA the code coverage is showing 0% in QA but in dev its 100% 
After running test class in qa its showing below error

Internal Salesforce Error: 992167576-63130 (-2133302522) (-2133302522)
I have a trigger with below logic with that logic I want to create batch apex  and schedule it daily.
Can we do it with below logic or need to write complete different code ?


public class handlerclass{
public static void methodname(List<sbject> newlist,Map<Id,sobject> oldmaplist){

    set<Id> oppIds = new  set<Id>();
    Map<Id,osbject1> oppupdate = new Map<Id,osbject1 >();
    for(sobject__c so: newlist){
        
        if(so.sobject1Id__c!=null)
           oppIds.add(so.sobect1Id__c);

    }

        if(!oppIds.isEmpty()){
            for(sobeject1 oppty : [Select name,id,address__c from osbject1 where uid='frame']){
                    
                    if(condition){
                        
                        for(loop){
                            if(condition){
                                
                                if(condition);
                                   //assigment logic';
                                   
                                    //update logic
                                    break;
                                }
                                if(condition){
                                    //assigment logic';
                                   
                                    //update logic;
                                    break;
                                }
                                if(condition){
                                    //assigment logic';
                                   
                                    //update logic;
                                   
                               }
                            }
                        }
                    }
After converting lead ,I am not able to find active trigger logs in debug logs for campaign confluence but there is an active trigger.
even though one opportunity record and one campaign Influence record  is getting created.
class

//avoid dublicate record

public class dubli{

public static void avoid(list<trigger_object__C> ls)
{
set<string> stname=new set<string>();

for(trigger_object__c s:ls)
{
stname.add(s.city__c);

}
list<trigger_object__C> trlist =[select id,city__c from trigger_object__C where name in :stname];
map<string,trigger_object__C> maptr=new map<string,trigger_object__C>();
for(trigger_object__C s: trlist ){

maptr.put(s.city__c,s);
}

for(trigger_object__C s: ls){

if(maptr.get(s.city__C) != null){

s.adderror('dont insert duplicate name');
}

}
}
}


trigger:

trigger dup on trigger_object__c (before insert,before update) {

dubli.avoid(trigger.new);

}
What will be execution
priority of below in salesforce :

1.after update workflow  
2.procees builder  
3.aproval procees
4.workflow
Suppose we have India and Japan ,we have to create profile for a company called ATTMA but the employees from India should not see Info of Japan employees and vice-versa.
But CEO and CFO is same for both countries.
Is any another way to call future method in batch apex? As we know that we can not call from one asynchronous process from another asynchronous process.
we can not call one asynchronous process to another asynchronous process but how can we call from one batch to another batch since batch is also asynchronous process?
How can we track failed records in batch apex? suppose we are updating 100000 records out of that 20000 records are failed so again I want to update only failed records.How can we achieve this?

Thanks
What will be execution
priority of below in salesforce :

1.after update workflow  
2.procees builder  
3.aproval procees
4.workflow
we can not call one asynchronous process to another asynchronous process but how can we call from one batch to another batch since batch is also asynchronous process?