Can you configure the Copy Master/Detail Records button?

  • 0
  • 2
  • Question
  • Updated 4 months ago
  • Answered
How much flexibility do you have with the Copy Master/Detail Records button? I would like to be able to configure a couple things: 
  • Exclude fields from being copied
  • Edit the values in certain copied fields
Is this possible? I suppose I might be able to make a custom copy button using the API, but if possible this would be a much better option. 
Photo of Alex Gale

Alex Gale

  • 1,124 Points 1k badge 2x thumb

Posted 4 months ago

  • 0
  • 2
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,296 Points 50k badge 2x thumb
All fields are copied.  No choice.  And unless you are some kind of javascript brainiac, there is no way to replicate what it does in terms of copying children and grandchildren.

So, what I do is to call the COPY button Step 1 of 2.   I then key off the copy of field to detect that this is a copy and contrive the form to force the user to click a 2nd URL formula button which clears fields (including the "Copy of" indicator field and any other edits required.
Photo of Alex Gale

Alex Gale

  • 1,124 Points 1k badge 2x thumb
I'm not understanding how you're detecting that the copy is a copy. What is the "Copy of" indicator field? How can I set it up? 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,296 Points 50k badge 2x thumb
In order to set up a copy master detail you need to select a text data field.  So for example it would be the field like Project Name.  So of the Project Name was called

"Figure out how to do a custom Copy Master detail"  (no doubt with child task records like RTFM, post to community forum, guess etc, then the clopied Project would be called

"Copy of Figure out how to do a custom Copy Master detail".

so I have a formula field like

Begins([Project name], "Copy Of") and if that is true, I know that the record was just copied.

As a part of the URL # 2 button I remove the leftmost 8 characters of the Project name to get rid of "Copy Of "
Photo of Leanne

Leanne

  • 250 Points 250 badge 2x thumb
Mark, is there any way that an automation could handle this? It is not recognizing an "add record" action just took place when the user clicks the Master/Child button, so it seems there is no trigger for me to set up for when to remove one of the copied fields.

My concern with doing the copied nomenclature and the formula field is that the users will never change the Copy field and the rule will always fire to remove the entry from the specific field because you will not be able to set it for "only when field changes" (because it will be like that from the add).
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,296 Points 50k badge 2x thumb
Interesting.  I never thought of using an Action or Automation for the Step 2 since they were not available when I started using the technique.  You should be able to use either one and trigger on add record and also the condition that the "Copy Of" field begins with copy of. 

Are you saying that you tried an Action or an Automation and it did not work.  It seems to me it should work perfectly.
Photo of Leanne

Leanne

  • 250 Points 250 badge 2x thumb
The automation process actually works* - so this is a great fix for a very old, annoying problem! I did not even need to include the Copy Of field - just set up my automation like this:

When a user Adds a Record on X table
Match the Record ID to the Trigger: Record ID
Update the field you want

*Sometimes you just need to walk away from the computer! It wasn't working originally because I accidentally typed a word along with the Trigger:Record ID 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,296 Points 50k badge 2x thumb
OK, great.  So I learned something too.  But don't you need to filter the automation / action on Copy Of.  What if a user just Adds a record the regular manual Add Record method. 
Photo of Leanne

Leanne

  • 250 Points 250 badge 2x thumb
Ah yes, it depends on what you what the action to do. I want it to delete a field being copied over, so for me it is just zeroing it out to what it would be on a normal add record.

To specifically target only the Master/Detail ones you could do that OR even better, you can indicate that the record has children records >0 as additional trigger criteria.