project QadFinancials > class TSetStatutoryCurrency > method SetStatutoryCurrencyDomain

Description

Set the statutory currency flag and statutory currency code in domainproperty.


Parameters


icDomainCodeinputcharacter
icNewSCCodeinputcharacterNew Statutory Currency Code
ilDomainIsStatutoryCurrencyinputlogical
ocErrorMessageoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method TSetStatutoryCurrency.SetStatutoryCurrency


program code (program1/tsetstatutorycurrency.p)

assign oiReturnStatus      = -98
       viLocalReturnStatus = 0.

DOMAINBLOCK:
do:
    /* Get DomainProperty */
    find Domains where
         Domains.DomainCode = icDomainCode
         no-lock no-error.
    if not available Domains
    then do:
        assign viLocalReturnStatus = -900
               ocErrorMessage      = substitute("Unable to get the Domain with code &1", icDomainCode).
        leave DOMAINBLOCK.
    end. /* if not available Domains */    

    find DomainProperty where 
         DomainProperty.Domain_ID = Domains.Domain_ID
         exclusive-lock no-error.
    if not available DomainProperty
    then do :
        assign viLocalReturnStatus = -901
               ocErrorMessage      = substitute("Unable to get the DomainProperty for code &1", icDomainCode).
        leave DOMAINBLOCK.
    end. /* if not available DomainProperty */

    /* set Statutory Currency flag and field */
    assign DomainProperty.StatutoryCurrency_ID      = viNewSCID
           DomainProperty.DomainPropertyIsStatutory = ilDomainIsStatutoryCurrency.

end. /* DOMAINBLOCK */

assign oiReturnStatus = viLocalReturnStatus.