How to #Restrict a #Procedure from the select Procedure Type window?

So I have a template with a number of different #Procedure(....) which I can choose from when I add a new procedure.

Thing is, some of those #Procedures(...) I dont want to be selected, it depends on conditions set in the #Application global properties, whether someone can see them and select them or not.

I’ve tried

#Restrict,Where(My conditions)
#Procedure(.....)
#EndRestrict

but thats not allowed, and I also tried

#Procedure(.....),Where(My conditions)

but thats not allowed.

Is there anyway I can prevent some #Procedure(...) from being selected?

TIA

Read the help on #RESTRICT which has an example showing it goes after not around. Also some of the best examples of template programming can be found by searching the shipping or accessory templates, in your case for #RESTRICT. I found 48, here’s one:

#CONTROL(BrowseFuzzyMatching, 'Browse Fuzzy Matching'),REQ(BrowseBox)
#RESTRICT
  #IF(NOT %FuzzyMatchingEnabled)
    #REJECT
  #ENDIF
#ENDRESTRICT

https://clarion.help/doku.php?id=restrict_define_section_use_constraints_.htm

Yeah I saw the #Restrict,where was immediately after the
#Procedure, #Code etc but I didnt see the #Reject.

#Procedure(....)
#Restrict,Where(My condition)
#Reject
#EndRestrict

This works perfectly thanks!

Edit. I did read the help doc, but the example used some control code so I assumed it was for template code below the #Procedure, #Code, statements, I didnt think my example above would prevent the #procedure extension from appearing in the select procedure type window, but it seems the ,Where(My condition) will refer to template symbols defined at the #application global properties level, which is handy.

I’ve been through some of the shipping templates and cant say I’ve seen this particular example in use, but I’ll keep a look out for one because there might be an example in there.