• Chaitra GV
  • NEWBIE
  • 70 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 1
    Replies

There are 3 objects, Account, Opportunity and Activity. How to query using SOQL in the below hierarchy using AccountId and OpportunityId fields.

Account

Opportunity

Activity

If we want to update a field, for example case.status, which trigger is used? before or after insert? My understanding is that, "after insert" will be used since we are updating a field after the record is inserted.
Is that correct? Please help.
Two users are having same profile and same role. If we want to restrict the record usage to one of the users, how can we achieve it?
A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for this object. What happens when a user updates the record? Will both worflow and trigger be applied on the object?
I wanted to disable edit button once the status of case is closed. Is it possible to disable a button in visualforce? How can it be achieved?
Develop a visualforce page which comprises of an input box and search button. If name is entered and the search button is clicked, the page should display name and designation with respect to the name entered.
I tried writing the code below. But it seems to be not working. Please help me to complete this code,

<apex:page controller = "DisplayDesig">
        <apex:form>
        <apex:pageBlock>
            <apex:pageBlockTable value = "{!jobs}" var = "j">
                <apex:inputField value = "{!j.Name}"/>
                </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>

(Controller to fetch designation from custom object:)

public class DisplayDesig {
    
    public static List<Job__c> provideDesig(String Name)
        {
           List<Job__c> result =[SELECT Id, Designation__c from Job__c where Name =: Name];
            return result;

        }
    
    
}



 
Hi All,

I had a query regarding user level access.
One field has read write access on profile level and permission set is associated with one user having read access.what will be the final level of access given to the user?
Also, if OWD is private and above 2, what will be the access level to the user?
Hi,
I had a query related to sharing a record

There are two fields in a record and in that you want that if the total of field is 100 or more then share the record with the user else if it less then keep it in private only

Can you please tell me how to do this using apex?
I've written the below code which looks fine as per the instructions given in the challenge.
But I'm facing an error when trying to resolve the challenge. Please help.

Error: Executing the 'generateRandomContacts' method failed. Either the method does not exist, is not static, or did not return the correct set of Contact records.

Code:

public class RandomContactFactory {
    
    public static List<Contact> generateRandomContacts(Integer n, String Lastname)
    {
        List<Contact> ct = new List<Contact>();
         Contact c = new Contact();
        for(Integer i=0; i<n; i++)
        {
           c.FirstName = 'Test '+i;
           c.LastName = Lastname;
           ct.add(c);
        }
        
        return ct;
    }

}
Hi, I'm facing below error on trialhead challenge even though the code is correct. Got expected results in the debug window as well.

Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

Please help.

Code:

public class StringArrayTest
{
   
    public static List<String> generateStringArray(Integer n)
    {
        String[] arr = new List<String>();
        
        for(Integer i=0;i<n;i++)
        {
           arr.add('Test'+i);
        }
        
         System.debug('The array is:'+arr); 
          return arr;
    }
    
  
}

 
Hi, I'm facing below error on trialhead challenge even though the code is correct. Got expected results in the debug window as well.

Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

Please help.

Code:

public class StringArrayTest
{
   
    public static List<String> generateStringArray(Integer n)
    {
        String[] arr = new List<String>();
        
        for(Integer i=0;i<n;i++)
        {
           arr.add('Test'+i);
        }
        
         System.debug('The array is:'+arr); 
          return arr;
    }
    
  
}