project QadFinancials > class BJournal > method ValidateDeactivation
Description
This method is called after the ancestor code in the validatecomponent method.
There will be a warning if the journal is deactivated and a profile exists for this journal or the journal is used in a daybook set.
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program1/bjournal.p)
for each t_sJournal where t_sJournal.tc_status='C':U and t_sJournal.JournalIsActive = false:
find first t_iJournal where t_iJournal.Journal_ID = t_sJournal.Journal_ID no-error.
if(available(t_iJournal) and t_iJournal.JournalIsActive <> t_sJournal.JournalIsActive) then do:
/* Check if any profiles exist for this journal */
<Q-1 run ProfileByJournalId (all) (Read) (NoCache)
(input t_sJournal.Journal_ID, (JournalId)
input viCompanyId, (CompanyId)
output dataset tqProfileByJournalId) in BProfile >
for each tqProfileByJournalId:
assign
vcMessage = #T-3'Profile exists for this journal ($1).':100(65314)T-3#
oiReturnStatus = if(oiReturnStatus = 0) then 1 else oiReturnStatus.
<M-4 run SetMessage
(input vcMessage (icMessage),
input tqProfileByJournalId.tcProfileCode (icArguments),
input 'tJournal.JournalIsActive':U (icFieldName),
input t_sJournal.JournalIsActive (icFieldValue),
input 'W':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input 'QadFin-7001':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BJournal>
end. /* for each tqProfileByJournalId */
/* Check if any daybook sets exist for this journal */
<Q-5 run DaybookExists (all) (Read) (NoCache)
(input t_sJournal.JournalCode, (Journal)
input vcDomainCode, (Domain)
output dataset tqDaybookExists) in BMfgDaybookSet >
for each tqDaybookExists:
assign
vcMessage = #T-7'A daybook set exists for this journal ($1).':255(65316)t-7#
oiReturnStatus = if(oiReturnStatus = 0) then 1 else oiReturnStatus.
<M-8 run SetMessage
(input vcMessage (icMessage),
input tqDaybookExists.tcdybs_code (icArguments),
input 'tJournal.JournalIsActive':U (icFieldName),
input t_sJournal.JournalIsActive (icFieldValue),
input 'W':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input 'QadFin-7002':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BJournal>
end. /* for each tqDaybookExists */
end. /* if(available(t_iJournal)... */
end. /* for each t_sJournal */