Profile for jing hai li
Statistics
Projects participated in: 1
Number of comments: 0
Showing 1 to 1 of 1 results
jing hai li's Projects
Force.com's record clone function only clones the record itself without taking into the account of its "detail/child" records. The Super Clone provides both API (can be directly called from your own code) and visual force page UI access to clone the master and detail records in one go. An example of API access: <br/> <br/>//clone an account record (id is a0190000001E3JJ) with all related detail records(contact,opportunity...) //note, detailed records to be cloned can be further declared. By default, it takes all child records. <br/> <br/>Clone cc=new Clone(); <br/>string parentObjAPIName=cc.returnAPIObjectName('a0190000001E3JJ'); <br/>Map&lt;string,string&gt; objLabelobjAPI=cc.getAllChildObjNames(parentObjAPIName,'a0190000001E3JJ'); <br/>string clondedParentRecordID=cc.startsClone('a0190000001E3JJ', objLabelobjAPI.values()); <br/> <br/>That's it, totally 4 lines code. <br/> <br/>To use it in a Visualforce page, all you need to do is to pass the master record id to the URL: <br/>yoursalesforce instance.salesforce.com/apex/clone?id=salesforce master record id, e.g: <br/> <br/>https://ap1.visual.force.com/apex/clone?id=00190000004ZlVc
Project Owner:  jing hai li
Created: Tue Jul 12 00:56:11 GMT 2011

Page:    1