Can we add @Toolsrunmaro("Agent") or @Command([runagnt];"agent1") in a dialoglist?

Hi All,I am tring to use formula like:

,

@DbColumn(class : cache ; repid ; “(LookupCategory)”;1);

,

But there will be popup window generated by Notes which lists all available server names if user does not have access to that specific database, this window is annoying users. I tried a lot,it seems there are no way to validate @DbColumn before execute that line code,

So I am thining to use lotusscript instead, but when I add @Command( [RunAgent] ; agent ) or @Command( [ToolsRunMacro] ; agent ) , I got message @Command can not be used in this context on my status bar,

Anybody has any good idea to solve my problem?

Thanks a lot,

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

It seems like, when you know a database will be accessing other databases, you could add database Postopen code to search for the other databases and add them to the user’s desktop. If the user is in a local replica, you could search first locally and then on servers that you know it should be on.

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Hi Andre,It is nice getting your help again, thanks a lot,

This is what happened:

Let’s make the complex case to simple as this; I have a notes document created by other users, the document has another database replica id and I had already created a (LookupCategory) in that database which first column is the categories. Now, I have another Dialoglist field used for picking up the category by this code:

@DbColumn(class : cache ; repid ; “(LookupCategory)”;1);

When I open the document, if I do not have access to that database(repid), then I will get the error(server) message.

Yes, local replica is nother issue, but I need make it working on server first.

Ideally, I can have some statement before @DbColumn, if I do not access, then popup message, when user click the dialogbox button, popup a message to tell user the access limit. I tried to use @Iserror after @Dbcolumn, but it is too late.

Please let me know if you need more information.

Thanks again,

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Are you saying the solution I suggested will not work for you because you don’t know what database they’ll be using until they’re in the document?

You realize you any database the user happens to choose is unlikely to contain a view called “(LookupCategory)”, right? I assume there’s a limited set they can choose from. So you could still do what I said, but add all of them.

You could put code in the document Queryopen to do the same for databases referenced from that document… My concern is that this would cause slowness if you have to do it every time you open a document.

If you can determine the filepath of the referenced application on the same server, then you could specify the server and filepath in your formula.

Another thing to consider is that, for some types of keyword fields, you don’t need the keyword list if the document is opened in read mode. Use @If(@IsDocBeingEdited; @Dbwhatever(…); @Unavailable) in the keyword formula to avoid doing the lookup unless the user is editing the document. You could confirm that the referenced database is available in the Querymodechange code (and in Queryopen in edit mode).

You might also get better performance, as well as bypassing the whole issue, if you can arrange that the lookup list be stored in the same database. You could have a scheduled agent that reads the choices out of each of your databases that have the design that includes the “(LookupCategory)” view, and store copies of these lists in “keyword” documents in the database?

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Hi Andre,I am very appreciate for your quick response help every time when you read my post.

Since we are getting the close for my questions, then let me tell you the real story of my issues:

We have done some modification for Notes mail(6.5) to allow user to file the email to a corporate library database(we have about 800 databases ), those databases work as the document library inherited from a standard template, all of them have the (LookupCategory) view to list the categories in the first column.

When a user want he or her email be filed(archived) to the corporate db before sent, we have added extra fields in Memo form to allow user the enter the server of corporate db library with replicaid, and category. so after the email has been sent, a scheduled agent will work on the night to scoop that email from Sent folder to corporate db(basically just copy all noteitems and save it in that corporate lib db).

