copyMasterDetailButtonHandler: Copying Everything but the Status Field

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
In my app every Campaign has many Audiences, and I have correctly set up the copyMasterDetailButtonHandler for this relationship. On the Parent table I have a "Status" field (fid 75) that could have the value of "Not Started", "In-Progress", or "Closed".

My issue is that when a Parent is copied via the Master Detail Button, the Status is automatically passed down from the copied Parent. Ideally, when the Master Detail Button is clicked, I always need the "Status" field to be "Not Started". I cannot figure this out at all!

My formula currently reads:

"javascript:void(copyMasterDetailButtonHandler('&relfids=142&recurse=false&copyFid=49&destrid=0&sourcerid=" & [Record ID#] & "', 'XXXXXXXX'))"

I'm sure somewhere in there I need to add "&fid_75=Not Started", but I have not idea where.

Photo of JeffCracolici


  • 0 Points

Posted 2 years ago

  • 0
  • 1
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 3,792 Points 3k badge 2x thumb
Fire a Webhook that when a new Record is created that it auto updates the Status to what you want; then when you use the CopyParentChildren it will fire the webhook.  I haven't tested this; but in theory it should work.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
I agree with Laura.  The alternative is to detect that the campaign name probably now beings with Copy of (previous campaign Name).  You can make  a URL button to click to edit that field to reset it's value, if you did not want to get into Webhooks (although Webhooks will be a better user experience).  So what you can do is also to have a form rule that hides most of the section on the form and displays a message to make the user click the button to reset that field when the name begins with copy of and the status is not correct.

Then once the user clicks and the status is reset, then it would re-display the form and the sections would all be visible.  Like I said, I agree with Laura, and this alternative is more or less what I would do previously before we had webhooks.