• raja
  • NEWBIE
  • 50 Points
  • Member since 2014
  • Y

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 7
    Questions
  • 15
    Replies
Challenge Not yet complete... here's what's wrong: 
Account setup for challenge incomplete. Please add 'Prospect', 'Customer' and 'Pending' picklist values to the Account 'Type' field

Here is my account type screen:
Account Type Fields

Please help
Hi All,

I am getting error message like "There was an error converting the lead. Please try again. If the problem persists, please contact your administrator." . But the lead is sucessfully getting mergedby batch Apex. 

  I chekced Validation rules , WF,Data validation etc.. But i am unable to figure out .

In which case we can get these type of errors in Apex .


Regards,
Raja.
 
  • January 09, 2018
  • Like
  • 0
I  am tryig to merge duplicate leads based on external id  in batch Apex.it is sucessfully merging lead records. But i am getting  exception like "Lead Merge Failed for master lead with id: null due to error: entity is deleted ".
Here is  the piece of code .
for(Database.mergeResult mr : results ){
                                if(!mr.isSuccess()){
                                    for ( Database.Error err: mr.geterrors() ){
                                        System.Debug('Lead merge failed for master lead with id: ' + mr.getId() + ' due to error: ' + err.getmessage()  );
                                        eMsg += '\nLead merge failed for master lead with id: ' + mr.getId() + ' due to error: ' + err.getmessage() + '\n';
                                        errorFound = true;
                                    }
                                }
                            }

Regards,
Raja.
 
  • December 08, 2017
  • Like
  • 0
Hello All,

I need to update casecooment under case object . but while trying to update , it is throwing error meesage like "SObject row was retrieved via SOQL without querying the requested field: Case.ParentId"
Code snippet is below :


global class Case_Update implements Database.Batchable<sObject>, database.stateful
{
        List<Case> childrenToUpdate = new List<Case>();
        
        Set<Id> parentIds = new Set<Id>();
        List<Case> parentCase = [SELECT  id, Master_Ticket__c, resolution_notes__c,Status,Resolution_Type__c,Do_Not_Send_Email__c,Description, (Select id ,parentId, CommentBody From Case.CaseComments) FROM case WHERE is_Master_ticket__c= TRUE AND Master_Ticket__c =''];
           
         global Database.QueryLocator start(Database.BatchableContext BC) {
           for(Case p:parentCase ){
            parentIds.add(p.id);
           }
            return Database.getQueryLocator('SELECT Id,Master_Ticket__r.resolution_notes__c,parentId,Master_Ticket__r.Resolution_Type__c,Master_Ticket__r.Status,Master_Ticket__r.Do_Not_Send_Email__c FROM Case WHERE master_ticket__c IN :parentIds');     
        }
        global void Execute (Database.BatchableContext BC,List<case> scope) {
            List<casecomment> lcm = new List<casecomment>();
            
        if(parentIds.size() > 0) {
            for(Case ch : scope) {
                casecomment cm = new casecomment();
                casecomment cmp = new casecomment();
                cm.id = ch.Master_Ticket__r.parentid; 
                //cm.parentid = ch.parentid;
                //cm.commentbody=ch.Master_Ticket__r.commentbody;
                lcm.add(cmp);
                lcm.add(cm);
                system.debug('******************************'+cm);
                ch.resolution_notes__c   = ch.Master_Ticket__r.resolution_notes__c;
                ch.Resolution_Type__c=ch.Master_Ticket__r.Resolution_Type__c;
                ch.Do_Not_Send_Email__c= ch.Master_Ticket__r.Do_Not_Send_Email__c;
                ch.Status=ch.Master_Ticket__r.Status;
                 childrenToUpdate.add(ch);
                 System.debug('childrecord ' + childrenToUpdate);
            }
            Update childrenToUpdate;
            update lcm;
            system.debug('============================================'+lcm);
         
            }
            
          }
        global void finish(Database.BatchableContext BC){
         
          }    

}

