Exemplo:
Entidade
id inc
dataAtual now
data Date
fieldEvents
autoFill
data
return addDate dataAtual 1 @m
Exemplo:
Entidade
id inc
campo1 long
campo2 int
campo3 String
fieldEvents
autoFill
campo3
return concat campo1 campo2
Exemplo:
Entidade
String encrypt = cryptography @SHA-1 senha
Exemplo:
Entidade
String telephone = replaceall "1239101234" "(/d{2})(/d{4})(/d*)" "($1)-$2-$3"
Exemplo:
Entidade
matches "1239101234" "(/d{2})(/d{4})(/d*)"
Note
Da versão 2.7 do Core em diante, deve ser usada a funcionalidade input para requisição de password
Caso o parametro passado seja igual a 0(zero), é gerado um número aleatório com 4 digitos, e o usuário deve repetir este número no input (ex.: confirm password=0). Caso o parametro passado seja maior que 0(zero), é gerado um número aleatório com 4 digitos a partir do número passado, e o usuário deve informar um número de 4 digitos chamado contra-senha (ex.: confirm password=123).
Note
Algoritmo para gerar Contra Senha: Usa-se a senha que foi gerada de forma randômica, e o número passado como parametro no password que é carregado na constante Password. Faz-se a concatenação da soma de cada unidade dos números da senha randômica com cada unídate dos números do Password com a ordem invertida e pega os últimos 4 números. Senha randômica terá sempre 4 números, Password terá no máximo 4 números e pode ser complementada com zeros a esquerda.
Exemplo:
Password=> 1206
Password invertido=> 6021
Senha gerada=> 9999
soma => (6 + 9),(0 + 9),(2 + 9),(1 + 9)
concatenação=> 1591110
contra-senha=> 1110
Exemplo:
Entidade
campo1 long
fieldEvents
onValidate
campo1
return confirm password=0 lang=custom.msgCampo1 vars=var1:campo1
Exemplo:
Boletim sync=out
if inc
apontamento List<Apontamento> transient
crudActions
agendarFechamento
schedule time=8h
Boletim boletim = selectLast from Boletim
finishRecord boletim
Exemplo:
Entidade
data1 now
data2 date
campo1 long
fieldEvents
onValidate
campo1
return difDateMilli data1 data2
Exemplo:
Entidade
data1 now
dataMilli1 long
dataMilli2 long
fieldEvents
autoFill
dataMilli1
return dateToMilli data1
dataMilli2
return dateToMilli data1 @"America/Campo_Grande"
Exemplo:
Entidade
data1 now
longData1 long
date2 Date
date3 Date
fieldEvents
autoFill
longData1
return difDateMilli 0 data1
date2
return milliToDate longData1
dataMilli2
return milliToDate longData1 @"America/Campo_Grande"
Por exemplo: após preencher algum campo da entidade Boletim, o desenvolvedor pode chamar esta instrução para iniciar o processo de finalização do Boletim.
Exemplo:
Boletim sync=out confirm=Finish cleanupDays=20 noSyncAction noFinishAction
id inc
status int
turno Turno
apontServico ApontServico transient notFill add
crudActions
EncerrarTurno
isVisible
return status == %StatusInicioServico
finishRecord
Exemplo:
Apontamento sync=out
id inc
boletim Boletim
operador Operador
servico Servico
events
afterInsert
Boletim registroBoletim = boletim
registroBoletim.status = %StatusIdaCarga
save registroBoletim saveSyncOut
sync type=background //Envia o registro que acabou de ser alterado para o server
Exemplo:
Boletim sync=out openFinish
id inc
tolerancia int
dataAbertura Now
idTurno Turno
apontamento List<Apontamento> transient
dataFechamento Now fill=Finish
events
afterInsert
if tolerancia > 0
setAlertTimer lang=custom.msgTempoPrimeiroApont totalTime=tolerancia
else
stopAlertTimer
Exemplo:
Boletim sync=out cleanupDays=1 notSavedMessage confirm=create|finish
id inc
crudActions
speech
Object fromDatabase = confirm text=@"Carregar frase do banco?"
if fromDatabase == true
Object value= input type=Integer text=@"Id para busca" backAfterOk
Object result = speech value=value entity=@"Phrases" fieldToSearch=@"id" messageField=@"message"
toast result
else
String phrase = input type=String text=@"Digite a frase" backAfterOk
speech phrase
toast phrase
Exemplo:
Entidade
id inc
valor Str notFill
inicio int
fim int
texto Str
substring Str OnGetDefaultInputValue="valor"
fieldEvents
onValidate
texto
valor = substr inicio fim texto
return true
Exemplo:
Entidade
id inc
valor int notFill
texto Str
length int OnGetDefaultInputValue="valor"
fieldEvents
onValidate
texto
valor = strlen texto
return true
Exemplo:
Entidade
id inc
valor int notFill
texto Str
options
option1
_grupos = SELECT * FROM Grupo
_funcionarios = SELECT * FROM Funcionario
for g in _grupos
log g
log gIdx //recebe o valor do índice de cada iteração
for f in _funcionarios
log f
log g
log gIdx
log fIdx
Exemplo:
roundFloat value 3
Exemplo:
Boletim
temDadosOffline boolean
fieldEvents
autoFill
temDadosOffline
return hasOfflineData
Exemplo:
schedule time=1m
log Executing from schedule
Exemplo:
Boletim
id int
apontamentos List<Apontamento> transient
timeToExecute Date notFill
crudActions
agendar
fill timeToExecute
fieldEvents
afterFill
timeToExecute
schedule time=timeToExecute
Boletim boletim = selectLast Boletim
finishRecord boletim
Exemplo:
Boletim sync=out notSavedMessage
id inc
text String
primeiroNivel List<PrimeiroNivel> transient
dateToExecute Date notFill
timeToExecute String notFill
hourToExecute String notFill
repeatInStr String notFill
repeatInMillis Long notFill
actionToCancel Integer notFill
crudActions
agendarTime
schedule time=20s
toast scheduled time
log scheduledActionTest time
log execute
log scheduled
log id
agendarDate
fill dateToExecute
agendarStr
fill timeToExecute
agendarHour
fill hourToExecute
agendaRepeatInMillis
schedule time=20s repeatIn=3m
toast agendaRepeatInMillis
log scheduledActionTest agendaRepeatInMillis
log execute
log scheduled
log id
log repeatIn
agendarRepeatInValueStr
fill repeatInStr
agendarRepeatInValueMillis
fill repeatInMillis
Exemplo:
Boletim sync=out notSavedMessage
id inc
text String
primeiroNivel List<PrimeiroNivel> transient
dateToExecute Date notFill
timeToExecute String notFill
hourToExecute String notFill
repeatInStr String notFill
repeatInMillis Long notFill
actionToCancel Integer notFill
crudActions
agendarTime
schedule time=20s
toast scheduled time
log scheduledActionTest time
log execute
log scheduled
log id
agendarDate
fill dateToExecute
agendarStr
fill timeToExecute
agendarHour
fill hourToExecute
agendaRepeatInMillis
schedule time=20s repeatIn=3m
toast agendaRepeatInMillis
log scheduledActionTest agendaRepeatInMillis
log execute
log scheduled
log id
log repeatIn
agendarRepeatInValueStr
fill repeatInStr
agendarRepeatInValueMillis
fill repeatInMillis
cancelAll
cancelSchedule
cancelAction
fill actionToCancel
cancelSelectLast
_SCHEDULED_ACTION actionsValue = selectLast from _SCHEDULED_ACTION
cancelSchedule actions=actionsValue
cancelSelectAll
_SCHEDULED_ACTION actionsValue = select * from _SCHEDULED_ACTION
cancelSchedule actions=actionsValue