• Mohammad Hussain 7
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I am trying to insert master and detail records in a single insert statement. As a reference i took this example. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_foreign_keys.htm
When i excute the example provided here in my dev org it works. But, when i implement the same using custom objects not able to compile the class.  

newOpportunity.Account = accountReference; //I get error in this line for custom objects

If I am using custom objects how can i make this line work? I was thinking this should be parent id but, it is not it gives illigal assignment error.

 
Need to run a batch apex job every 15 mins i was able to achive this using schedulable interface and creating 4 different schedules but, is there any way to schedule only one job which run every 15min?

Also, i do not want to chain the job like scheduling the next run in the finish section.
 
I am trying to insert master and detail records in a single insert statement. As a reference i took this example. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_foreign_keys.htm
When i excute the example provided here in my dev org it works. But, when i implement the same using custom objects not able to compile the class.  

newOpportunity.Account = accountReference; //I get error in this line for custom objects

If I am using custom objects how can i make this line work? I was thinking this should be parent id but, it is not it gives illigal assignment error.

 
Need to run a batch apex job every 15 mins i was able to achive this using schedulable interface and creating 4 different schedules but, is there any way to schedule only one job which run every 15min?

Also, i do not want to chain the job like scheduling the next run in the finish section.