function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
I need to insert two fields project__c(masterdetail of another object),test_id__c into test object in test class.
Can anyone help? i am new to force.com
Do you mean that you need to add values into those fields in your test?
This might help. You need to create the Master object first, then use its Id for the Detail object.
MasterObject master = new MasterObject( Name = 'Master Object' );
insert master;
DetailObject detail = new DetailObject( Name = 'Test Object'
,Project__c = master.Id
,Test_Id__c = '12345' );
insert detail;
Hope that helps!
~ Clint
Do you mean that you need to add values into those fields in your test?
This might help. You need to create the Master object first, then use its Id for the Detail object.
MasterObject master = new MasterObject( Name = 'Master Object' );
insert master;
DetailObject detail = new DetailObject( Name = 'Test Object'
,Project__c = master.Id
,Test_Id__c = '12345' );
insert detail;
Hope that helps!
~ Clint