Hook at print time. Hook #1

I have a hook running a print time.  The problem I am having is my hook needs 
to have the transaction saved first before the hook runs and the only time I 
can see that happening before printing is the before print hook #1.  The 
problem I am having is the hook is supposed to update the transaction just 
updated and then print and the XML receipt file is supposed to use some of 
the information just saved.  It seems that even though this hook is supposed 
to be before print time that it is actually formulating the XML file and 
getting the receipt ready before the hook is ran.  

Does anyone know exactly how this hook works (the hook #1) ?  The actual 
process flow like is the XML receipt file actually getting started before the 
hook runs, even thought the hook is supposed to be before any printing 
starts?  Ideas?

Thanks,
Nick
0
8/9/2005 9:21:02 PM
pos 14173 articles. 0 followers. Follow

4 Replies
873 Views

Similar Articles

[PageSpeed] 58

Are you updating the transaction  by writing to the database directly, or 
are you setting properties in the Session object as well?  The Receipt is 
being printed from information in the Session, not the database.

-- 
Glenn Adams
Tiber Creek Consulting
http://www.tibercreek.com
glenn@tibercreek.com
----------------------------------------------
Please DO NOT respond to me directly but post all responses here in the 
newsgroup so that all can share the information



"ClothingStore" <ClothingStore@discussions.microsoft.com> wrote in message 
news:6BFC2607-6C48-439D-945B-745F31342CC0@microsoft.com...
>I have a hook running a print time.  The problem I am having is my hook 
>needs
> to have the transaction saved first before the hook runs and the only time 
> I
> can see that happening before printing is the before print hook #1.  The
> problem I am having is the hook is supposed to update the transaction just
> updated and then print and the XML receipt file is supposed to use some of
> the information just saved.  It seems that even though this hook is 
> supposed
> to be before print time that it is actually formulating the XML file and
> getting the receipt ready before the hook is ran.
>
> Does anyone know exactly how this hook works (the hook #1) ?  The actual
> process flow like is the XML receipt file actually getting started before 
> the
> hook runs, even thought the hook is supposed to be before any printing
> starts?  Ideas?
>
> Thanks,
> Nick 


0
glenn1806 (721)
8/9/2005 9:36:06 PM
I am updating the database transaction directly.  Is that my problem?  The 
XML receipt file is getting data from the session and not the database?  Is 
there a way for me to get around this?

"Glenn Adams [MVP - Retail Mgmt]" wrote:

> Are you updating the transaction  by writing to the database directly, or 
> are you setting properties in the Session object as well?  The Receipt is 
> being printed from information in the Session, not the database.
> 
> -- 
> Glenn Adams
> Tiber Creek Consulting
> http://www.tibercreek.com
> glenn@tibercreek.com
> ----------------------------------------------
> Please DO NOT respond to me directly but post all responses here in the 
> newsgroup so that all can share the information
> 
> 
> 
> "ClothingStore" <ClothingStore@discussions.microsoft.com> wrote in message 
> news:6BFC2607-6C48-439D-945B-745F31342CC0@microsoft.com...
> >I have a hook running a print time.  The problem I am having is my hook 
> >needs
> > to have the transaction saved first before the hook runs and the only time 
> > I
> > can see that happening before printing is the before print hook #1.  The
> > problem I am having is the hook is supposed to update the transaction just
> > updated and then print and the XML receipt file is supposed to use some of
> > the information just saved.  It seems that even though this hook is 
> > supposed
> > to be before print time that it is actually formulating the XML file and
> > getting the receipt ready before the hook is ran.
> >
> > Does anyone know exactly how this hook works (the hook #1) ?  The actual
> > process flow like is the XML receipt file actually getting started before 
> > the
> > hook runs, even thought the hook is supposed to be before any printing
> > starts?  Ideas?
> >
> > Thanks,
> > Nick 
> 
> 
> 
0
8/9/2005 10:00:10 PM
There are 10 Session Variables that you can use to store your information. 
These are accessible to the Receipt engine.

In your add-in:
mySession.Variable(1) = "My String Value"

In your Receipt Template
<ROW> "My Label: |" Session.Variable1 </ROW>

Also, if you are changing existing values rather than inserting values that 
do not otherwise exist in RMS, you can change the values in the properties 
of the Session object.  These changes should persist to the receipt. 
Really, this would be the preferred method for getting values into the 
database - you should only write directly to the database during a 
transaction if you are adding extended fields.

Hope that helps...

-- 
Glenn Adams
Tiber Creek Consulting
http://www.tibercreek.com
glenn@tibercreek.com
----------------------------------------------
Please DO NOT respond to me directly but post all responses here in the 
newsgroup so that all can share the information



"ClothingStore" <ClothingStore@discussions.microsoft.com> wrote in message 
news:9FA5179B-89B1-4A0E-9165-872C805FE9B7@microsoft.com...
>I am updating the database transaction directly.  Is that my problem?  The
> XML receipt file is getting data from the session and not the database? 
> Is
> there a way for me to get around this?
>
> "Glenn Adams [MVP - Retail Mgmt]" wrote:
>
>> Are you updating the transaction  by writing to the database directly, or
>> are you setting properties in the Session object as well?  The Receipt is
>> being printed from information in the Session, not the database.
>>
>> -- 
>> Glenn Adams
>> Tiber Creek Consulting
>> http://www.tibercreek.com
>> glenn@tibercreek.com
>> ----------------------------------------------
>> Please DO NOT respond to me directly but post all responses here in the
>> newsgroup so that all can share the information
>>
>>
>>
>> "ClothingStore" <ClothingStore@discussions.microsoft.com> wrote in 
>> message
>> news:6BFC2607-6C48-439D-945B-745F31342CC0@microsoft.com...
>> >I have a hook running a print time.  The problem I am having is my hook
>> >needs
>> > to have the transaction saved first before the hook runs and the only 
>> > time
>> > I
>> > can see that happening before printing is the before print hook #1. 
>> > The
>> > problem I am having is the hook is supposed to update the transaction 
>> > just
>> > updated and then print and the XML receipt file is supposed to use some 
>> > of
>> > the information just saved.  It seems that even though this hook is
>> > supposed
>> > to be before print time that it is actually formulating the XML file 
>> > and
>> > getting the receipt ready before the hook is ran.
>> >
>> > Does anyone know exactly how this hook works (the hook #1) ?  The 
>> > actual
>> > process flow like is the XML receipt file actually getting started 
>> > before
>> > the
>> > hook runs, even thought the hook is supposed to be before any printing
>> > starts?  Ideas?
>> >
>> > Thanks,
>> > Nick
>>
>>
>> 


0
glenn1806 (721)
8/10/2005 1:21:02 PM
Thanks Glenn, you are great.

"Glenn Adams [MVP - Retail Mgmt]" wrote:

> There are 10 Session Variables that you can use to store your information. 
> These are accessible to the Receipt engine.
> 
> In your add-in:
> mySession.Variable(1) = "My String Value"
> 
> In your Receipt Template
> <ROW> "My Label: |" Session.Variable1 </ROW>
> 
> Also, if you are changing existing values rather than inserting values that 
> do not otherwise exist in RMS, you can change the values in the properties 
> of the Session object.  These changes should persist to the receipt. 
> Really, this would be the preferred method for getting values into the 
> database - you should only write directly to the database during a 
> transaction if you are adding extended fields.
> 
> Hope that helps...
> 
> -- 
> Glenn Adams
> Tiber Creek Consulting
> http://www.tibercreek.com
> glenn@tibercreek.com
> ----------------------------------------------
> Please DO NOT respond to me directly but post all responses here in the 
> newsgroup so that all can share the information
> 
> 
> 
> "ClothingStore" <ClothingStore@discussions.microsoft.com> wrote in message 
> news:9FA5179B-89B1-4A0E-9165-872C805FE9B7@microsoft.com...
> >I am updating the database transaction directly.  Is that my problem?  The
> > XML receipt file is getting data from the session and not the database? 
> > Is
> > there a way for me to get around this?
> >
> > "Glenn Adams [MVP - Retail Mgmt]" wrote:
> >
> >> Are you updating the transaction  by writing to the database directly, or
> >> are you setting properties in the Session object as well?  The Receipt is
> >> being printed from information in the Session, not the database.
> >>
> >> -- 
> >> Glenn Adams
> >> Tiber Creek Consulting
> >> http://www.tibercreek.com
> >> glenn@tibercreek.com
> >> ----------------------------------------------
> >> Please DO NOT respond to me directly but post all responses here in the
> >> newsgroup so that all can share the information
> >>
> >>
> >>
> >> "ClothingStore" <ClothingStore@discussions.microsoft.com> wrote in 
> >> message
> >> news:6BFC2607-6C48-439D-945B-745F31342CC0@microsoft.com...
> >> >I have a hook running a print time.  The problem I am having is my hook
> >> >needs
> >> > to have the transaction saved first before the hook runs and the only 
> >> > time
> >> > I
> >> > can see that happening before printing is the before print hook #1. 
> >> > The
> >> > problem I am having is the hook is supposed to update the transaction 
> >> > just
> >> > updated and then print and the XML receipt file is supposed to use some 
> >> > of
> >> > the information just saved.  It seems that even though this hook is
> >> > supposed
> >> > to be before print time that it is actually formulating the XML file 
> >> > and
> >> > getting the receipt ready before the hook is ran.
> >> >
> >> > Does anyone know exactly how this hook works (the hook #1) ?  The 
> >> > actual
> >> > process flow like is the XML receipt file actually getting started 
> >> > before
> >> > the
> >> > hook runs, even thought the hook is supposed to be before any printing
> >> > starts?  Ideas?
> >> >
> >> > Thanks,
> >> > Nick
> >>
> >>
> >> 
> 
> 
> 
0
8/10/2005 1:59:04 PM
Reply:

Similar Artilces:

HTTP Error 403.1
hello all, I have installed CRM 1.2 on a Windows SBS 2003 with SQL SP4. I make an additional CRM folder in ISS and change the port from 80 to 8083. Now we get the following error After we login to CRM: The page cannot be displayed You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed. -------------------------------------------------------------------------------- Please try the following: Contact the Web site administrator if you believe this directory should allow execute access. HTTP Error 403.1 - Forbid...

How to print out custom properties only?
I want to print out all the fields in custom properties as a page. Is there a way? Thanks, GG You can do so with a macro Sub PrintCustomProperties() Dim oProperty As DocumentProperty Dim oDoc As Document Dim PropDoc As Document Dim oRng As Range Set oDoc = ActiveDocument Set PropDoc = Documents.Add PropDoc.Range.ParagraphFormat.TabStops.Add InchesToPoints(2) For Each oProperty In oDoc.CustomDocumentProperties Set oRng = PropDoc.Range oRng.Collapse wdCollapseEnd oRng.Text = oProperty.Name & vbTab & oProperty.Value & vbCr Next oProperty PropDoc.Pri...

AddJob function for printing
I'm trying to find a sample. This is another function that is not working the same on an XP machine. I'm getting error 1784: The supplied user buffer is not valid for the requested operation. code is similar to: BYTE* bBuf = NULL; cbBuf = sizeof(ADDJOB_INFO_1); bRet = AddJob(hPrinter, 1L, bBuf, cbBuf, &cbNeeded); if ( !bRet ) { error = GetLastError(); ...... etc bRet is zero value and pcbNeeded is returning the value of zero. The next step would be to call AddJob again with bBuf set to whatever cbNeeded established but the zero value triggers an 87, par...

How to Print thumbnail Groups of pictrues receved in one email
Need to know how to print pictures received in emails anyway but one at a time. ...

Need a time-date stamp for MS Outlook, please
I apologize in advance if I am sending this request to the wrong place... I would like to have a button in my MS Outlook 2000 toolbar, that when clicked, it will place the DATE/TIME on (whatever) the cursor is located. I work (volunteer) with a non-for-profit Church organization that has no money to pay programmers, to develop (what I was told) this simple task; therefore, I was advised to use this Internet avenue, and see if I could get a script of add-in (I apologize if I am using the wrong terminology - I am not very knowledgeable with computers either). I would like this featur...

Many to 1 Relationships in CRM 4.0 #2
Hi I just wondering if there is a suggested way to create multiple many to 1 relationships in CRM 4.0. We have created a custom entity and we need to associate more than 1 type of contact with the custom entity. We have a nominated and a registered contact. We have created two many to 1 relationships with contacts and the custom entity. The problem is that the name of the custom entity now appears twice in the navigation pane for contacts. We can select the 'Do not display option' however the custom entity will not appear in the navigation pane for the 'nominated contacts&...

printing emails in outlook (2000/2002)
I am trying to find a simple way to print only the first page of an received email. I cannot seem to figure it out. whether the email is in html, plain or rich text, I cannot print only the first page. any ideas/tricks? thanks davit ...

merge printing
How do I merge print a zip code that begins with zero? Change the data base field to text. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "rick" <rick@discussions.microsoft.com> wrote in message news:05CDA400-61D1-4535-B8CF-17F44A7D6779@microsoft.com... > How do I merge print a zip code that begins with zero? ...

ERROR TRYING TO PRINT-URGENT
Dear users: I'm getting this error when I try to print a message from my INBOX, why? " An error has ocurred in the script on this page Line 252 Char 1 Error: Permission denied"' I'm the administrator and have total privileges Arturo ...

How do I write the fraction "1/n" ? #2
How can I write "1/n" ?? Hi Elena Select Format/Cells/Number and select Fraction. Then simply type in 1 / n HTH Michael "Elena" wrote: > How can I write "1/n" ?? Just using my imagination here. Are asking how to represent a vaule as "1/n"? If you have a value in A1 ="1/"&1/A1 If A1=4, this returns 1/0.25 or if if A1=0.25, this is 1/4 If this is what you're looking for you might to use a round on A1 ="1/"&1/round(A1,<#ofdigits>) I'd be curious to hear if there is a way customer format this. O...

Critique a function to convert time, please
I have a bunch of data representing time intervals that come from a database application. The intervals vary from a few seconds to several years. The database (MySQL) stores time intervals as fixed point numbers in units of seconds. Reading the values in seconds is unnatural (a year is ~31.5E6 seconds), so I wrote a little UDF to convert the seconds to more natural units. The conversion is: Value Units <60 seconds Seconds <60 minutes Minutes <24 hours Hours <99 days Days Otherwise Years I chose 99 days as the threshold betwe...

Printing reports #3
Money Ess. How do I print a report for gross pay, or net pay,or some form of income . I look at help page and it say"s to go to commen task to pick this task ,But it"s not available . ...

making and printing forms
I am on a fire department and I want to make our run forms where we can fill in the blanks and then print them if need be. I have office 2007 but have no idea how to do this, and I have seen forms on the internet that are pdf forms that have worked like we need. Any help is greatly appreciated. pdf forms can be made with the full retail version of acrobat. however, in office what you probably need to make is a template. you can also make forms in excel and msaccess. it depends if the form data is to be aggregated in a database or not. unfortunately, we can't teach ...

Cancel printing a worksheet
Actually, I've tried printing by selecting the workbook icon and printing in the blocked sheet and the entire workbook, I've right clicked on a tab and selected all sheets, I've tried to print when the blocked sheet is the activesheet, and I've selected the "Entire workbook" radio button when any sheet is active, and in all cases Sheet1 does not print. Perhaps I've missed another means to print the entire workbook or the one worksheet. Is there another way to print the whole workbook or a particular worksheet that I have not tested? The code below als...

12.1.1 Updare
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: intel Do you have to install SP1 in order to install the latest update? I re-installed office + 1st update but did not install SP1 after all the problems. None of the 'fix' suggestions worked for me. "mortfe@officeformac.com" wrote: > > Do you have to install SP1 in order to install the latest update? I > re-installed office + 1st update but did not install SP1 after all the > problems. None of the 'fix' suggestions worked for me. Yes, it's a requirement for 12.1.1. -- Diane ...

Printing Grid lines
Excel 2002 was just loaded on my comuter. I cannot figure out how to print gridlines. I went to Tools, Options and View tab and checked gridlines there. I also went to File, Page Setup and sheet and checked gridlines there. When I do a print preview, the show on the screen but when I print, they do not print. Any ideas? Thank you Susan Vickstrom Minnesota State Community and Technical College Fergus Falls Campus 218-739-7555 Could be related to printer resolution. Try setting pritner to Draft and the Best Quality and observe the difference. Bernard "Susan Vickstrom" &l...

How do I write the fraction "1/n" ?
I just want to write "1/n " . How can I make that possible? Format the cell as Text prior to entering the data, or precede the data with an apostrophe. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Elena" <Elena@discussions.microsoft.com> wrote in message news:9388F5FF-0824-4156-B1F8-1C7ED958E3C9@microsoft.com... >I just want to write "1/n " . How can I make that possible? > On Sun, 27 Feb 2005 13:57:02 -0800, "Elena" <Elena@discussions.microsoft.com> wrote: >I just ...

Numpty Email Time Stamp Question
Hi all Am I right in thinking that the time stamp on each email routed via Exchange to Outlook will be controlled by the server? Exchange2003, Windows Server2003, Outlook 2003. Users are complaining that replies to messages are being dated before the time of the original message. TIA Phil hi check the date/time/daylight setting in the client computers & server shai -- "TheScullster" wrote: > Hi all > > Am I right in thinking that the time stamp on each email routed via Exchange > to Outlook will be controlled by the server? > Exchange2003, Windows...

setting parent account : Request times out
When I try to set the parent account of certain accounts, I get a request time out error. Any ides why this must be happening? ...

Memo style printing of e-mail
We use Outlook 2003 [with all updates] on an Exchange Server network. I recently moved a user to a different computer and, after setting up her profile, noticed that her "default" print style appears to be "Table" not "Memo". (The header/footer info does not print on a received e-mail, regardless if the sender is using HTML or plain text.) Other users are not having this issue. Is there a global setting to default to "memo style"? And if so, what might override it? Thanks in advance. ~RLL 08/09/2005 ...

Clipping of images when printing
Some of the smaller images on my leaflet have been clipped (ie partially cut off) when printing. Looking at them on the print preview the clipping is not evident on there. What do I need to do? Thanks, Sarah Are they near the edges of your paper? Are they overlapped by a text box or something like that? -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "millieminx" <millieminx@discussions.microsoft.com> wrote in message news:C4146D2F-8395-4BCA-BD99-37A7EB328DDA@microsoft.com... > Some of the smaller images o...

HELP: how to turn 1 DCOM service into cluster/replicated services
I have a massive DCOM service written in Visual C++ 6.0 + MFC that manages user logins & their sessions. When the service is running live, how does one upgrade it, without kicking the currently logged in users? Is it possible to replicate the service to implement resiliency & failsafe/faileover mechanisms? Would it have been better to implement a REAL client/server approach for multiple servers for resiliency & failsafe/failover mechanisms? >I have a massive DCOM service written in Visual C++ 6.0 + MFC that manages >user logins & their sessions. When the servic...

Printing Portfolio
When viewing my portfolio, I used to be able to print my portfolio that I customized. i.e..file--> print. All of a sudden, printing doesn't work. Anyone have any ideas? I've searched all over the net and can't find anything. Thanks I have found the same problem, although mine has gotten worse. Now when I do file --> print, it opens MS Word and displays it in there!! I have tried EVERYTHING I can think of, including reinstalling MS Money, making sure the file types are not set to open with Word, everything. Have you found a way to make it work again? By the w...

Screen or print option while printing report
Allow a default for the company or the user that can set the report option ( Screen or Print ) -- Regards Santosh ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=8c0c7c3b...

using the time structure with MFC
Hi, Coming from C, how could I translate this into MFC based code (using CString)? char szTime[65], szDate[65]; time_t t = time(0); struct tm* tm = localtime(&t); strftime(szDate, 64, "%Y%m%d", tm); strftime(szTime, 64, "%H%M%S", tm); CString strTime, strDate; Thanks CTime Time = CTime::GetCurrentTime(); CString strDate = Time.Format("%Y%m%d"); CString strTime = Time.Format("%H%M%S"); AliR. "markww" <markww@gmail.com> wrote in message news:1156883820.948360.39250@m79g200...