Link to home
Start Free TrialLog in
Avatar of ad_kumar
ad_kumar

asked on

How to get ID if diffrent notes design element?

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.
Avatar of stltt
stltt

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
Avatar of ad_kumar

ASKER

I modified the $Formulaclass field value to 1548, but view is not showing design elements. Do I need to give some view selection formula?
In design mode it started showing list of design elements but in notes client it isn't showing anything in view.
Pretty shure you need to close the database in both the client and designer, and then reopen it again to se the changes.
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.
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
ASKER CERTIFIED SOLUTION
Avatar of stltt
stltt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?
Yes I got the titles also using doc.getitemvalue.

Thanks stltt and GeraldEwert.
Thnaks a lot.