ApexSensei

Drills DML operations

SObject field access

Use dot notation when you know the field while you write the code.

Your task

Set and read Account fields in memory with both dot notation and the dynamic put and get methods.

String name = 'AS Field Practice';
String description = 'Prepared in memory';
Account acct = new Account();
String dynamicDescription;

Requirements

  1. put('Description', ...) should be present
  2. get('Description') should be present
  3. The Name field should be printed as Dot name: AS Field Practice
  4. The dynamic field should be printed as Dynamic description: Prepared in memory
  5. An unset Phone should be printed as Phone unset: true
  6. An unsaved record should be printed as Id unset: true

Sign in to open this drill