Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Re: Text Only Precedents and Merging Events Empty Re: Text Only Precedents and Merging Events

Tue 31 Mar 2020 - 8:45
We're just creating our first ever text only precedent. However, I'm having an issue with any merge fields we added during the Merging event in the default Letterhead not populating.
In the Merging Event of the default letterhead, we have code which launches a wizard, and uses the results to add new fields. However, when I call a text only precedent of type Letterhead, as it merges you see it populate these fields (presumably as it runs the Merging event on the base prec), then set them to “NOT FOUND” (presumably as it runs Merging on the Text Only prec).
What are we doing wrong...?


avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Re: Text Only Precedents and Merging Events Empty Re: Re: Text Only Precedents and Merging Events

Tue 31 Mar 2020 - 8:45
You aren't doing anything wrong the problem is the text only part of the merge isn't aware of the data that was added during the letterheads merge. This means that after the text has been inserted the whole document is relinked without the original data and hence overwrites with 'Not Found'.
Unfortunately I can't think of an easy way around this.
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Re: Text Only Precedents and Merging Events Empty Re: Re: Text Only Precedents and Merging Events

Tue 31 Mar 2020 - 8:46
I hope this will be the last post on this subject. !
I've now got two possible approaches to this, and I'd like your advice on them:
1: Create a new precedent type cloned from Letterhead (call it “LH2”) and use this for all text only precedents. Then fire our wizard from the actual text only precedent. Then we can leave the original default letterhead for “Create Letter to Client” type functionality.
2: Launch the wizard from all text only precedents, and only launch the wizard from the default letterhead if it's not part of a text only merge. So the question on this one is, can we determine if this is a text only merge in the merging event of the default letterhead?
I'd be keen to hear what you think of the above approaches, and issues you can see etc.
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Re: Text Only Precedents and Merging Events Empty Re: Re: Text Only Precedents and Merging Events

Tue 31 Mar 2020 - 8:46
Option is the only viable option IMO, because the letter head has no knowledge of the text only and vice versa.
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Re: Text Only Precedents and Merging Events Empty Re: Re: Text Only Precedents and Merging Events

Tue 31 Mar 2020 - 8:46
We've been giving this some more thought. One theory we have is that if we can “un-link” the custom doc variables, i.e. convert them to text, on the default letterhead before the text only precedent fires, then this could give us the finished document we are looking for. We're just not sure if this is possible from within the C# I'm sure thee's VBA code to do this, but I'm not sure we have an appropriate event to handle to run it.
Does this idea have any mileage, any thoughts on how we could progress it?
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Re: Text Only Precedents and Merging Events Empty Re: Re: Text Only Precedents and Merging Events

Tue 31 Mar 2020 - 8:46
The only way I can think of is to store the values entered for the letterhead in memory (CurrentSession.SessionState) and in the merging event of the text only prec add them back in. You'd have to manage the SessionState to make sure you're using the correct data but everything will be running synchronously so you should be able to just remove the data once it's been consumed.
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Re: Text Only Precedents and Merging Events Empty Re: Re: Text Only Precedents and Merging Events

Tue 31 Mar 2020 - 8:47
I've done the above, and it seems to be working so far. Really pleased to have found a solution to this, when all looked a bit hopeless a while back! Thanks for your assistance as always
Sponsored content

Re: Text Only Precedents and Merging Events Empty Re: Re: Text Only Precedents and Merging Events

Back to top
Permissions in this forum:
You cannot reply to topics in this forum