OI and QuickDex (OpenInsight Specific)
At 29 DEC 1997 01:10:26AM Jane Doogue wrote:
I have tables which are accessed by both ARev3 and IO.
However, I cannot add new fields under OI - The Add Data
Column option is suppressed.
Under ARev I sometimes get the message:
You cannot write or delete rows because the Quick/Rightdex for this table does not use 'CM_ISO' language set specified in the current environment.Either:Reload the 'Default' language setOr:Re-install the Quick/RightdexI have done both but still get the message. Only when there is no Quickdex is it possible to add new fields, but then only in ARev.
Any ideas?
How is Quickdex aded in OI?
Is there a simple technique to make a window read-only if the record read requires to be protected? rather than flag all the fields.
For screens with more than 115 entities, is then any documentation on how the data may be spread over 2 or more screens with simple linking between the 2?
At 29 DEC 1997 01:29PM Cameron Revelation wrote:
Hi Jane,
I don't know the answer to your first question off-hand, but I noticed you had two other questions in your post, so I'll take a shot at them.
Is there a simple technique to make a window read-only if the record read requires to be protected? rather than flag all the fields.
If the record cannot be locked, a message pops up saying so (see the message OIWIN_LOCKERR in the Message Designer in the UI Workspace). This corresponds to the MsgCode of SYSMSG_LOCKERR$ which is passed to the SYSMSG event of the form. It happens pretty much like this:
1. LOSTFOCUS event (SYSPROG*LOSTFOCUS..OIWIN*) gets the current value of the control and compares it to the starting value of the control to see if a change occurred
2. The LOSTFOCUS event does the required field check. If the value changed, the LOSTFOCUS event also does the validation check and the input/output conversion processing.
3. The LOSTFOCUS event checks if the control is a key control. If it is, and all of the related key controls have values (if it is a multi-part key) then the LOSTFOCUS event sends a READ event to the form.
4. The READ event (SYSPROG*READ..OIWIN*) assembles the key, opens the data table, and tries to lock the record (based on the IOOPTIONS property setting).
5. If the LOCK fails, the READ event sends the SYSMSG event with the MsgCode parameter set to SYSMSG_LOCKERR$.
6. The SYSMSG event (SYSPROG*SYSMSG..OIWIN*) displays the OIWIN_LOCKERR message which corresponds to SYSMSG_LOCKERR$.
You can override the SYSMSG event to suppress the message. You can also override the READ event and check for a lock failure on return of Forward_Event:
<code> declare function Get_EventStatus declare subroutine Forward_Event, Set_EventStatus $insert Logical Forward_Event() if Get_EventStatus() then * e.g. lock failed, user pressed cancel (to not view the record in read-only) Set_EventStatus(FALSE$) end return 0</code>
Likewise on SYSMSG you could:
<code> $insert PS_Equates $insert Logical if MsgCode=SYSMSG_LOCKERR$ then * custom lock error handling goes here * e.g. StatCode of TRUE$ tells READ event to view record in read-only mode StatCode=TRUE$ return 0 end return 1</code>
Lastly, here is a snippet of code from the OpenInsight Message Designer that disables all controls. (The extra handling is for the tab controls, to keep them enabled.)
<code> ************************************************ * grey controls because the message isn't locked ************************************************ LockWindow: if Get_Property(Child, "@DISABLED") else CtrlMap=Get_Property(Child, "CTRLMAP") * remove tabs from list loop Pos =index(CtrlMap: @fm, TAB_SUFFIX$: @fm, 1) while Pos Pos =count(CtrlMap 1,Pos, @fm) + 1 CtrlMap=delete(CtrlMap, Pos, 0, 0) repeat List=CtrlMap convert @fm to @rm in List Enabled=Get_Property(List, "ENABLED") convert @rm to @fm in Enabled Ctrls=Child : @rm: Child : @rm: Child : @rm: List Props=@DISABLED": @rm: "@CTRLMAP": @rm: "@PREVENABLED": @rm: "ENABLED" Vals =TRUE$ : @rm: CtrlMap : @rm: Enabled : @rm: FALSE$ Set_Property(Ctrls, Props, Vals) end return ****************************************** * restore controls to a more healthy palor ****************************************** UnlockWindow: if Get_Property(Child, "@DISABLED") then Ctrls=Child : @rm: Child Props=@CTRLMAP": @rm: "@PREVENABLED" Vals =Get_Property(Ctrls, Props) List =field(Vals, @rm, 1) Enabled=field(Vals, @rm, 2) convert @fm to @rm in List convert @fm to @rm in Enabled Ctrls=Child : @rm: Child : @rm: List Props=@DISABLED": @rm: "@PREVENABLED": @rm: "ENABLED" Vals =FALSE$ : @rm: "" : @rm: Enabled Set_Property(Ctrls, Props, Vals) * drawing glitch - tabs not refreshed after re-enabling the window Ctrls=" Props=" Vals =" for i=1 to 3 Ctrls := @rm: Child: ".": TAB_PREFIX$: i: TAB_SUFFIX$ Props := @rm: "REDRAW" Vals := @rm: TRUE$ next i Set_Property(Ctrls 2,9999, Props 2,9999, Vals 2,9999) end return</code>
I hope this gives you an idea of what you can do. If you need more details (or if I missed it completely) let me know.
For screens with more than 115 entities, is then any documentation on how the data may be spread over 2 or more screens with simple linking between the 2?
I found some similar (hopefully helpful) topics in the discussion:
Multiple Forms vs Multiple Pages
Reading single record in multiple windows
Cameron Purdy
Revelation Software