Member Junction
    Preparing search index...
    • Extracts a field value from a record, supporting both BaseEntity and plain objects.

      For BaseEntity objects (detected by presence of .Get() method), uses the .Get() method. For plain JavaScript objects, uses standard bracket notation.

      Parameters

      • record: any

        The source record (BaseEntity or plain object)

      • fieldName: string

        The name of the field to extract

      Returns unknown

      The field value, or undefined if not found

      // Works with BaseEntity
      const entity = await md.GetEntityObject<MJTaskEntity>('Tasks');
      const name = getFieldValue(entity, 'Name'); // Uses entity.Get('Name')

      // Works with plain objects
      const obj = { name: 'My Task', status: 'Open' };
      const name = getFieldValue(obj, 'name'); // Uses obj['name']