Regards,
Raj
  • June 16, 2017
  • Like
  • 0
Hello All,

I  have one of the formula field called " Case status" .  "Case status is a formula field " will update green,red ,yellow icon  . Now  I have requirement like , based on "Case status"(Formula Field) and case "Type"(Picklist) field , i need to create another formula field . How can i achecive this ?

For example : If  Case status = "Green" Icon and Type ="Other" then case violation ="Low"
                         Case status ="Yellow" Icon and Type =""structural" then case Violation ="Medium"
                         Case status ="Red" Icon and  Type =" Electrical" then case violation ="High"

How can i achecive this ?

Regards,
Raja.
  • December 19, 2016
  • Like
  • 0
In accont object we have two record types . While choosing one record type it needs to go standard page layout .But when user selecting second record type it needs to route to Custom VF . But  Here While users click on continue , it is not routing to custom VF. 

User-added image
Regards,
Raja.
  • December 09, 2016
  • Like
  • 0
Hello All,

I have a requirement like , i want to display3 checkboxes in VF and then  if suppose 2 checkboxes are checked , i need to dsplay Corrected values :Scope,Budget.  How can i perform this requirement ?

User-added image

I tried like below :
i created one of the picklist with three values . displayed those 3 values as checkboxes in VF. but after saving this record the values are not showing in the related list. and one more is ,if user tried to edit record it is showing picklist. not checkbox . please find attached screenshot for reference
  • November 02, 2016
  • Like
  • 0
Hi All,


We  are  using custom settings for this piece of code . when wetry to update base on the territory we are getting below error .

Upsert failed . first exception on row 0 with id  a2X700000003fFAEAY ; First Error : Field_Integrity_Exception , there is already an item in this list with name 00570000002VGbcAAG.

How to get rid of this error ?

Here is the piece of code :

Here " Territory_Names__c" is  the custom setting .

