Duplicate a Form

Hello Friends,
Is there a way to duplicate a form with a different name?

You can use the formblueprint command to get the current form blueprint, add the desired new name and then execute the blueprint to create the new version of the form with the new name. Here is sample code tailored from that in the Help file:

local blueprintCode
formblueprint "","MyForm",blueprintCode
blueprintCode={local targetFormName targetFormName="MyNewName" }+blueprintCode
execute blueprintCode

There is also the newformusingblueprint statement that will reduce that to one step.

http://www.provue.com/panoramax/help/statement_newformusingblueprint.html

To do it manually, you could copy the blueprint code from one form, and paste it into the blueprint of another,

Use the View Organizer wizard. If you want to make a copy of a form within a database, just right click on it and choose Duplicate. This will make a copy with the suffix copy added to the name. You can then open the new form and rename it to whatever you want.

You can also copy a form from one database to another simply by opening two copies of the View Organizer and dragging the form from one to the other. See the View Organizer documentation for more detailed information about all of this.

Thanks Jim. This is a whole lot easier than the other suggestions. Is there a good use for blueprint and an explanation of it?
Also, I finally got my “printtopdf” to work great, but I have a question. Could I get the dialog to appear so I can select color or print tray?
Thanks for all your help.

I haven’t written up the documentation for blueprints yet. Basically this feature allows you to convert the entire database into text files — all of the settings, preferences, field definitions, form objects, everything. Kind of like freeze drying. Then later you can “reanimate” to create the database again.

The primary reason I invented blueprints was for use with source control systems like git. These systems allow programmers to track the exact changes made to a program over time. Then if something winds up broken, you can see exactly what was changed and when. I use git to track all changes made to Panorama X, including the code written in Xcode and everything in Panorama’s libraries and wizards. The latter are exported as blueprints which git tracks.

At some point perhaps I’ll teach a class on how to use git with Panorama, but git itself is a pretty big topic.

By the way, if you simply want to make a copy of a form in a procedure, it’s probably easier to use the exportform( function and the importform statement. That’s what the View Organizer wizard uses. For example, if you have a variable that contains the name of a form in the current database, this line of code will make a copy of it.

importform exportform(formname),”name”,formname+” copy”

At this point, you have to choose one or the other. Either use the print statement for the dialog, but then you have no control over the options, or use the printtopdf statement but then you can only control the options provided. Perhsps someday there will be a way to use the print dialog but supply default options, but that is not something that is likely in the short term.

Thanks for the thorough explanation. I guess I miss the “Copy Form” and “Paste Form” in Pan 6. Easy to use.