function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Extend Sobject in flex SFDC



I've been trying to extend Sobject class in flex actionscript 3 code, but so far no success.


I have my custom object for example MyObject__c and I would like to have a class MyObjectVo extends Sobject

in flex so I can have strongly typed object for faster development in my code instead of having to have hard coding the properties.


Any ideas, a code sample will be exteremly helpful.


Here is what I've got:


 package com.seventicks.timesheet.model.vo
    public class TimesheetVo
        public var type:String = "Timesheet__c";
        public var Activity__c:String;   
        public var ActivityType__c:String;
        public function TimesheetVo()


Best Answer chosen by Admin (Salesforce Developers) 



The only example i have seen of something like this had a function getSObject() would be something like this


function getSObject():SObject


  var obj:Object = {};

obj.type =  "Timesheet__c";

obj.Activity__c = this.Activity__c;

obj.ActivityType__c = this.ActivityType__c; 

  return new SObject(obj);