Omnis 7 Classic - Redefine List Update
Martin Obongita
martin.obongita at yahoo.com
Wed Dec 14 18:37:58 UTC 2022
Set main file {F_F004E}
Calculate VF4E_E1RSNNO as E1_RSNNO
Set current list #L8
Define list {VF4E_E1RSNNO,VF4E_RSNNO1..VF4E_RSNNO9,VF4E_RSNNO10..VF4E_RSNNO30,VF4E_CODE1..VF4E_CODE10,VF4E_CODE11..VF4E_CODE15,VF4E_CODE16..VF4E_CODE20,VF4E_CODE21..VF4E_CODE30,VF4E_RATE1..VF4E_RATE10,VF4E_RATE11..VF4E_RATE15,VF4E_RATE16..VF4E_RATE30,VF4E_PRDNO..VF4E_PRDMTH} ;; VF4E_PRDMTH
Add line to list
Redefine list {F4E_E1RSNNO,F4E_RSNNO1..F4E_RSNNO9,F4E_RSNNO10..F4E_RSNNO30,F4E_CODE1..F4E_CODE10,F4E_CODE11..F4E_CODE15,F4E_CODE16..F4E_CODE20,F4E_CODE21..F4E_CODE30,F4E_RATE1..F4E_RATE10,F4E_RATE11..F4E_RATE15,F4E_RATE16..F4E_RATE30,F4E_PRDNO..F4E_PRDMTH} ;; F4E_PRDMTH
; For each line in list from 1 to #LN step 1
Set read/write files {F_F004E}
Set search as calculation {F4E_PRDNO=PRD_NO}
Find on F4E_E1RSNNO (Exact match,Use search) {E1_RSNNO}
If flag true
For L1 from 1 to 30 step 1
Calculate LVCOLLEN as len([con('F4E_CODE',L1)])
Calculate LVTOTCOLLEN as LVTOTCOLLEN+LVCOLLEN
End For
If LVTOTCOLLEN=0
Clear range of fields F4E_CODE1 to F4E_RSNNO30
End If
Prepare for edit
Load from list
Else
Prepare for insert
Load from list {1}
End If
Update files (Do not cancel pfu)
If flag false
OK message (High position) {Unable to update record}
End If
End For
Set read-only files {F_F004E}
I hope this is readable....
On Wednesday, December 14, 2022 at 09:33:30 PM GMT+3, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
Hi List
I have an inherited Omnis Classic Library.
I am trying to update file values (table values) from variable values in a file(table) in an entry window..
These are the lines of commands I am running:
Set main file {F_F004E}Calculate VF4E_E1RSNNO as E1_RSNNOSet current list #L8Define list {VF4E_E1RSNNO,VF4E_RSNNO1..VF4E_RSNNO9,VF4E_RSNNO10..VF4E_RSNNO30,VF4E_CODE1..VF4E_CODE10,VF4E_CODE11..VF4E_CODE15,VF4E_CODE16..VF4E_CODE20,VF4E_CODE21..VF4E_CODE30,VF4E_RATE1..VF4E_RATE10,VF4E_RATE11..VF4E_RATE15,VF4E_RATE16..VF4E_RATE30,VF4E_PRDNO..VF4E_PRDMTH} ;; VF4E_PRDMTHAdd line to listRedefine list {F4E_E1RSNNO,F4E_RSNNO1..F4E_RSNNO9,F4E_RSNNO10..F4E_RSNNO30,F4E_CODE1..F4E_CODE10,F4E_CODE11..F4E_CODE15,F4E_CODE16..F4E_CODE20,F4E_CODE21..F4E_CODE30,F4E_RATE1..F4E_RATE10,F4E_RATE11..F4E_RATE15,F4E_RATE16..F4E_RATE30,F4E_PRDNO..F4E_PRDMTH} ;; F4E_PRDMTH; For each line in list from 1 to #LN step 1Set read/write files {F_F004E}Set search as calculation {F4E_PRDNO=PRD_NO}Find on F4E_E1RSNNO (Exact match,Use search) {E1_RSNNO}If flag trueFor L1 from 1 to 30 step 1Calculate LVCOLLEN as len([con('F4E_CODE',L1)])Calculate LVTOTCOLLEN as LVTOTCOLLEN+LVCOLLENEnd ForIf LVTOTCOLLEN=0Clear range of fields F4E_CODE1 to F4E_RSNNO30End IfPrepare for editLoad from listElsePrepare for insertLoad from list {1}End IfUpdate files (Do not cancel pfu)If flag falseOK message (High position) {Unable to update record}End IfEnd ForSet read-only files {F_F004E}
If I step through the code, the file values are defined and populated from the list.
But the values are not updated after the Update files command.
What have I missed in my code?
I am sorry if the lines of code come through in a spaghetti.
Bear with me.
RegardsMartin.
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list