copyMasterDetailButtonHandler with field name for SourceRID

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
We would like to pass a numeric field name for the SourceRID and keep getting a Source Record Does not Exist error.  Background is that we are attempting to copy a template of tasks into a new project based upon a project type table.  The table cross-references the project type to the template project's ID to be copied.

This is the default calculation, it works fine

"javascript:void(copyMasterDetailButtonHandler('&relfids=35&sourceRID=13&destrid=" & [Project ID#] & "', 'bmcykybq6'))"

This is the desired calculation and it does not work.

"javascript:void(copyMasterDetailButtonHandler('&relfids=35&sourceRID=[Numeric Field Name] &destrid=" & [Project ID#] & "', 'bmcykybq6'))"



Any assistance would be appreciated, Ron
Photo of Ron

Ron

  • 50 Points

Posted 2 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
it would be better to be using the generic API form of the Copy Master detail, but let's give one shot at getting this to work



"javascript:void(copyMasterDetailButtonHandler('&relfids=35&sourceRID=" & ToText([Numeric Field Name]) & "&destrid=" & [Project ID#] & "', 'bmcykybq6'))"
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
I presume that the contents of the [Numeric field name] is the calculated Record ID of the Source Project
Photo of Ron

Ron

  • 50 Points
Yes, that is the field.  Making the join was a little confusing since the desired Record ID is not the ID of the project, but of the related template to be copied.  The number of project templates will be well over a dozen, so I decided that adding a button for each template was going to be cumbersome.

The solution worked.  I presumed that the sourceRID was a numeric since the entry was a number.  Shows the problem in assumptions...

Thanks, Ron