Solved

Running agent from a page

Posted on 2008-10-20
12
366 Views
Last Modified: 2013-12-18
I have an agent that runs on selected documents fine from a view.  When the same view is embedded in a page, the same documents are selected and I get the error "document has not yet been saved"

These documents have been saved for a long time.  Is there a way to fix this?
0
Comment
Question by:jkee54
12 Comments
 
LVL 21

Expert Comment

by:shuboarder
Comment Utility
I think in embedded views the lotusscript needs to be in an action button in order for it to work.

Please try this and let me know how you get on!
0
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
also run on unprocessed documents. yes...you should be running from a action button from the embedded view.
0
 

Author Comment

by:jkee54
Comment Utility
It looks like 'almost' the answer - it doesn't throw any error, opens Excel and does all the preliminary formatting, but doesn't bring in any values.  This is the part that doesn't work.  The cells are blank in the result.
'Row start

	row%=4

	

	Set doc=dc.GetFirstDocument

	

	While Not (doc Is Nothing)

		

'fill cells with values from Notes

		xlsheet.Cells(row%,1).Value=doc.Date(0)

		xlsheet.Cells(row%,2).Value=doc.EScore(0)

		xlsheet.Cells(row%,3).Value=doc.E1(0)

		xlsheet.Cells(row%,4).Value=doc.E2(0)

		xlsheet.Cells(row%,5).Value=doc.E3(0)

		xlsheet.Cells(row%,6).Value=doc.E4(0)

		xlsheet.Cells(row%,7).Value=doc.E5(0)

		xlsheet.Cells(row%,8).Value=doc.E6(0)

		xlsheet.Cells(row%,9).Value=doc.E7(0)

		xlsheet.Cells(row%,11).Value=doc.E8(0)

		xlsheet.Cells(row%,11).Value=doc.E9(0)

		xlsheet.Cells(row%,12).Value=doc.E10(0)

		xlsheet.Cells(row%,13).Value=doc.E11(0)

		xlsheet.Cells(row%,14).Value=doc.E12(0)

		xlsheet.Cells(row%,14).Value=doc.E13(0)

		xlsheet.Cells(row%,15).Value=doc.NewPolicy(0)

		

      		Set doc=dc.GetNextDocument(doc)

		row%=row%+1

		

	Wend

	

Open in new window

0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Try to embed the view in a form, not in a page, and prevent saving documents using that form: add one field with the name SaveOptions, computed, value "0".
0
 

Author Comment

by:jkee54
Comment Utility
ok. Here is what I have so far:

Action Bar Button in the view.  Works perfect from the view by itself.

Action Bar Button in the veiw when imbedded in either a page OR a form gives "document not saved" error.

Hotspot button on the page.  Works perfectly except does not bring in the values from Notes.  No error.

Hotspot button on the form.  Doesn't work at all.

I didn't post the entire code.  In general, it opens Excel, puts in column headers and does formatting like column widths etc, and brings in the code at the end.  I don't understand why the same exact code works from the native View but when it's in a Page Hotspot it won't bring the values.  Please let me know if the entire code would be helpful, but the piece I posted is the only part that doesn't work in the page.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Darn, I had hoped the form would solve the problem...

If a button is clicked from the view, it runs in the view's context. If the view is in a page or form, it runs in the form's context. The button on the form won't work, because it cannot access the embedded view. I suppose that the button on a page won't work for the same reason.

Did you try with the form and the debugger? To see where it gives up?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:jkee54
Comment Utility
OK, I understand why the hotspot button won't work on the embedded view.  But then why doesn't the action bar button that is IN the view that is embedded work? (that's the one that says document not saved).

The debugger doesn't reveal anything when running from the action bar button.  The error stops the code right at the beginning and the debugger doesn't even open.

From the hotspot button, the debugger goes to the point where the values should be brought from Notes and seems to jump right over that whole piece (the snipit I pasted here).  Then the code finishes without any results in the spreadsheet.
0
 

Author Comment

by:jkee54
Comment Utility
I know that when I select documents from the page, then open the native view from designer, that the same documents are selected.  Can I insert code that 'sends' it to the native view to run through the section of code that gets the values, since it works in the view?

Does that make sense?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Weird... I don't have a solution right now.

Here's a page that might help:

http://www-01.ibm.com/support/docview.wss?uid=swg21279380
0
 

Author Comment

by:jkee54
Comment Utility
I read the article and it did seem to address the problem.  Thier solution was already in my code except that they place the code in an action bar button event of the view.  I tried that and still get the 'no document selected' error when running from the page OR a form, and no error when running from the native view.


0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
Comment Utility
It doesn't happen very often that I dislike Notes... but this is just one of those things... One can only hope this "feature" is corrected in some later release.

So sorry I couldn't help you. :-|
0
 

Author Closing Comment

by:jkee54
Comment Utility
Thank you for taking me as far as you did!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now