Merge problem in Word template

If you think that something doesn't work in Aware IM post your message here
Post Reply
pixerp
Posts: 180
Joined: Sun Jan 28, 2007 7:12 pm

Merge problem in Word template

Post by pixerp »

In test BSV, I have the following :

BO's:
. Address with attribute Name
. DocTemplate with attribute TemplateName
. DocMerged with attribute Subject, LetterDoc and reference attributes Address, DocTemplate

Queries:
. Address
. DocTemplate

Document templates:
. Templ1 with <<DocMerged.Address.Name>> and <<DocMerged.Subject>>

CreateDoc process (with Address, DocTemplate as Input):
. ENTER NEW DocMerged WITH DocMerged.LetterDoc=ThisDocTemplate.TemplateName, DocMerged.Address=ThisAddress,DocMerged.Subject=ThisDocMerged.Subject USING Main
. VIEW DocMerged USING Main

After entering Templ1 in DocTemplate and 2 address Names, the CreateDoc process requires a select Address (because of Input) and display the DocMerged form.

In the form, I can see the selected Address, the selected Templ1 and I enter some data in the Subject field. Then, I click on Create button.

Problem: the subject never gets merged in the LetterDoc document !
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

pixerp,

The problem is that DocMerged.Subject is not saved yet when DocMerged.LetterDoc merges info into the template in your ENTER NEW statement above.

Modify your CreateDoc processs to be 3 steps as follows:

1- ENTER NEW DocMerged WITH DocMerged.Address=Address,DocMerged.DocTemplate=DocTemplate

2- DocMerged.LetterDoc=DocMerged.DocTemplateName

3- VIEW DocMerged USING Main

Moving the creation of DocMerged.LetterDoc to step 2 allows the DocMerged.Subject info to be input and saved by the user during the ENTER NEW in step 1.

Hope this helps,
Tom

PS -- I don't think the THIS prefix is necessary in your CreateDoc process because only one instance of both Address and DocTemplate BOs are already in context.
Post Reply