Fun_Sis_GetConst.md 1.47 KB

Fun_Sis_GetConst (function)

获取常量存储过程

  • Type: FUNCTION
  • Returns: longtext
  • Deterministic: NO
  • SQL data access: CONTAINS SQL

Parameters

# Mode Name Type
1 IN sStr varchar(100)
2 IN sGuid varchar(100)
3 IN sBrId varchar(100)
4 IN sSuId varchar(100)

Body

Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTIONFunSis_GetConst'._

Narrative

Business context: Canonical i18n / form-constant resolver. Given a constant key (sStr) and an optional category GUID (sGuid), returns the localized label for the current tenant's CbxLanguage setting (sChinese / sEnglish / sBig5). Every business proc that needs to embed a translatable string (button labels, validation messages, header captions) reads through this.

What it does: Looks up SysSystemSettings.CbxLanguage scoped to sBrId+sSuId, then selects the matching column (sChinese/sEnglish/sBig5) from gdsformconst filtered by sParentId=sGuid and sName=sStr; falls back to the raw key when no row matches.

Invocation: Heavily used — 220 routine callers including the entire Sp_Check_s* bill-validation family (sOdt, sPmd, sPpr, sOpc, sOpn, …), the Sp_BtnEvent* button-action chain, Sp_Calc_s* calculation procs, and Sp_System_ReplaceField*. Form-master / module-hook entries embed this in dropdown captions and warning messages.