Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to get ID if diffrent notes design element?

Posted on 2003-03-31
10
Medium Priority
?
880 Views
Last Modified: 2013-12-18
Hi,

Is there any way to get notes Id of diffrent design elements (like forms, views, agents etc.) programeticaly (Preferably in Lotus Script)?

Also, can I goto diffrent design elements of a database, one by one in Lotus script?

Thanks in advance.
0
Comment
Question by:ad_kumar
  • 6
  • 3
10 Comments
 
LVL 2

Expert Comment

by:stltt
ID: 8244797
Using built in classes this is only possible for view elements.

Here's an example that updates a view to show design elements instead of documents (cannot remember where I found it, but have seen it several places on internet):

     '--This agent changes the $FormulaClass field of a view to "4" to show Forms and Subforms
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim view As NotesView
     Dim doc As NotesDocument
     
     Set db = session.CurrentDatabase
'--CUSTOMIZE:Change the name of the view below to customize
     Set view= db.GetView("FormView")
'--You now have a handle on the design element of the view.
     
     Set doc = db.GetDocumentByUNID(view.UniversalID)
'--CUSTOMIZE: The code on the line below changes the $FormulaClass field.
'--See chart above for other values.
     Dim value As String
     value = Inputbox$ ("", "", "1548")
     Call doc.ReplaceItemValue("$FormulaClass", value)
     doc.Save True, True

Enjoy !! There is allot of stuff to dig into when you get this view working.

It would be possible to find the universal ID via Document properties on the design elements - but this might bot be what you are looking for.

This will save you some work:
Categorize the first column and insert this formula:
@If(     $Flags="3FY"; "Shared Folders";
          @Left($Flags; 2)="FY"; "Shared Folders";
          $Flags="3PFY"; "Shared Folders";
          $Flags="3FYV"; "Private Folders";
          @Left($Flags;2)="CU"; "Subforms";
          $Flags="Y"; "Views";
          $Flags="PY"; "Views";
          $Flags="G3"; "Navigator";
          $Flags="C"; "Forms";
          $Flags="c"; "Forms";
          @Left($Flags; 2)="CD"; "Forms";
          @Left($Flags; 3)="fl3"; "Shared Agents";
          @Left($Flags; 3)="fL3"; "Shared Agents";
          @Left($Flags; 2)="f3"; "Shared Agents";
          @Left($Flags; 2)="fP"; "Shared Agents";
          @Left($Flags; 2)="Sf"; "Shared Agents";
          $Flags="P"; "Shared Fields";
          @Left($Flags; 3)="m34"; "Outlines";
          $Flags="s34Q"; "Script Library";
          $Flags="Cy34Q"; "Shared Actions";
          $Flags="t34Q"; "Database Script";

          @Left($Flags; 4)="34Ci"; "Image Resources";
          @Left($Flags; 5)="C34WQ"; "Pages";

          @IsAvailable($TABLEFORMAT); "Views";


          "- Unknown -")

Second column can be e.g. $Title
0
 

Author Comment

by:ad_kumar
ID: 8245230
I modified the $Formulaclass field value to 1548, but view is not showing design elements. Do I need to give some view selection formula?
0
 

Author Comment

by:ad_kumar
ID: 8245281
In design mode it started showing list of design elements but in notes client it isn't showing anything in view.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:stltt
ID: 8247720
Pretty shure you need to close the database in both the client and designer, and then reopen it again to se the changes.
0
 

Author Comment

by:ad_kumar
ID: 8251248
I colsed and reopened both notes client and designer.
As earliar it shows design elements in that view, in designer but not in client.
And also not setting those in agent when I say getfirstdocument/getfirstentry.
0
 

Expert Comment

by:GeraldEwert
ID: 8254002
I found an article from the programmer Dan Velasco on http://www.dominopower.com/issues/issue199908/design001.html "Fun with $Formula Class" . On his page
at http://www.dominopower.com/issues/issue199908/design001.html you'll find a database for download. I think this will answer all your questions!
Gerald
0
 
LVL 2

Accepted Solution

by:
stltt earned 750 total points
ID: 8255959
I just testet again with the database I had - you need to press Shift-F9 to force a view index rebuild after setting the $FormulaClass.

I recognize the link Gerald put here. This is where I got all the info from.
0
 

Author Comment

by:ad_kumar
ID: 8259002
Shift_F9 solved the problem of displaying elements in view, thanks a lot.
Also I am able to pick elemets IDs using doc.UniversalID property.
How can I find elements' title also, doc.title doc.name etc. are not working?
0
 

Author Comment

by:ad_kumar
ID: 8259047
Yes I got the titles also using doc.getitemvalue.

Thanks stltt and GeraldEwert.
0
 

Author Comment

by:ad_kumar
ID: 8259052
Thnaks a lot.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

577 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