Forum Discussion
RickLindner
6 years agoQrew Trainee
Joshua,
I realize this is after the fact, but I was stumbling with the same issue and think I figured out a solution that may be simpler for users (like me) who don't use java, AJAX, etc.
Similar to you, I wanted to add a parent from a child form using a URL button, THEN update the child with the related parent ID. In this case, we have accounts (parent) and orders (child). Usually an account exists before an order however, we are now placing orders that establish new accounts. The result is that we track order info before we know the account info, but want to add the account from the order form as soon as we have the required info. I ended up using a URL button combined with an automation. Here's what I did:
As an aside, when we place an order and start to gather the account info, we are capturing that info on the order record. I setup text fields for this purpose (i.e., draft Account ID). When the account record is created and related, the URL button inserts the "draft" values into the correct parent fields, THEN goes back to the child record and removes the draft values (cleans up). Once a parent is related, I use a form rule to hide the draft fields and the URL button.
Just thought I'd share.
Rick
------------------------------
Rick Lindner
------------------------------
I realize this is after the fact, but I was stumbling with the same issue and think I figured out a solution that may be simpler for users (like me) who don't use java, AJAX, etc.
Similar to you, I wanted to add a parent from a child form using a URL button, THEN update the child with the related parent ID. In this case, we have accounts (parent) and orders (child). Usually an account exists before an order however, we are now placing orders that establish new accounts. The result is that we track order info before we know the account info, but want to add the account from the order form as soon as we have the required info. I ended up using a URL button combined with an automation. Here's what I did:
- I added two fields to the parent table (Accounts):
- a numeric to capture the child's record ID, ex. [added from child Record ID#], and
- a checkbox that will trigger an automation, ex. [added from child?]
- then I created the URL button to add the parent record, and added the statements that update the two new fields,
- insert the child Record ID into the new field [added from child Record ID#], and
- set the checkbox [added from child?] to TRUE
- then I created an automation to do the heavy lifting
- trigger the automation when a new parent record is added, and
- the checkbox [added from child?] = TRUE, and
- [added from child Record ID#] isn't blank (prob not necessary, but I added for good measure)
- when the automation fires, update the record in the child table where the child Record ID# = the trigger field [added from child Record ID#] , and
- set the [related parent] value on the child record to the trigger value [record ID#].
- trigger the automation when a new parent record is added, and
As an aside, when we place an order and start to gather the account info, we are capturing that info on the order record. I setup text fields for this purpose (i.e., draft Account ID). When the account record is created and related, the URL button inserts the "draft" values into the correct parent fields, THEN goes back to the child record and removes the draft values (cleans up). Once a parent is related, I use a form rule to hide the draft fields and the URL button.
Just thought I'd share.
Rick
------------------------------
Rick Lindner
------------------------------