I am trying to create a child record from a rule which runs in the parent record. When the parent is updated, It appears that a new record is created in the child BO with all the data in it that is required but is not referenced to the parent and does not display in the parent.
Any help would be great.
Thanks
Create Child Record from rule in Parent
Re: Create Child Record from rule in Parent
Post the rule you are using & perhaps we can help troubleshoot.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Create Child Record from rule in Parent
Thanks for the reply, I am using the rule below
If IMS_Detail.EngName WAS CHANGED Then CREATE IMS_Assignments WITH IMS_Assignments.Eng_Name=IMS_Detail.EngName,IMS_Assignments.DateAssigned=IMS_Detail.DateAssigned,IMS_Assignments.TimeAssigned=IMS_Detail.TimeAssigned
Thanks
If IMS_Detail.EngName WAS CHANGED Then CREATE IMS_Assignments WITH IMS_Assignments.Eng_Name=IMS_Detail.EngName,IMS_Assignments.DateAssigned=IMS_Detail.DateAssigned,IMS_Assignments.TimeAssigned=IMS_Detail.TimeAssigned
Thanks
Re: Create Child Record from rule in Parent
This part is correct, so it should be creating the child instance correctly.WITH IMS_Assignments.Eng_Name=IMS_Detail.EngName
Code: Select all
.. but is not referenced to the parent and does not display in the parent
Tom - V8.8 build 3137 - MySql / PostGres
Re: Create Child Record from rule in Parent
When I look at the contents of BO IMS_Assignments, there are records being created but when I put IMS_Assignments as an attribute in the IMS_Details form, nothing is displayed, just a header.
I have the attribute set to Multiple Allowed and a Peer relationship.
When I look at Presentation, I have the three Attributes selected to display.
Thanks.
I have the attribute set to Multiple Allowed and a Peer relationship.
When I look at Presentation, I have the three Attributes selected to display.
Thanks.
Re: Create Child Record from rule in Parent
This topic probably shouldn't be in 'Tips and Tricks' (probably should be in 'General'), but anyway..
the below will not add the new IMS_Assignments instance to the Reference Attribute (for IMS_Assignments) in IMS_Detail. Maybe you are thinking in terms of non-Aware convention of parent-child association. It will only create an instance of IMS_Assignments.
You need to add another Action after it, "INSERT IMS_Assignments IN IMS_Detail.IMS_Assignments_reference_attribute _name"
(only option if IMS_Assignments does not have an IMS_Detail Reference Attribute)
OR, if IMS_Assignments does have an IMS_Detail Reference Attribute, then alternatively, don't add another Action after it, but instead insert after the 'WITH':
IMS_Assignments.IMS_Detail_reference_attribute_name = IMS_Detail,
the below will not add the new IMS_Assignments instance to the Reference Attribute (for IMS_Assignments) in IMS_Detail. Maybe you are thinking in terms of non-Aware convention of parent-child association. It will only create an instance of IMS_Assignments.
You need to add another Action after it, "INSERT IMS_Assignments IN IMS_Detail.IMS_Assignments_reference_attribute _name"
(only option if IMS_Assignments does not have an IMS_Detail Reference Attribute)
OR, if IMS_Assignments does have an IMS_Detail Reference Attribute, then alternatively, don't add another Action after it, but instead insert after the 'WITH':
IMS_Assignments.IMS_Detail_reference_attribute_name = IMS_Detail,
Ewanm wrote:Thanks for the reply, I am using the rule below
If IMS_Detail.EngName WAS CHANGED Then CREATE IMS_Assignments WITH IMS_Assignments.Eng_Name=IMS_Detail.EngName,IMS_Assignments.DateAssigned=IMS_Detail.DateAssigned,IMS_Assignments.TimeAssigned=IMS_Detail.TimeAssigned
Thanks
Last edited by pureist on Sat Oct 01, 2016 6:44 am, edited 1 time in total.
Re: Create Child Record from rule in Parent
Thanks for the reply,
That worked, I thought Aware did all that automatically but see it now.
Thanks Again.
That worked, I thought Aware did all that automatically but see it now.
Thanks Again.
Re: Create Child Record from rule in Parent
It can't. IMS_Assignments might be Peer to several Objects.
And besides, you might want to have instances of IMS_Assignments which are created unpeered, as you were doing.
And besides, you might want to have instances of IMS_Assignments which are created unpeered, as you were doing.
Re: Create Child Record from rule in Parent
Thanks Again