Solved

Field conversion to an ID

Posted on 2002-06-26
14
173 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
ID: 7111555
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
ID: 7111599
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
ID: 7112282
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 9

Expert Comment

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

:-(
0
 
LVL 4

Author Comment

by:pratigan
ID: 7113233
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
ID: 7114592

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
ID: 7114870
::)
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
 
LVL 10

Accepted Solution

by:
zvonko earned 100 total points
ID: 7115021
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
ID: 7115024

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
ID: 7115033
... 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
ID: 7116070
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
ID: 7116850
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
ID: 7121475
As Always Zvonko... You assistance is much appreciated !!!
Thakns Again !!
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7121528
You are welcome :)

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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