how can I automatically change values of a number of status type fields back to nulls following copy parent and child.

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I'm using the excellent 'copy parent and child'.

At the moment, I have to have a two step process, where following the copy, the user has to click an API button on the new record to finish the process by resetting various 'status' type field  back to nulls.

The problem is that my users keep forgetting to click the button to complete the second step, and despite my best efforts to make it idiot proof using form rules to hide everything other than the API button until it's been clicked - they are still getting through!

How can I tag the API call onto the end of the copy parent and child process?

I'm sure it must be possible, but it's kind of beyond my coding ability.

Thanks in advance.

David

Photo of David

David

  • 60 Points

Posted 3 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 67,760 Points 50k badge 2x thumb
It's going to be tough because the Record ID is not known until it is created, so editing the newly created record is a challenge.
Photo of David

David

  • 60 Points
Thanks Mark,

Of course.

I'm thinking this could be a good use case for the new webhooks functionality!

(-:
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Couldn't you just edit the fields you don't want to copy over and uncheck the "Copy the value when using "Copy this XXX" to add a new XXX" option?

Or am I reading the question incorrectly :astonished:
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
If not, I'm 100% sure you could do it with dandiebolts image onload technique.  You'd have to ask him about it though, because I'm definitely not as much a js guru as he is.

You'd have to do something like if there's a checkbox checked then the iol will automatically wipe the fields.  Maybe have the checkbox check once it copies or something.
Photo of David

David

  • 60 Points
HI Scott,

I've previously been told that the checkbox on the field properties does not have any impact on the copy parent and child process.

Is my understanding wrong on this?

D
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 4,208 Points 4k badge 2x thumb
I have previously done an implementation where we needed to use the CopyParentChildren feature on an existing record (pre populated with a bunch of data); and then needed to empty out much of the previous data, leaving some of it in.

To do this, we had to create a Code Page which would run the CopyParentChildren and then after that was completed; would go back and modify the record and empty out fields as specified. 

If you cannot find a native free solution, feel free to reach out to me.
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Hmmm, sorry, I'm not too sure.  

Though I definitely use this checkbox in my application, however I'm only using the API GenCopyRecord.  

Perhaps like you said it doesn't work with copy parent and child. :(
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 4,208 Points 4k badge 2x thumb
You cannot customize the code which runs the CopyParentChild wizard/tool.  You would have to have a piece of code which strings together the two requirements.

Alternatively; add a button which does an API Edit Record to empty out the fields you need emptied after the new record gets created.  You would need to train your users to click it though.