Title : AU_ACTION
Toolbars
call BrowseEditDelete()
call BrowseEditDelete()
call BrowseEditDelete()
call CloseForm(True)
call CloseForm(False)
Buttons
Fields
(AU_ACT_EMPL.EWATCH)
(AU_ACT_EMPL.EASSIGNEE)
(AU_POS.POS_D)
(AU_USER.UNAME)
(AU_ACTION.DONOTANALYSE)
(AU_ACTION.APRIORITY)
Subject (AU_ACTION.ATITLE)
Business (AU_BUSINESS.TITLE)
Parent (AU_ACTION.ATITLE)
Start (AU_ACTION.ASTARTDATE)
End (AU_ACTION.ADUEDATE)
(AU_ACTION.ANOTES)
(AU_ACT_FIELD.FOPTION)
(AU_ACT_FIELD.FCAPTION)
(AU_ACT_FIELD_TYPE.AU_ACT_FIELD_TYPE_D)
(AU_ACTION.ATITLE)
(AU_ACT_DEPEND.DEPTYPE)
AutoScript
lib
proc Form_Start()
f = TopForm()
fprev = PreviousForm(f)
task = FormTaskStr(f)
call CbLoad ("ASTATUS","","","")
call CbLoad ("ASEVERITY","","")
call CbLoad ("DEPTYPE","FS Finish-to-start","SS Start-to-start","FF Finish-to-finish","SF Start-to-finish")
end
'========================== Form_BeforeClose ==============================
fun Form_BeforeClose()
result = 1
if (task = "ptEdit") then '...............................................Edit
'.........................................check the AU_ACT_FIELD
p = PByName(f,"AU_ACT_FIELD")
t = TByName(p,"AU_ACT_FIELD")
rcount = TRecordCount(t)
call TFirst(t)
for i = 1 to rcount
a = TGetFld(t,"FTYPE")
b = TGetFld(t,"FCAPTION")
if (a <> "") and (b = "") then
call message(" , (",i,")")
result = 0
return
endif
if (a = "") and (b <> "") then
call message(" , (",i,")")
result = 0
return
endif
call TNext(t)
next
endif
'....................................adjust action's dependencies
p0 = PByName(f,"AU_ACTION")
t0 = TByName(p0,"AU_ACTION")
p = PByName(f,"AU_ACT_DEPEND")
t = TByName(p,"AU_ACT_DEPEND")
rcount = TRecordCount(t)
call TFirst(t)
for i = 1 to rcount
dep_type = TGetFld(t,"DEPTYPE")
dep_action = TGetFld(t,"DEP_ACTION")
dep_type = Copy(dep_type,1,2)
if (dep_type = "FS") then '........................................Finish-to-Start
date2 = LookUp("AU_ACTION","AU_ACTION",dep_action,"ADUEDATE","")
date2 = DateToNum(date2)
date2 = date2 + 1
date2 = NumToDate(date2)
call TEdit(t0)
call TSetFld(t0,"ASTARTDATE",date2)
call TPost(t0)
endif
if (dep_type = "SS") then '........................................Start-to-Start
date1 = LookUp("AU_ACTION","AU_ACTION",dep_action,"ASTARTDATE","")
call TEdit(t0)
call TSetFld(t0,"ASTARTDATE",date1)
call TPost(t0)
endif
if (dep_type = "FF") then '........................................Finish-to-Finish
date2 = LookUp("AU_ACTION","AU_ACTION",dep_action,"ADUEDATE","")
call TEdit(t0)
call TSetFld(t0,"ADUEDATE",date2)
call TPost(t0)
endif
if (dep_type = "SF") then '........................................Start-to-Finish
date1 = LookUp("AU_ACTION","AU_ACTION",dep_action,"ASTARTDATE","")
date1 = DateToNum(date1)
date1 = date1 - 1
date1 = NumToDate(date1)
call TEdit(t0)
call TSetFld(t0,"ADUEDATE",date1)
call TPost(t0)
endif
call TNext(t)
next
call ReLoadEditFields(f)
end