NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: joep on May 23, 2014, 01:58:14 AM
-
Hi All
I have generated an webapplication with several browses and forms.
In the database (sql server) I have several key's with an identity.
But I haven't got auto increments on those key's in the dictionary.
Unfortunally, implementing these increments in the dct, generates no extra code by the templates.
I tried to implement the code by myself but it doesn't work. (form is not primed)
code I used at the preinsert and precopy:
! Start of "Pre Insert After Primes"
! [Priority 5000]
p_web.PrimeFile(Smp_Algemeen,true,0)
Ans = Net:ChangeRecord
p_web.SetSessionValue('UpdateSmp_Algemeen:Primed',1)
! End of "Pre Insert After Primes"
What am I doing wrong?
Regards,
Joep
-
Hi Joep,
I'm not sure I understand the problem. You've documented a solution (which doesn't work) but I'm not understanding the exact problem you are trying to solve. Can you elaborate a bit?
cheers
Bruce
-
Hi Bruce,
The problem is that I cannot insert a child record upon the insert of the parent.
I get an error that the parent has no id yet.
I suppose that problem is due to the fact that we generated the forms with no auto increment in de DCT.
Now I have set several auto increments in the dictionary.
But the code is not changed by these settings in the dictionary.
And the parent is still not primed, so I keep getting an error that there is no id.
I thought I could paste the nescessary priming code by hand, so the form would get primed.
Regards,
Joep
-
Hi Bruce,
Actually it's a bit different now.
The record is primed now and I can see the parent id in the form,
but the child is still complaining that there is no parent id.
All I have done is setting the auto increment in the dct on a few key's.
Regards,
Joep
-
Hi Bruce,
I changed the foreign key's on the sql server database and now it works.
Regards,
Joep
-
Hi Joep,
there are some auto-increment options on the last tab of the form template that may have helped you without adding the auto-increment to the dict.