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
RufiRufi 

Merge Sobjects in AS3

Hi

 

I have following lines of code:

 

var obj1:SObject = _crObjectArrayJoined[0]; // First Index 0  has 1 Sobject
var obj2:SObject = _crObjectArrayJoined[1]; //Second SObject

 

Can you please give me any suggestions on how to merge these two object into one in AS3?

 

Cheers.

 

 

CoryCowgillCoryCowgill

Rufi,

 

I'm not sure exactly what your request here is. You want to merge two SObjects into one? You want SObject A to overwrite SObject B somehow? Or does SObject A have a lookup relationship to SObject B which you want to model in AS3? IF you can give more details you'll probably get some better answers.

 

In past what I and others have done is create value objects with functions like "toSObject():SObject" and "buildVO(sobj:SObject)". So for Account you would have AccountVO which would be your value object for Account. The AccountVO would be able to build a SObject in a toSObject function. You could hold ArrayCollections of children objects like Contacts (ContactsVO) on the AccountVO similar to how you would have object mapping done in Hibernate or other ORM solutions.

 

Also you may want to think about posting Actionscript questions inside the Adobe Flash Builder for Force.com Discussion group as that is the place where AS3 questions should probably go.

RufiRufi

Thanks for your feedback. I m very new to Salesforce plattform and trying to understand the API.

 

Ok lets put it this way. I'm trying to merge the results from two different 'connection.retrieve' call:

 

 _conn.retrieve(crObject1, SOBJECT_NAME, [_idClientReview], new AsyncResponder(onLoadCRObj, handleFaultB));
 _conn.retrieve(crObject2, SOBJECT_NAME, [_idClientReview], new AsyncResponder(onLoadCRObj, handleFaultB));

 

We retrieve the list of all the fields from our ABC table/Object and put it in a String variable. We had something like this before:

 

// crObject:String = new String();

 

_conn.retrieve(crObject, SOBJECT_NAME, [_idClientReview], new AsyncResponder(onLoadCRObj, handleFaultB));

 

//It threw an error of 10,000 character limit. Since the crObject was too big

 

I had to split up the CRObject as 'CrObject1' and 'CRObject2' due to API Character Limit Constraint (10,000 character limit) and now I'm trying to figure out a way to merge the results from two different 'retrieve' call.

 

Please help me out on this.

Your co-operation will be highly appreciated.

 

Cheers,

 

Rufi