I have an application that was written in the R4 days and is filled with layout regions. I’d like to update the look and feel for various reasons, useablility is one of them. My problem is this, I can either re-code an entire CRM database or I can move the fields in the layout regions to tables and pages. When I go to copy/cut any field located in a layout region and paste into a page/form/table the whole layout wants to come with it.
Am I doing some thing wrong or is this just not possible?
Subject: RE: *Can’t do it that way. You need to recreate the fields manually with the same names
Well, not what I was hoping to hear, but what I expected. I don’t suppose someone has created a utility to do this… the database that I am working on has something like 300 fields… most of which lie in layout regions…
Our Midas Rich Text LSX will let you create fields, but I can’t recall whether it can read fields from the layout region. I think they may be a specialized format, but let me check and get back to you.
You could go several steps further in terms of automating this, but I wrote a quck agent which copies the fields into a table with their fieldnames. You could remove the layout region automatically, but I thought you might want to eyeball these and make sure there wasn’t other content you wanted from the layout region. My agent is below (but of course you would need to get an eval license to try it out. See our Midas Rich Text LSX page for that). Again, Midas costs something, but it sounds a lot better than manually doing this:
'(Options)
Option Public
Option Declare
Uselsx “*lsxrtc”
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim rtitem As New GeniiRTItem
Dim rtLayout As GeniiRTChunk
Dim rtTable As GeniiRTChunk
Dim rtField As GeniiRTChunk
Set db = session.CurrentDatabase
Call rtitem.ConnectFormBody("", db.FilePath, "Layout Form")
If rtitem.IsConnected Then
Set rtLayout = rtitem.DefineChunk("LayoutRegion 1")
While rtLayout.Exists
Set rtField = rtLayout.DefineSubChunk("Field 1")
If rtField.Exists Then
Call rtItem.Everything.AppendTable(1,1, "TableWidth='Fit_To_Margins' ")
Set rtTable = rtitem.DefineChunk("Table 1")
rtTable.GetLastTarget
Set rtTable = rtitem.DefineChunk(rtTable.Definition & "; Row 1; Inside Column 1")
While rtField.Exists
Call rtTable.AppendText(rtField.GetTargetProperties("Field", "Fieldname") & ": ", "Plain Black")
Call rtTable.AppendRTChunk(rtField)
Call rtTable.AppendNewLines(0, True)
rtField.GetNextTarget
Wend
End If
rtLayout.GetNextTarget
Wend
rtitem.Save
End If
Whoa… sweet. Yes I’m willing to give this a try. Will this also copy the scripts and forumlas for the fields? I’m not a very good programmer (yet), so some of that scipt goes over my head. I’m on the Midas website now, would I contact you for more info?
It will handle the formulas, and I’m pretty sure it will handle all scripts as well (if you mean entering and exiting scripts). It will also handle all the javascript events or anything else such as that, although I have a feeling that you won’t have those in layout regions. The next step is to request an eval license, and make sure to mention what you are doing, so I can send along a sample db. I’d be happy to answer any questions as well - you can use the contact info on the site or reply to the message with the eval license.