Now the problem is the category field which is dialogbox, when email composer create an email, he will populate the database infor to the memo form, then another category field will get the associated category and choose the one he needs then send it. so after the email was sent, all of that categories from that database were saved in two text fields(because 64 limition and a big category) with the email, and the formula in the Category field is like(@Explode(DocLibCategories+“;”+CategoryListInit+“;”+CategoryListInit_1;“;”), this is working. But as the corporate lib db grows faster, so many data saved with email caused the email slower.

So instead of save that many categories in Memo doc, I would to use @Dbcolumn on the dialoglist field to pick that category on the fly. But the problem is that, if a user chose some corporate db which the email receive does not access, so when receiver open that email, they he will get the popup box contains many server there, which is annoying user.

your code @If(@IsDocBeingEdited; @Dbwhatever(…); may be help, I am going to try it,

But I would prefer some thing like do not try to execute the @dbcolumn is he does not excess to that db.

I even add this line of code @If(@IsError(@Command( [FileOpenDBRepID] ; “85257004:004083F1”));@Prompt([Ok];“no access, error”;“Error”);“”), to test it there are no access, then do not bother to execute @DbColumn(), but unfortunately, I still get that window popup.

Please let me know if you need more information, I know it is not simple case.

Thank you so much again,

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

The email recipient is unlikely to edit the message. If they do not edit the message, then taking a few seconds to look up the list of categories from the library database is a total waste of the recipient’s time. Why should they wait for this? They don’t care what other categories are available but not selected.

To avoid doing the lookup in read mode, you could use a keyword formula with @IsDocBeingEdited, as I showed in my previous post.

Or, you could take the fields off the form, as we do for the extra values in the Delivery Options dialog. You could have Computed for Display fields or other indications on the main form that the email is being archived to a library database, if you wish, without making them editable fields.

If you want to add code to find out whether the user’s computer already knows where to find the library database, you will have to do it using LotusScript. I don’t know a way in macro language to try to find a database by replica ID, without being prompted to select a server if the replica ID is not already known to the client.

I’m not AT ALL suggesting that you save a long list of categories in the memo document. I had in mind for you to save the list of categories in some other document in the database that you can use as a quick reference. But now that you have explained the situation I no longer think that’s a good idea.

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Hi Andre,Thank you so much for the details response, sorry I was not clearly explaining the situations.

When the email was sent to the receiver, the corp db infor have to be saved in that email, the reason is that for user referance, because more often the receiver will file(achieve) his reply to the same categories of same corporate lib database, of course, they have to option to change the categories or database they want. With the categories saved in the email, and categories dialoglist field lookup those infor with the email, this will avoid that popup window if the receiver do not have access to that db. But the drawback is that as the corp db grows big, there are more categories there, so it takes a while to open the mail.

using @IsDocBeingEdited with @dbcolumn is working if user in read mode, but if they are in Edit mode(most case they will reply that email), that window will still popup.

Customizing the deliver option with my purpose maybe a good idea which I have never think of it. that will speed up the email and easy maintaining. it also saves many fields on Memo form. But the only difference is that my clients have use current ui for 4 years, and the fields on memo are easy for user to change instead of click Devilery Options button. It is hard to convince clients to change current ui interface as they get used of that and just I realize we have potential problem in the future for a big categories in corp lib db.

Now it seems it is not that easy to just use @dbcolumn in category pickup, I will try some tests on Delivery options.

Please let me know if you have any other options,

Thank you so much!

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Hi Andre,Some thoughts come to my mind this Sunday, to avoild the limitation of @dbcolumn on Dialoglist field, I think that I may change the dialoglist to just a plain text field and create a button beside it to simulate the similar function as dialoglist using lotusscript behind the button, when user click the button , the pickliststring or picklistcollection will bring that category view for selecting, after user click one or more document(categories selection), the selected categories will be loaded on the category field(text field). But the only different is that the dialoglist has Enter entry not in list option on the buttom, and the button with picklist does not have that option. To simulate the exactly dialoglist function with that option, I may think using embedded view on subform with a text field under that embedded view(category view for selction), it may not that easy.

Any thughts for this option?

Thanks a lot,

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

I think your button idea is fine, and users will understand how to use it without any problem.

I don’t think the lack of Enter to open the choices dialog is a real problem. You might use a Native style field and disable multiple-line entry, so that if the user does press Enter nothing happens (as opposed to putting a newline in the data)

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Hi Andre,Thanks a lot for your help again,

I tried the pickliststring way, it seems that I still have problem.

The categories view used in the pickliststring has problem. I created a first categories column used for pickup. For some documents, we have categories with many subcategories like: test1\test2\test3… after I categorize the first column, they separate to different level, it is hard to pickup, One way to solve this is to add formula on first column to convert the "" to “/”, it is OK for them to show on first column, then when I click OK, then my code after the pickliststring convert the “/” to "" again. but this will confuse users, users may think they should use “/” to enter subcatogries.

I may think if there are any ways to use Delivery Option window, but this way will change a lot of original codes.

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Someone might tell me there’s some reason not to do this, but first, it seems you could use a view that’s set to display “unique values in index” for ODBC, rather than categorized. Then the values could contain backslashes.

The other thing to consider is that there’s a reason for multiple levels of categorization: it’s because people work better with short lists. Rather than having to browse a list of thousands of entries, users could “drill down” to the entry they want. To support this you could either use a picklist view that shows the subcategories under the categories, or you could create a dialog form with multiple fields – one for the top-level category, another for the second-level category, and so on down. You would have to manage the values in the second and subsequent categories so that when a top-level category changes, you erase the values from the lower-level categories if they’re no longer valid.

This is nice because you’re only returning short lists of data at a time, rather than every conceivable category, so it should be faster.

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Hi Andre,Thanks a lot for your response again,

Your previous post mentioned add some code on queryopen even gave me some hints, probably I will try that way:

This is what I have done now:

RP:=@Environment(“CorpRepId”);

ID1:=@Left(RP;8);

ID2:=@Right(RP;8);

RID:=ID1+“:”+ID2;

AS:=@Environment(“CorpLibAccess”);

@If(AS!=“0”;@Unique(@DbColumn( class : cache ; RID ; “(LookupCategory)” ; 1 ));

“”)

I add codes on Queryopen of Memo form, for old email, as the replicaID was saved on that email, so I add those codes over there, that means if user can not open that db(openbyreplicaid), then set the envrionment var, so after the Memo form opened. my @DbColumn will execuate that codes according to that environment var.

But I was thinking I can customize the my own message after

corpdb.OpenByReplicaID( source.document.DocLibServer(0), source.document.DocLibReplicaID(0)) = False

But unfortunately, my messagebox has never been executed. it execuates that line code directly before return “false”, I got notes generated message as: “User… can not open database…”,

If corpdb.OpenByReplicaID( source.document.DocLibServer(0), source.document.DocLibReplicaID(0)) = False Then

	'If Not corpdb.IsOpen Then

		Messagebox "you do not access to this corp db"

		Call session.SetEnvironmentVar( "CorpLibAccess", "0" )

,


Can I customize this message according to “False” in lotusscropt codes above? If this is working, then I would go this way.

Thanks again.

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

It sounds like maybe the On Error statement would be helpful.

Subject: RE: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

Hi Andre,Thanks, yes, I think I have to use error handler to deal with this. The design help is a little bit misleading. the message generated by notes very fast before return “false”.

Thanks a lot for the entire thread help.

Subject: Can we add @Toolsrunmaro(“Agent”) or @Command([runagnt];“agent1”) in a dialoglist?

the answer to your question is NO.

More importantly, why would your user not have access to the lookup database? If you are intending for a user to not access the lookup database then you should not even let the user get far enough where it causes a problem, otherwise it’s poor design and bad practice.