+ Start a Discussion
meet.sivameet.siva 

Dynamic implementation

I have custom object Opportunity_CRM__c. Once i upload the data into it i have to create another custom object test__c automatically with employee_id__c as one field.?(i.e dynamically i have to create the custom object) can any one give me the logic to implement this?

 

regards,

S.sivakumar

MoggyMoggy

you already asked that question here

http://boards.developerforce.com/t5/Apex-Code-Development/How-to-create-custom-object-using-Apex/td-p/561581

 

do you need to create the test__c object or just fill it with the amount of  Opportunity_CRM__c  records I guess you just need to fill test__c, therefore a simply trigger 

on the Opportunity_CRM__c   (insert)

 

for (Opportunity_CRM__c myOpp :Trigger.new){

test__c myTest = new test__c();

test__c.Name = myOpp.Id;

//here put your fields you need into it

 insert myTest;

}

 

something like that would populate your test__c with the needed values

 

if you mean creating the test__c object itself than you will need to think about limits (for each Opportunity_CRM__c record  really 1 object? )

meet.sivameet.siva

hey thanks.

 

To use your code I have to manually create the custom object test__c before inserting records.

 

But i need to create test__c from apex class or triger and only once i have create, not for each Opportunity_CRM record.

 

is this possible?

 

regards,

S.Sivakumar

MoggyMoggy

only as Vinit already said in the other thread by using the Fiddler tool, which I can't help with