You need to sign in to do that
Don't have an account?
Shamsi 110
How to Create a Parent object than its related child and than related grandchild and than related great grand child in trigger ?
Hello Friends.
I have Four objects in salesforce Project , Project Phase , Project Task, WBS.
Project Is master Project Phase Is child.
Project Phase is Master and Project task is child
Project Task is Master and WBS is child.
In the system, there is a sample project, along with phases and associated tasks and WBS.
I want to create a sample record by copying these objects data.
I have a situation now i have three tasks records and i want to create tasks, phases, WBS of these tasks and associate this to new Project.
How do i achieve this?
In simple words i have task records and i have to insert first a new hardcoded project than associate these task and the phases of these tasks and WBS of these task to new hardcoded project.
Thanks
I have Four objects in salesforce Project , Project Phase , Project Task, WBS.
Project Is master Project Phase Is child.
Project Phase is Master and Project task is child
Project Task is Master and WBS is child.
In the system, there is a sample project, along with phases and associated tasks and WBS.
I want to create a sample record by copying these objects data.
I have a situation now i have three tasks records and i want to create tasks, phases, WBS of these tasks and associate this to new Project.
How do i achieve this?
In simple words i have task records and i have to insert first a new hardcoded project than associate these task and the phases of these tasks and WBS of these task to new hardcoded project.
Thanks
You can use external Id fiel to insert parent child records using one dml statements. Create a new text field on each parent object and mark it as External Id. See below example
See below post, which may clarify more things.
https://developer.salesforce.com/forums/ForumsMain?id=9060G000000Bj6fQAC
Let me know If you have any quesiton.
Thanks
Actually I have tasks lets say three task records
Task one
Id =123,name='Task one',Phase = 'Phase one'
Task two
Id = 124,name ='Task two',Phase='Phase two'
Task three
Id=125,name ='Task three',Phase='Phase one'
Now I want to create
One Project (All Hardcoded Values )
Name = 'Test Project'
Two Phases
1) Name : Phase One
Project = above Project id
Task one and three will be its children
2) Name : Phase two
Project = above Project Id
Task two will be its child
Three tasks (One is associated with Phase two, and two is associated with phase one).
You can see image to get some idea of schema
Thanks,
Hasan Shamsi