# Procedure #EXTENSION won't generate into a browse's ResetQueue method — %ActiveTemplateInstance doesn't resolve to the browse?

**URL:** <https://clarionhub.com/t/procedure-extension-wont-generate-into-a-browses-resetqueue-method-activetemplateinstance-doesnt-resolve-to-the-browse/9205>\
**Category:** questions\
**Tags:** templates, abc, browse\
**Created:** [July 1, 2026, 12:57pm UTC](https://clarionhub.com/t/procedure-extension-wont-generate-into-a-browses-resetqueue-method-activetemplateinstance-doesnt-resolve-to-the-browse/9205 "2026-07-01T12:57:50Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![RchdR](https://clarionhub.com/letter_avatar_proxy/v4/letter/r/d78d45/32.png) [@RchdR](https://clarionhub.com/u/RchdR)\
**Post date:** [July 2, 2026, 7:37am UTC](https://clarionhub.com/t/procedure-extension-wont-generate-into-a-browses-resetqueue-method-activetemplateinstance-doesnt-resolve-to-the-browse/9205/6 "2026-07-02T07:37:55Z")

</div>

> [@Klondike](#):
>
> %Primary did not resolve from the extension context (came back blank)

```clarion
#IF( %Primary )

```

returns the name of the %File so can be treated like a `%True` or `%False` in the `#If()` statement.

> [@Mark\_Sarson](#):
>
> ```auto
> #CONTEXT(%Procedure,%ActiveTemplateInstance)
> #!....Your code here
> #ENDCONTEXT
> 
> ```

From the help docs.

> The key to understanding the use of the #CONTEXT structure is “ **as if the source code for the named section were being generated.** ” This statement means that the statements are evaluated as if #GENERATE were executing.

In the context of the Instance/named section, this isnt strictly true in that **only a part of #Procedure will run** , the whole #Procedure template still runs, so its easy to get caught in loops, trigger `#Restrict`/`#EndRestrict` & `#Prepare`/`#EndPrepare` code if not careful.

> [@Klondike](#):
>
> Debugging tip that finally cracked it: I had the template write diagnostic comments into the generated .clw (into %DataSection) dumping each %ActiveTemplate and its INSTANCE() value. That showed me the instance was blank, which pointed straight at the fix. Being able to SEE what the template was resolving, rather than guessing, was the turning point.

[  
Create a #Code template which lists the builtin variables and their current value on whatever embed the #code template is placed as seen here.](https://clarionhub.com/t/template-to-add-correct-template-embeded-point/4933/10)

This website is saying I’m editing this post in another tab when I’m not!

---

_[View the full topic](https://clarionhub.com/t/procedure-extension-wont-generate-into-a-browses-resetqueue-method-activetemplateinstance-doesnt-resolve-to-the-browse/9205)._
