How do you delete a Procedure?


#1

How can you delete a procedure?


#2

Sorry about that. I accidently found the answer in “remove”


#3

You can also remove a procedure by dragging it to the trash in the View Organizer window.


#4

There doesn’t seem to be a way to quickly remove a lot of procedures at once; like about 150 of them.


#5

You could use dbinfo("procedures","") to get a list of procedures and then get the ones you want to delete with an arrayfilter. Once you have the list of procedures you want eliminated you can use the setprocedureoptions statement in a looparray to delete them. Here is a nasty little routine that will delete all the procedures in a database including the one running the code.

local theProcs
theProcs=dbinfo("procedures","")
looparray theProcs,cr(),element,index
    setprocedureoptions "",element,"DELETE",{}
endloop

:warning:️ Be warned that there is no undo for this and you would have to revert the file to get them back!


#6

If you add this line to the front of Gary’s procedure, it will make the procedure undo-able.

startdatabasechange "ProcedureConfiguration","Delete ALL Procedures"

#7

Thanks Gary, that would likely work but I ended up exporting the Blueprint to simply create a new database instead.

The idea was to hang on to a dozen or so key procedures, so I figured the Blueprint would be the second best choice for batch deletion. As it worked out, I encountered some other bug that I need to research, but while all the Forms exported, the Procedures folder was completely empty.

The Blueprint let me recreate the fields in a new database but now I have to move the desired procedures.


#8

Should be “Delete All Procedures” to be exact.:slight_smile:


#9

I’ve revised the original post, thanks.