yogesh kapil
5th September 2013, 06:39
Hi All,
i am developing one maintain session. everything is fine. But i wanted when recored been saved, no one able to edit that recored. the field should be disabled.
for your reference, please find the screenshoot.
bhushanchanda
5th September 2013, 08:38
Hi Yogesh,
You can use disable.fields() and enable.fields() functions to do this.
declaration:
extern domain tcpono flag | Variable
Now,
before.program:
flag = 0 | Initialize the flag value before session starts
before.display.object:
if flag = 0 then
disable.fields("field_name") | This will disable the field when the form is displayed
endif
choice.add.set:
before.choice:
enable.fields("field_name") | This will enable the field when New button is clicked
flag = 1 | This will set the flag which will keep the fields enable until save button is clicked
after.choice:
flag = 0 | This will change flag value when save is clicked and will disable it again.
Obviously, there are many ways to do this, you can do it with DAL as well.
yogesh kapil
5th September 2013, 10:48
Hi bhushanchanda,
thanks for your reply..this is working fine...but i notice somthing when i click on new button old recode field again active which is not right.
when click on new only new line field enable.
hope u understnd.
bhushanchanda
5th September 2013, 11:03
Hi,
You won't be able to edit those fields. But, if you don't want to see them open,
try this:-
enable.fields("field_name",actual.occ)
yogesh kapil
5th September 2013, 11:10
okay..
one more thing if i want delete button will be disable on the select event.
what should i do ..
for your refernce attching the screen shot.
bhushanchanda
5th September 2013, 12:12
Hi,
Select your Session, Go to Specific - > Standard Commands.
Uncheck the tick boxes Delete Record & Delete Range.
v_kewl
5th September 2013, 14:01
you can also use "standard.commands.off" in your script, if you want to disable it on conditional basis.
you can also check using: "disable.commands()", "disable.group()" functions.
--
Gaurav
NPRao
10th September 2013, 22:57
You can use the enable/disable.fields() commands in the group sections.
Here is the sample code -
|******************************************************************************
before.display.object:
|* enable.disable.migration.sessions()
if synchronized.reason > 0 then
curr.stat = zmmig200.stat
check.approval.options()
gather.user.authorizations(zmmig200.pkg)
display.mig.fields()
enable.disable.approval.fields()
update.flags.based.on.status()
|* enable.disable.migration.types()
enable.disable.based.on.status()
endif
|******************************************************************************
before.new.object:
zmmig200.reqid = 0
zmmig200.reby = logname$
if not tt.user(zmmig200.reby, form.reby.name) then
form.reby.name = ""
endif
| zmmig200.redt = utc.num() |# Rev86.KAIZEN.12282007.vxjaykum.o
| zmmig200.enby = logname$ |# Rev86.KAIZEN.12282007.vxjaykum.o
| zmmig200.lang(1, 1) = "2" |# Rev86.KAIZEN.12282007.vxjaykum.o
get.src.details()
zmmig200.stat = zmmig.stat.new