0 votes

Hi Team,

I'm building an Extranet for a customer and I have to fill in some fields on a document when clicking a link. Until here, it works fine. After this I simply have to merge a template and store the key of this new attachment. This is done in the same edit context as before.

var editDocu    = Database.OpenEditContext(ntDocu, K_DOCUMENT);
var dataDocu    = Database.GetMasterDataSet(editDocu, 0);

dataDocu.Edit;
/** Here some fields are being filled in, this works. **/

var K_NEW_ATTCHM  = Database.MergeTemplate(editDocu, 7, null);
/** 
    Where 7 is the key of the template. The GUEST user 
    has full-control security on the template
**/

When this code gets executed I get the following error:

Cannot open Template! Can't show that item. It may have been deleted or you may not have the proper access rights to view this information.

The template (Key: 7) is an empty html template. The GUEST user has full-control security on the linked elements of the document.

Is there anything else that has to be done in order to make this work?

Thanks in advance :-)

Br,
Maxime

asked in WorkFlow / Serverscript by (164 points)
edited by
I have the exact same error, did you manage to find the solution ?

2 Answers

0 votes

Maxime.

Be sure the guest user has at least Show Table Rights on the Templates entity and also provide at least Read permissions on the template record.

answered by (7.4k points)
Thanks Kristof.

But this is something I've already checked. I even gave (temporarily) full-access to the GUEST user to find the problem but even then I get the same issue.
0 votes

What do you mean with "Where 7 is the key of the attachment".
It should be the key of the template record, not of the file.

answered by (7.4k points)
Yes indeed I mean the template, I corrected that. Thanks
Does it work now?
No I meant the key of the template not the file, sorry for that.
1,249 questions
1,519 answers
1,859 comments
328 users