Páginas filhas
  • AF012CHP - Handling of "Registration Number" field in the Fixed Assets module.

01. GENERAL DATA

  • Product Line: Microsiga Protheus®
  • Segment: Backoffice
  • Module: SIGACTB
  • Function: ATFA012
  • Name of Entry Point: AF012CHP
  • Type: Entry Point (Executable Block)
  • Purpose: To customize the validation and handling of the "Registration Number" field in the module related to fixed assets.

02. DESCRIPTION

Entry Point AF012CHP() allows developers to customize the process of validation and handling of a fixed asset's registration number. It offers flexibility to adapt the logic of checking for registration numbers in the system, whether to avoid duplicities, configure editing permissions or implement specific business rules. If the executable block (ExecBlock) is set, it will be called for changing the system behavior as needed.

03. PARAMETERS 

  • nChapa: Fixed asset registration number.
  • lRepChapa: Enter whether to repeat or replace the registration number (optional).

04. RETURN

  • Main Return:
    • A logical value (.T. Or .f.) indicating the success or failure of validation.

               If you do not set the entry point, the default logic is applied to validate the registration number and prevent duplicate records in the system.

05. EXAMPLE

If ExistBlock("AF012CHP")
    lRet := ExecBlock("AF012CHP", .F., .F., {nChapa, lRepChapa})
    lRet := If(ValType(lRet) == "L", lRet, .F.)
Else
    If !lRepChapa
        If Empty(nChapa)
            If !(cStatus == "0") .or. FwIsInCallStack("ATFA240")
                Help(" ", 1, "AF012ACHAP",, cDescCpo + STR0152, 1, 0,,,,,, {STR0153 + cNomeCpo + "." })
                lRet := .F.
            EndIf
        ElseIf lMile
            If AF12CHPMIL(nChapa)
                Help(" ", 1, "AF012ACHAP",, cDescCpo + STR0154, 1, 0,,,,,, {STR0155 + cNomeCpo + "."})
                lRet := .F.
            EndIf
        Else
            DBSelectArea("SN1")
            DBSetOrder(2)
            If DBSeek(XFilial("SN1") + nChapa) .And. cBase+cItem != SN1->(N1_CBASE+N1_ITEM)
                Help(" ", 1, "AF012ACHAP",, cDescCpo + STR0154, 1, 0,,,,,, {STR0155 + cNomeCpo + "."})
                lRet := .F.
            EndIf
        EndIf
    EndIf
EndIf