• Ekta Gupta 11
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Deloitte

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 8
    Replies
Hi all,

I've got an Apex class which updates a specific field in all cases every hour. A "problem" occurs with locked cases (cases open with agents).
The casefield is updated through the batchrun But when the case is opened by the agent before the batchrun and closed after the batchrun, the agent gets the errormessage that the case can't be saved because it was edited by .....

Is there a possibility in the Apex code to check in the query if a case is locked by an user, and if so exclude them from the queryresults and avoid the problem described above?

Regards
Chiel
Hi
I was trying to complete the challenge Creating Object Relationships, but got a weird error. Does anybody know how to solve this, so I can get on with it?:

Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, User: id value of incorrect type: 00558000000ta38AAA: [User__c]

RGDS
Vic
I have a map<list<list<string>>> variable that I need to iterate over in visualforce. Here is my code:
 
public class testMapController {

    public Map<String, List<List<String>>> getDemoMap(){

        Map<String, List<List<String>>> demoMap = new Map<String, List<List<String>>>();
        List<String> testList = new List<String>();
        testList.add('test');
        testList.add('testing');
        List<List<String>> listOfList = new List<List<String>>();
        listOfList.add(testList);

        
        List<String> testList2 = new List<String>();
        testList2.add('test2');
        testList2.add('testing2');
        listOfList.add(testList2);
        
        demoMap.put('first', listOfList);
        demoMap.put('second', listOfList);
    
        return demoMap;
    }
}

<apex:page controller="testMapController">
<apex:repeat value="{!DemoMap}" var="key" >
    <apex:repeat value="{!DemoMap[key]}" var="keyvalue" >
        <apex:outputText value="{!keyvalue[0]}" />
        <br/>
   </apex:repeat>
</apex:repeat>
</apex:page>

Here is the error I am receiving when trying to save the visualforce page:

Incorrect parameter type for subscript. Expected Text, received Number (even though its a list of lists and should be a number in the subscript)
Hello every one 
      i m trying to put all my custome  object data into Select list but not abel to do.
  User-added image

My controller is this
public class DisplayBooks {  

    public String openPresentationOptions { get; set; }

    public String selectedVal { get; set; }       

    public List<SelectOption> getPresentationOptions(){    

         List<selectOption> options = new List<selectOption>();           

        for(DevTech__Book__c book : [SELECT DevTech__bookname__c,DevTech__Price__c FROM DevTech__Book__c]){

            options.add(new SelectOption(book.DevTech__bookname__c,book.DevTech__Price__c));
        }
        return options;
    }    
}


my vf Page

<apex:page controller="DisplayBooks">  
<apex:form>  
    < apex:selectList>   
    < apex:selectOptions value="{!openPresentationOptions}" />  
</apex:selectList>  
</apex:form>  
</apex:page>  
Hi
Im a new to salesforce. i have some questions regarding single sobject and list of sobject.
in the below code it uses contact cont = c. clone  is it for a single contact ??
And what clone method actually does for the below code
public class AddPrimaryContact implements Queueable
{
    private Contact c;
    private String state;
    public  AddPrimaryContact(Contact c, String state)
    {
        this.c = c;
        this.state = state;
    }
    public void execute(QueueableContext context) 
    {
         List<Account> ListAccount = [SELECT ID, Name ,(Select id,FirstName,LastName from contacts ) FROM ACCOUNT WHERE BillingState = :state LIMIT 200];
         List<Contact> lstContact = new List<Contact>();
         for (Account acc:ListAccount)
         {
                 Contact cont = c.clone(false,false,false,false);
                 cont.AccountId =  acc.id;
                 lstContact.add( cont );
         }
         
         if(lstContact.size() >0 )
         {
             insert lstContact;
         }
             
    }

}
Hi guys,

I have a requirement where i want to display some alert message like the 'hover over' functionality in salesforce, so that when user clicks on that text box of a particular field should get that message flashed. How can we do that in salesforce? Please help