Solved

Field conversion to an ID

Posted on 2002-06-26
14
171 Views
Last Modified: 2013-12-18
I had previously had a question that zvonko assisted with.  Converting an inputted value processid like A-P-010 and the formula behind this field did a hidden view lookup xref to match this processid to a number like 384.  Then the number 384 was associated to a preview button that would take you to the server and bring up a word document that had the name 384.doc and contained the prodcess details for that entered processid.  The formula behind the field is :
@DbLookup("";@DbName;"ConfigDocs";"xref";"ConfigValue")
Then a preview button that takes this configvalue like:
A-P-010 | 373
and goes to the server and references 373.doc.  he problem I have encountered is that the processid field stored on the database is the number 373 not the actual process id.  Therefore, when the processid and matching reference number changes, I have no way of rereferencing the processid to a new number because the processid no longer displays in the field and the number is different.
Any ideas !!!????
:)
0
Comment
Question by:pratigan
  • 7
  • 6
14 Comments
 
LVL 4

Author Comment

by:pratigan
Comment Utility
I have actually determined a way to get the results I'm looking for which has identified the actual problem.  I will be cancelling this question and recreating a new one !!!
Thank You!!
0
 
LVL 4

Author Comment

by:pratigan
Comment Utility
If I can have the processid stored to the database as is and then when the prview button, lotus script, is pushed have the script logic take the processid field value, match it to the number using the dblookup view then go to the server and select the numeric document. ??  Here is the current script logic as the number stored behind the processid field.  Is this possible ???
Sub Click(Source As Button)
     Dim workspace As New NotesUIWorkspace
     Dim uidoc As NotesUIDocument
     Dim doc As NotesDocument
     Dim rc As Integer
     Dim X As Variant
     
     Set uidoc = workspace.CurrentDocument
     Set doc = uidoc.Document
     X = doc.proid1(0)
     rc = Shell ("cmd /C  ""\\serverpath\" & X & ".doc"" ")
End Sub
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
Hello Paul,

it is possible but it is really very tricky.
It works only on R5.0.2 and above and uses:
NotesAgent.RunOnServer(ParameterDocID)

That mean the scenario is this:
1.) Your button has to create a document containing this X or prod1 Word document selector value. The simplest way is that your button do save the calling document.
2.) Your button extracts the DocID of this actual Notes document.
3.) Button calls the agent who contain your shell() function and passes the DocID in the Agent parameter list.
4.) Agent do run and attaches the extracted Word document to the same Notes document which button already used to pass the Word document selector.
5.) After agent is finishing does the button again get control. But now is the document used by button no more actual.
6.) Button has to close the actual in storage document and reopen it (best by using the DocID).
7.) After reopen is the attached document available to client side.

Does this sound good to you? If YES, and you like to save your time I used to get this running around all pitfalls then please increase the points to 300 and you will get the code with the appropriate adaptation to your needs.
Is this acceptable to you?

0
 
LVL 9

Expert Comment

by:Arunkumar
Comment Utility
Dont do that prat !!!  He will reach 100k before me then...

:-(
0
 
LVL 4

Author Comment

by:pratigan
Comment Utility
Hell ozvonko,
I definitely have no problem raising the points for this one.  This senario sound pretty complicated.  Can't I just add a DBlookup function in the lotus logic above that will take the processid field and match it to the numeric in the view ???
Previously, I had the actual processid field set as dialog box and the dialog formula was the dblookup function stated above.  This would take the entered processid and match it to the numeric for the preview.  I would think I could just move this process over to the preview button and thereby store the processid and have the button perform the dblookup match ??!?!?!
:)
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility

Sorry, I now remember: all your clients can access this WinNT share drive, right?

Than you need no RunOnServer call and no points increase :)

So if I finally understand your question you ask: how to make a @DbLookup in LotusScript?

There are two methods:
1.) Evaluating the @DbLookup("";@DbName;"ConfigDocs";"xref";"ConfigValue")

2.) Lookup with LotusScript commands the ConfigValue for the xref.

By the way; this @DBlookup with hardcoded "xref" does not work.

Oh man, this is all to confusing for me :(

Can you please explain again for me how I could help you?

0
 
LVL 4

Author Comment

by:pratigan
Comment Utility
::)
Hello Zvonko,
You had previously assisted with the converting of an entered processid such as A-P-010 to a numeric such as 384.  Then there is a preview button next to the processid field that will allow someone to link to the 384.doc id info on the server directly from the form.  This was done by using an xref & config value form where I entered the Xref and config values that contained all of the conversion processids to a numeric.  The problem here is that the processid field carries the numeric converted value on the database in the processid field because the xref configvalue lookup is on the processid field.  What I want to do is to carry the actual processid on the database field as is and have the cross reference buttom performthe conversion match to the numeric and then link to that document on the server.  Because the button logic is lotus script, I am looking to include the DBlookup against the config value in the lotus script.  This will convert the database field with the a-p-010 processid to the numeric and then fetch the numeric document, 384.doc, form the server, instead of the dblookup being part of the actual proaccid field drop down list formula.  Does this clarify the situation ???
Thanks !!
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 10

Accepted Solution

by:
zvonko earned 100 total points
Comment Utility
OK,

first part is this:
Sub Click(Source As Button)
  Dim workspace As New NotesUIWorkspace
  Dim uidoc As NotesUIDocument
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim view As NotesView
  Dim doc As NotesDocument
  Dim xdoc As NotesDocument
  Dim ConfigValue As String
  Dim processid As String
  Dim docid As String
  Dim rc As Integer
  Set db = session.CurrentDatabase
  Set view = db.GetView("ConfigDocs")
  Set xdoc = view.GetDocumentByKey("xref")
  Set uidoc = workspace.CurrentDocument
  Set doc = uidoc.Document
  processid = doc.proid1(0)
  ConfigValue = xdoc.GetFirstItem("ConfigValue").Text
  docid = Trim$(Strleft(Strright(Strright(ConfigValue,processid),"|"),";"))
  rc = Shell ("cmd /C  ""\\serverpath\" & docid & """ ")
End Sub

... but still much work to do. So please increase the points to make other experts look into this :)

So long,
zvonko

0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility

Oh, and for my buddies: we are talking about this previous solution:
http://www.experts-exchange.com/jsp/qShow.jsp?ta=lotusnotes&qid=20280319

0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
... and for you Paul:
To make your "proid1" field be a DialogList of only left part of xref keys use this DialogList formula:
@Left(@DbLookup("";@DbName;"ConfigDocs";"xref";"ConfigValue");"|")

0
 
LVL 4

Author Comment

by:pratigan
Comment Utility
Hello Zvonko,
This is working for both the processid field now carrying the actual processid and the preview button linking ot the associated numeric document on the server.  I had to modify the link rc statement slightly, but it is now working.
Not sure what you meant when you said much work still to do.  I will raise the points if your feel that some additional features should be added.
Let me know ??
Thank You !!
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
No needs, if it is working then it is working.

My comment concerned only the fact that all user access a common \\Servapath share. But when is working for you then everyone is happy.

Additionally I assumed that after running this shell command there is a lot of work attaching this extracted document into actual document. But this also seems to work for you.

So no points increase necessary :)

0
 
LVL 4

Author Comment

by:pratigan
Comment Utility
As Always Zvonko... You assistance is much appreciated !!!
Thakns Again !!
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
You are welcome :)

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

10 Experts available now in Live!

Get 1:1 Help Now