public void updateFilters()
{
List<String> territoryNames = new List<String>();
        for(Territory territory : selectedTerritories.values()){
            territoryNames.add(territory.Name);
        }
erritoriesSynced.Territory_Names__c = String.join(territoryNames, ',');
        upsert territoriesSynced;



Thanks in advance
  • October 09, 2014
  • Like
  • 0
Challenge Not yet complete... here's what's wrong: 
Account setup for challenge incomplete. Please add 'Prospect', 'Customer' and 'Pending' picklist values to the Account 'Type' field

Here is my account type screen:
Account Type Fields

Please help
Hello All,

I need to update casecooment under case object . but while trying to update , it is throwing error meesage like "SObject row was retrieved via SOQL without querying the requested field: Case.ParentId"
Code snippet is below :


global class Case_Update implements Database.Batchable<sObject>, database.stateful
{
        List<Case> childrenToUpdate = new List<Case>();
        
        Set<Id> parentIds = new Set<Id>();
        List<Case> parentCase = [SELECT  id, Master_Ticket__c, resolution_notes__c,Status,Resolution_Type__c,Do_Not_Send_Email__c,Description, (Select id ,parentId, CommentBody From Case.CaseComments) FROM case WHERE is_Master_ticket__c= TRUE AND Master_Ticket__c =''];
           
         global Database.QueryLocator start(Database.BatchableContext BC) {
           for(Case p:parentCase ){
            parentIds.add(p.id);
           }
            return Database.getQueryLocator('SELECT Id,Master_Ticket__r.resolution_notes__c,parentId,Master_Ticket__r.Resolution_Type__c,Master_Ticket__r.Status,Master_Ticket__r.Do_Not_Send_Email__c FROM Case WHERE master_ticket__c IN :parentIds');     
        }
        global void Execute (Database.BatchableContext BC,List<case> scope) {
            List<casecomment> lcm = new List<casecomment>();
            
        if(parentIds.size() > 0) {
            for(Case ch : scope) {
                casecomment cm = new casecomment();
                casecomment cmp = new casecomment();
                cm.id = ch.Master_Ticket__r.parentid; 
                //cm.parentid = ch.parentid;
                //cm.commentbody=ch.Master_Ticket__r.commentbody;
                lcm.add(cmp);
                lcm.add(cm);
                system.debug('******************************'+cm);
                ch.resolution_notes__c   = ch.Master_Ticket__r.resolution_notes__c;
                ch.Resolution_Type__c=ch.Master_Ticket__r.Resolution_Type__c;
                ch.Do_Not_Send_Email__c= ch.Master_Ticket__r.Do_Not_Send_Email__c;
                ch.Status=ch.Master_Ticket__r.Status;
                 childrenToUpdate.add(ch);
                 System.debug('childrecord ' + childrenToUpdate);
            }
            Update childrenToUpdate;
            update lcm;
            system.debug('============================================'+lcm);
         
            }
            
          }
        global void finish(Database.BatchableContext BC){
         
          }    

}

Regards,
Raj
  • June 16, 2017
  • Like
  • 0
Hi
I have brief knowledge on OWD and sharing settings.
Please explain how OWD=Controlled By parent  actually works.
what it can impact?

also say OWD=private / public readonly for account object, if I share set of records using sharing criteria to a group of users will they also have
access to related contact , opportunity & cases records?

Thanks
vandana 

 
HI All,

We have decided to include a 'Postage and Handling' fee for all opportunities that are created under $100.

By that I want any opportunity that is created and saved under $100 to automatically added an opportunity product of 'POSTAGEHANDLING' with a price of $9.95.

What (if any) would be the easiest way to achieve this? I have tried using a workflow but couldnt achieve the correct outcome.

Any ideas would be greatly appreicated.

Ray
I am having a custom object which is lookup to opportunity.So i am having CO__c field on Opportunity and Opportunity is related list on Custom object.
So  i can link Opportunity to custom object,
I am trying to do this using apex trigger.
Every night custom object records are deleted and recreated,so each time on insert of custom object data,i want to check one particular field and match with opportunity based on that field.

Please help!!
At the time of Opening OST file it gives lots of error messages how to remove OST File Error . Suggest me the best tool to repair OST file data and convert OST file data to PST By using single tool
Hello All,

I  have one of the formula field called " Case status" .  "Case status is a formula field " will update green,red ,yellow icon  . Now  I have requirement like , based on "Case status"(Formula Field) and case "Type"(Picklist) field , i need to create another formula field . How can i achecive this ?

For example : If  Case status = "Green" Icon and Type ="Other" then case violation ="Low"
                         Case status ="Yellow" Icon and Type =""structural" then case Violation ="Medium"
                         Case status ="Red" Icon and  Type =" Electrical" then case violation ="High"

How can i achecive this ?

Regards,
Raja.
  • December 19, 2016
  • Like
  • 0
In accont object we have two record types . While choosing one record type it needs to go standard page layout .But when user selecting second record type it needs to route to Custom VF . But  Here While users click on continue , it is not routing to custom VF. 

User-added image
Regards,
Raja.
  • December 09, 2016
  • Like
  • 0
Hi,

am new to salesforce i want to write SLDC Dev 1 certification. Can any one suggest me what books can i refer?


Thanks in advance.
Hi All,


We  are  using custom settings for this piece of code . when wetry to update base on the territory we are getting below error .

Upsert failed . first exception on row 0 with id  a2X700000003fFAEAY ; First Error : Field_Integrity_Exception , there is already an item in this list with name 00570000002VGbcAAG.

How to get rid of this error ?

Here is the piece of code :

Here " Territory_Names__c" is  the custom setting .

public void updateFilters()
{
List<String> territoryNames = new List<String>();
        for(Territory territory : selectedTerritories.values()){
            territoryNames.add(territory.Name);
        }
erritoriesSynced.Territory_Names__c = String.join(territoryNames, ',');
        upsert territoriesSynced;



Thanks in advance
  • October 09, 2014
  • Like
  • 0
Hi Folks urgent requirement please help me and below is my code and pic.User-added image
<apex:page controller="Pagination_min"  showHeader="false" sidebar="false"  extensions="AccountController">
  <apex:form >
   <apex:outputpanel >
    <apex:pageBlock id="abc">
        <apex:pageBlockSection columns="1"  title="Accounts" > 
            <apex:pageBlockTable value="{!accounts}" var="a" >
                <apex:column >
                   <apex:outputLink title="" value="/{!a.id}/e?retURL=/apex/{!$CurrentPage.Name}" style="font-weight:bold">Edit</apex:outputLink>&nbsp;|&nbsp;

                </apex:column>
                <apex:column value="{!a.Name}"/>
                <apex:column value="{!a.Type}"/>
                <apex:column value="{!a.BillingCity}"/>
                <apex:column value="{!a.BillingState}"/>
                <apex:column value="{!a.BillingCountry}"/>
            </apex:pageBlockTable>
            <apex:panelGrid columns="7">
            <apex:commandButton value="|<" action="{!setcon.first}" disabled="{!!setcon.hasPrevious}"  title="First page" reRender="abc"/>
            <apex:commandButton value="<" action="{!setcon.previous}" disabled="{!!setcon.hasPrevious}" title="Previous page" reRender="abc"/>
            <apex:commandButton value=">" action="{!setcon.next}" disabled="{!!setcon.hasNext}"  title="Next page" reRender="abc"/>
            <apex:commandButton value=">|" action="{!setcon.last}" disabled="{!!setcon.hasNext}" title="Last page" reRender="abc"/>
           
             <apex:outputText >{!(setCon.pageNumber * size)+1-size}   -    {!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
                <apex:commandButton value="Refresh" action="{!refresh}" title="Refresh Page" reRender="abc"/>
            </apex:panelGrid>
        </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:outputPanel>
                      <apex:pageBlock title="Account Creation Section" mode="edit" id="simha">
                          <apex:pageBlockButtons >
                               <apex:commandButton action="{!save}" value="Save" reRender="simha" />
                          </apex:pageBlockButtons>
                               <apex:pageBlockSection columns="2">
                                    <apex:inputField value="{!account.name}" required="false"/>
                                    <apex:inputField value="{!account.type}"/>
                                    <apex:inputField value="{!account.Billingcity}"/>
                                    <apex:inputField value="{!account.billingstate}"/>
                                    <apex:inputField value="{!account.billingcountry}"/>
                               </apex:pageBlockSection>
                      </apex:pageBlock>
  </apex:form>               
</apex:page>
*****************************************************
public class Pagination_min {

    Public Integer noofRecords {get; set;}
    public integer size {get; set;}
   
    public Apexpages.standardsetController setcon{
        get{
            if(setCon == null){
                size = 10;
                String queryString = 'Select Name, Type, BillingCity, BillingState, BillingCountry from Account order by Name';
                setcon = new apexpages.standardsetController(Database.getquerylocator(queryString));
                setcon.setpagesize(size);
                noofRecords = setcon.getResultsize();
            }
            return setcon;
        }
         set;
    }
    Public list<Account> getAccounts(){
        list<Account> acclist = new list<Account>();
         for(Account ac : (list<Account>)setcon.getrecords()){
             acclist.add(ac);
         }
        return accList;
       
      
    }
   Public PageReference Refresh(){
       
        setcon=null;
        getAccounts();
        setcon.setpageNumber(1);
       
        return null;
    }
}
**********************************************************
public with sharing class AccountController {
   
    public Account account{get; set;}
    public AccountController(Pagination_min controller) {
      account = new Account();
    }
    
  public PageReference save(){
        upsert account;
        account = null;
        return null;
    
}
}