Question

Word doc generation

I have a simple requirement - generate and download a word document using a template.

I have a Word Template and an Activity with below java code:

try
{
url=com.pegarules.generated.pega_appdefinition_documentapp.pzGenerateDocument("Word Template Name", tools, "Word Template applies to Class", null);
}

catch(Exception e)
{
oLog.error("Letter generation failed : " +url);
}

It doesn't work. Tried different things.

What could be the reason?

Correct Answer
June 21, 2019 - 11:51am

It worked when I checked Use alternate Domain.

Thank you.

Comments

Keep up to date on this post and subscribe to comments

Pega
June 20, 2019 - 9:08pm

Hi Srikanth,

I have tried the similar use-case for downloading word document with template, please find the attached for reference.

You can try tracing the activity to check if the url is properly getting generated, get the url from tracer and try to hit in any browser and see if the document is getting downloaded.

Also check if you see any errors.

Hope it helps.

Thanks. 

June 21, 2019 - 11:51am

It worked when I checked Use alternate Domain.

Thank you.