PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → Hsave está editando e não incluindo
Hsave está editando e não incluindo
Débuté par ANDRE MARTINI / IS2, 15 mar. 2016 21:49 - 7 réponses
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 15 mars 2016 - 21:49
olá pessoal,

tem algo estranho no sistema e não consigo encontrar o problema. tenho um cadastro de contas bancárias com a seguinte estrutura:

codigo_da_conta (unique)
nome_da_conta (unique)
codigo_do_banco (estrangeira - permite duplicar)

quando clico no botão novo, coloco os dados e salvo o sistema salva corretamente o novo registro
exemplo cod: 1, nome: CARTEIRA, banco: DIVERSOS

quando clico no botão novo pelo segunda vez, ao invés de lançar um novo registro código 2, o sistema está alterado o código 1 para código 2

os demais cadastros do sistema funcionam tudo normal, os outros cadastros são simples, não tem chave estrangeira, o que será que fiz de errado?

--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 15 mars 2016 - 21:54
código botão NOVO
// Create a new record
HReset(Contas_bancarias)
IF WinStatus(WIN_Contas_Bancarias_Formulario)=NotFound THEN
OpenChild(WIN_Contas_Bancarias_Formulario,AcaoIncluindo)
ELSE
Restore(WIN_Contas_Bancarias_Formulario)
END
// Refresh the table
TableDisplay(TABLE_Contas_bancarias,taCurrentFirst)


código botão SALVAR
// Read the information entered
IF Contas_bancarias..NewRecord = True THEN
IF EDT_Codigo_da_conta = 0 THEN
EDT_Codigo_da_conta = Contas_Bancarias_Sequencial_Codigo()
END
END
// Read the information entered
ScreenToFile()

// Add / modify the record
HSave(Contas_bancarias)

// Return value of the window
MyWindow..ReturnedValue = True


na primeira vez "Contas_bancarias..NewRecord " é igual a true, a partir da segunda "Contas_bancarias..NewRecord " sempre fica FALSE

--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Membre enregistré
3 659 messages
Popularité : +175 (223 votes)
Posté le 15 mars 2016 - 22:24
Prezado Andre,

Faça uma tabela no analisys

Ao final crie uma janela RAD que crie o Browser e o form

Voce vera que funciona perfeitamente.

RE-LEIA O HELP:

http://www.help.windev.com

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 16 mars 2016 - 11:12
Eu sei que funciona, está funcionando em todas os outros cadastros, meu problema é só neste cadastro!

--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Membre enregistré
3 659 messages
Popularité : +175 (223 votes)
Posté le 16 mars 2016 - 12:23
Prezado Andre,

Me adicione no skype adrianoboller

Vou te ajudar.

:merci:

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 16 mars 2016 - 13:18
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 16 mars 2016 - 15:12
Resolvido. Foi só comentar a linha TableDisplay...
O sistema abria o formulário pelo openchild e executava o tabledisplay posicionando no primeiro registro.

// Create a new record
HReset(Contas_bancarias)
IF WinStatus(WIN_Contas_Bancarias_Formulario)=NotFound THEN
OpenChild(WIN_Contas_Bancarias_Formulario,AcaoIncluindo)
ELSE
Restore(WIN_Contas_Bancarias_Formulario)
END

// Refresh the table
//TableDisplay(TABLE_Contas_bancarias,taCurrentFirst)


no RAD funcionava porque ele abria pelo OPEN que espera um retorno

// Create a new record
HReset(Contas_bancarias)

// Open the form of Contas_bancarias file in creation mode
IF Open(WIN_Form_Contas_bancarias) THEN

// Refresh the table
TableDisplay(TABLE_Contas_bancarias,taCurrentFirst)

END


eu não preciso do TableDisplay no botão NOVO porque para atualizar o table da janela que chama a opção novo eu uso a função abaixo
Focus gain of WIN_Contas_Bancarias
TableDisplay(TABLE_Contas_bancarias,taCurrentSelection)


TA LOUCO! Estas coisas não se governam ainda!

--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Message modifié, 16 mars 2016 - 15:16
Membre enregistré
3 659 messages
Popularité : +175 (223 votes)
Posté le 16 mars 2016 - 19:36
Ótimo

:merci:

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/