web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Report Template Storage Location

(0) ShareShare
ReportReport
Posted on by 195

Good afternoon,

I have a user whose manager left the company and she would like to get a report for which it is likely that he used a non-public template.  Is there somewhere I can go as an admin to find all of those templates to see if I can find the one she is looking for?

Thank you!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mark E Profile Picture
    6,451 on at

    The only way to locate/review the Templates is to query the Template table in the System database, where the UserID field <> '' (any Template with a UserID is Private).

    But the details of the Template itself are stored in SmartText format, so you won't be able to read it...

    I have a query that will decode the contents of any Template if you want to use it....

  • Shaun Fortune Profile Picture
    195 on at

    I would love to use it.  It will save me a lot of time!

  • Verified answer
    Community Member Profile Picture
    on at

    There is a template table in the system dbase.  It is private is it has a userid.  So to clear all userIDs and make all templates public, you could run this script.

    update Template set UserId = ''

  • Shaun Fortune Profile Picture
    195 on at

    Thank you so much, Elaine.  It worked!!  I really appreciate your assistance.

    Have a great week!

  • DUB Profile Picture
    on at

    I would love to have the script that decrypts the temp SmartText field.  Can you share that/

  • Suggested answer
    Mark E Profile Picture
    6,451 on at

    --Run the following script against the System DB

    Declare @statement as nvarchar(4000)

    Declare @startposition as varchar(100)

    Declare @smarttext varchar(8000)

    Declare @i as integer

    Declare @TemplateID char(30)

    Declare @ScrnNbr char(5)

    -- ====================================

    -- set the TemplateID that you are looking for

    SET @TemplateID = 'XXXXXXXXXXXXXXXXXX'

    -- set the ScrnNbr of the Template ID (in case there are more than 1 Template with the same ID)

    SET @ScrnNbr = 'XXXXX'

    -- ====================================

    Set @i =1

    Set @smarttext =''

    While @i < 1000000

    Begin

    Set @smarttext = @smarttext +

    -- we need to convert the Image to varbinary, then to varchar

    -- the result of the two conversions is LTrim-ed & RTrim-ed

    -- it is converted in 100 char chunks - each of which is

    -- separately Selected from the Template table

    (Select Substring(LTrim(RTrim(

    Convert(varchar(8000), Convert(varbinary(8000), SmartText))

    )

    ),@i,100)

    From Template

    Where TemplateId = @TemplateID

    AND ScrnNbr = @ScrnNbr

    )

    Set @i = @i +100

    End

    -- Using PRINT obeys cr/lf chars which are presumably in the data

    Print @smarttext

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans