Skip to main content
chriss4489
April 27, 2023
Question

Creating a child record from the parent record interface.

  • April 27, 2023
  • 20 replies
  • 1 view

I have a Parent Summary interface that I want to add a record action button to that creates an entry in a child table. Adding the button is easy enough, however adding that button alone doesn't connect the Parent to the child when using the button. So what steps am I missing to make that connection?

    20 replies

    mikes0011
    Brainy
    April 27, 2023

    Lots of detail is missing here.  What does the button "do"?  Generally a related action will launch a process model, but what have you configured / tried within this process model?  What information are you passing in?  At a minimum I'd hope you're already passing in the primary identifier information (in whatever form), though it's unclear what else you might be doing here to create the child (a user form? a fully automated process? something else?).

    chriss4489
    April 27, 2023

    The idea is simply for a user to be able to be looking at the Summary view of the parent record, click the button to create a child record, which would bring up the add interface for the child record, which has a field for the parent id field, which should be already populated with the parent id to make that connection. It sounds like getting that parent id to pull down to the child is set up in the process model?

    mikes0011
    Brainy
    April 27, 2023

    In the most generic sense: the process model would have a PV (set as a parameter) in which you'd pass in the parent primary key ID.  From the user's perspective, when set up correctly, it would be as simple as clicking the button (then filling out any required extra fields/etc).  Is there anything in particular you're having trouble with here?

    greg.wheeler
    April 27, 2023

    Hi cls5469!

    Let's explore this from the use case example in the Acme Automobile Reference Application, available on your Community Edition Site. Users should be able to request maintenance on a vehicle. They would achieve this by going to the summary view of the specific vehicle they want to request maintenance on. They would then choose the related action > Request Maintenance. A process would kick off that would pass the vehicleId into the process from the record. This is done in the Context of the related action within the Record Type object. This is important as this is how the vehicleId gets attached to the maintenance request. By the end of the process, a Write Record smart service writes the data to the maintenance table. 

    Be sure the context of your related action is properly configured to pass the primary key of the record you are on, into the appropriate field in your process to be part of the data that will be written.

    Hope this helps!

    chriss4489
    April 27, 2023

    Thanks Greg, this would be very helpful if I could reference that example in the Community Edition, unfortunately I do not have access to it anymore and there seems to be a huge delay in regaining access to it.

    When you say to be sure the context of your related action is properly configured, are you referring to creating a related action on the Parent Record Type object to create a Child record? I didn't even think about that but I see now that you mention it that if you manually configure it you can set that up. However, there is still something missing after I added the Process Variable that Mike mentioned above as it is still not passing the Parent Record ID to the Child when I test it.

    greg.wheeler
    April 27, 2023

    If you are noticing a large delay in regaining access to your Community Edition, I would recommend reaching out to communityedition@appian.com for guidance. They may be able to help or provide additional insight. 

    The goal is to pass the data from point A to point B. Specifically, the primary key of the record you want. Below is a snippit of what I am referring to. Although, I did simplify the expression down to better illustrate the point. The image shows the Context of the Request Maintenance related action within the Vehicle Record Type object. Within the process model, we have 2 process variables - cancel and maintenance. The maintenance process variable is a Maintenance Record data type - so it contains the structure of all data points related to a maintenance request - including the vehicleId. In the image, you can see that we are "passing" a value into the maintenance process variable. Since the maintenance process variable has a Maintenance Record Type structure, we are explicitly defining the value that we are passing in. Specifically, we are passing in the primary key of the record (rv!identifier = vehicleId) into the vehicleId field wrapped inside the AA Maintenance Record Type. This tells the process exactly where we want the vehicleId to go.

    April 30, 2023

    I would like to focus on the Acme Automobile Reference Application, one of the free pieces of software that you can download from your Community Edition Website, to compare this to the Acme Automobile Reference Application. A web interface would be ideal in order for users to be able to request maintenance on their vehicles through the web interface. The best way for them to accomplish this would be to go to the summary view of the specific vehicle they wish to request maintenance for in order to make the request. In the following step, they would choose the related action Request Maintenance and proceed to the next step. During the launch of the process, it will be passed the vehicleId from the record so that it can be used in the process. It is within the context of the related action within the Record Type object that the related action is executed. As a result, it is necessary to do this in order to connect the maintenance request to the vehicleId in order to get the maintenance request processed. A Write Record smart service is used at the end of the process to write the data to the maintenance table by writing it to it. 

    In your process for writing the relevant action, you should make sure that the context of the related action is configured in such a way that the primary key of the record in which you are working is passed into the appropriate field in the context of the related action.

    I appreciate you taking the time to read this.

    saitoy6477
    December 6, 2024

    Hi all,
    I'm a beginner of Appian.
    I've tried to look for "the Acme Automobile Reference Application", but I cannot find it. May I know the URL link?

    In Appian academy, the application is explained, but I could not download it....

    Best regards,