• Saqib Qamar 5
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Are you looking to give your time to a good cause or to gain experience with Salesforce development? We are an international development charity working with communities in developing countries in Africa and Asia. We are swamped with work and one of our big issues is time wasted on admin. We believe Salesforce will help us but we do not have the funds to bring in a consultant to develop our platform. 

Our website is VMMinternational.org 

 
Q1)The Review_c object have a lookup relationship to the job_Application_c object. The job_Application_c object has a master detail relationship up to the position_c object. The relationship is based on the auto populated defaults?

What is the recommended way to display field data from the related Review _C records a Visualforce page for a single Position_c record?

Select one of the following:

A. Utilize the Standard Controller for Position_c and cross-object Formula Fields on the Job_Application_c object to display Review_c data.
B. Utilize the Standard Controller for Position_c and a Controller Extension to query for Review_c data. (Ans)
C. Utilize the Standard Controller for Position_c and expression syntax in the Page to display related Review_c through the Job_Applicacion_c inject.
D. Utilize the Standard Controller for Position_c and cross-object Formula Fields on the Review_c object to display Review_c data.


Q2)An sObject named Application _c has a lookup relationship to another sObject named Position_c. Both Application _c and Position c have a picklist field named Status_c. When the Status c field on Position __c is updated, the Status_c field on Application _c needs to be populated automatically with the same value, and execute a workflow rule on Application c. Flow can a developer accomplish this?

      A. By changing Application c.Status_c into a roll-up summary field.
      B. By changing Application c.Status_c into a formula field.  (ANS) [Why ? it should be C]
      C. By using an Apex trigger with a DML operation.
       D. By configuring a cross-object field update with a workflow.

Q3)when would a developer use a custom controller instead of a controller extension?[Why it is not option B]

1)When a VF Page needs to replace the functionality of a standard controller.(Ans)
2)When a VF Page doesn't reference a single primary object.
3)When a VF Page shouldn't enforce permissions or field level security.(Ans)
4)When a VF Page needs to add new actions to a standard controller.

Q4)Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct? 

    A. The Lookup Relationship on the Custom Object can prevent the deletion of the Standard Object
    B. The Lookup Relationship cannot be marked as required on the page layout for the Custom Object.
    C. The Custom Object will be deleted when the referenced Standard Object is deleted.(Ans)
    D.  The Custom Object inherits security from the referenced Standard Object.

Q5)Valid statement about Apex classes:

A.  a exception classes must end with the world exception
B.  a class can have multiple levels of inner classes
C.  the default modifier for a class is private
Hi friends

I have written code that updates email of contact object when BillingState='Karnataka' of acocunt object.
Apex class & trigger working fine.

Now I write test class as below
public class sampleTestMethodCls
{
  private static testMethod void testAccountTrigger()
  {
        //First, prepare 200 contacts for the test data
         Account acct = new Account(name='test account');

         insert acct;

         Contact[] contactsToCreate = new Contact[]{};

         for(Integer x=0; x<200;x++)
        {
         Contact ct = new Contact(AccountId=acct.Id,lastname='test');
         contactsToCreate.add(ct);
        }

        //Now insert data causing an contact trigger to fire.

        Test.startTest();

        insert contactsToCreate;

         Test.stopTest();   
     }  
 }

when I Run the test class I get an error as " Test methods must be in test classes at line 4 column 36"

Please let me know what is exact reason of this error:? & how it impact performance:?

Thanks
Krishna casukhela