no changes in db until transaction made

luciana
Member Posts: 43
Hi to all.
I have a proble with a subform.
When I press F3 in mainform I would subform become new. So I went into subform properties, in SuformLink I put
So, if I have a new Objet pressing F3 Button, I should have a new subform, BUT I cannot open the form because a message error appears to me saying that it isn't possible to me making changes in db until a transaction is made.
If I don't put anything in SubformLink properties, form opens .
How could I solve that?
Thanks
Luciana
I have a proble with a subform.
When I press F3 in mainform I would subform become new. So I went into subform properties, in SuformLink I put
"Line No."=FIELD("Object No.")
So, if I have a new Objet pressing F3 Button, I should have a new subform, BUT I cannot open the form because a message error appears to me saying that it isn't possible to me making changes in db until a transaction is made.
If I don't put anything in SubformLink properties, form opens .
How could I solve that?
Thanks
Luciana
0
Comments
-
Have you seen Sales Order/Invoice and Purchase Order/Invoice? how they are working?0
-
Yep. They put In SubformLink property (Document.No) = FIELD(No.).
I have (Line No.) = FIELD(No.)
where's the difference?
:shock:
Luciana0 -
What are the Primary Keys of header Form and SubForm?0
-
Primary Key in main form is "Object No."
Primary Key in subform is "Line No.", "Item No."
thanks
Luciana0 -
Is Object No. = Line No.?
or Line No. is different?0 -
They are two different subjects
Both Line no and Object No are type CODE.
Line Nro needs to use ascending order in subform.
They are both automatically inserted as No series.
When I have a new Object No, subform has to be reset (but not deleted)
EDIT: I know, it's not NAV way, but it's an example of exercize to me in calling table, make form, subform, see how no. series work, etc etc.0 -
In Sales And Purchase Subforms (Document.No) = FIELD(No.).
both fields refer same data..
I feel the design of your tables is wrong..
IF you ahve no data in tables add Object No to Subform table and link both of them.
EDIT : Object no in subform should be part of primary key as in sales and Purchase Docuament No.0 -
mohana_cse06 wrote:In Sales And Purchase Subforms (Document.No) = FIELD(No.).
both fields refer same data..
I feel the design of your tables is wrong..
IF you ahve no data in tables add Object No to Subform table and link both of them.
EDIT : Object no in subform should be part of primary key as in sales and Purchase Docuament No.
In Subform Table I have Object No and Line No yet.. and both are pare of primary key...
There's another way to emulate the SubformLink property?
Thanks0 -
If you have Object No in Subform table also use
(Object No.) = FIELD(Object No.).0 -
mohana_cse06 wrote:If you have Object No in Subform table also use
(Object No.) = FIELD(Object No.).
I've done this yet but when I insert a new record in subform, it delete record inserted before...
And I set subform property MultipleNewLines to Yes0 -
IS DelayedInsert YES?
IS AutoSplitKey YES?
Line No. should be at last in the Primary key of subform table.0 -
Delayed insert is set to yes.
Autosplit key needs that Line No to be an integer/decimal, it's a code.. If I don't put Line No as a code, I cannot use properties of subfotm anyway because Object No and Line No are supposed to be the same data type..
Line No is a primary key and it's as last of primary keys0 -
Line No should be Integer
why should it be same as Object No when you have Object No. field in Subform table?0 -
mohana_cse06 wrote:Line No should be Integer
why should it be same as Object No when you have Object No. field in Subform table?
I don't know.. Object No is a code and must be a code (it's as order No in purchase table). Whan I put Line no as an integer, and I used subform properties, Nav said to me that Object No and Line No must be same data type. So I transformed Line No as a code that is automatically numbered form table No. Series.
That worked but the only thing I can't do is open a new subform when I press F3 .0 -
mohana_cse06 wrote:In Sales And Purchase Subforms (Document.No) = FIELD(No.).
both fields refer same data..
I feel the design of your tables is wrong..
IF you ahve no data in tables add Object No to Subform table and link both of them.
EDIT : Object no in subform should be part of primary key as in sales and Purchase Docuament No.
I already told you to add Object No in subform table.
The logic which you are using die not work. :thumbsdown:0 -
mohana_cse06 wrote:
I already told you to add Object No in subform table.
The logic which you are using die not work. :thumbsdown:
And I told you that Object No is both in subform table and in mainform table, but, when I insert new record, I cannot see anymore the record inserted before.0 -
if you say in your subformlink that the mainrec.object no. = subrec.line no. then ofcourse NAV is going to complain that the types should match. Remove this link and only make mainrec.object no. = subrec.object no.
Line no. should not be used in the link!
Second, line no. is used with no. series? Ask yourself why you did that and see the error of your way.
Line No. ought to be integer (best practice) so you can use autosplitkey.
Line No. should be the identifier which identifies the uniqueness of one line, while the object no. combines the lines in one document.
Maybe it's best if you start over with the tables and normalise those.0 -
Sog wrote:if you say in your subformlink that the mainrec.object no. = subrec.line no. then ofcourse NAV is going to complain that the types should match. Remove this link and only make mainrec.object no. = subrec.object no.
No, I wrote that if I put in SubformLink property subform.LineNo = FIELD(Mainform.ObjectNo), NAV tell me that I should have a transaction before modifying database.Line no. should not be used in the link!
Second, line no. is used with no. series? Ask yourself why you did that and see the error of your way.Line No. ought to be integer (best practice) so you can use autosplitkey.
It's impossible. Data don't match.Line No. should be the identifier which identifies the uniqueness of one line, while the object no. combines the lines in one document.0 -
luciana wrote:I tried to do this. But if I leave Line No as an integer, then, when I set subformLink property , Nav shows me an error that says:
It's impossible. Data don't match.0 -
*attempt no. 2
main rec: "object no.", "object name", (other important fields but not for now) (key= object no.)
sub rec: "object no.", "Line no." , "item no.","description", other fields) (key=object no. & line no.)
object no. in both tables is the same datatype.
Line no. is integer.
If the table is not designed like this, then don't start going for form & subform.
Don't bind "Line no." with "no. series": because that will effectively make sure that all the lines no matter under what object no. will be unique. (which is unneccesary). You only have to distinguish lines in the same "object".
Now let's design the form.
You know how to bind the tables, so let's skip that and go straight to the subformlink.
The only entry there should be Object no. = Object No.
If there is a mention of "line no." remove it.
In the subform set autosplitkey on. That way your integer "line no." will be automaticaly filled in when inserting a new line.
If you have problems grasping this concept, please contact a senior from your company.0 -
Sog wrote:If you have problems grasping this concept, please contact a senior from your company.0
-
Sog wrote:If you have problems grasping this concept, please contact a senior from your company.
http://www.mibuso.com/forum/viewtopic.php?f=23&t=47596
it's not fair that she's been threw from her boss in nav development without manuals, (as you can read from the link), but it's also not fair (and not "time-effective") to ask a step by step guide in a forum...you have to PRETEND study materials from your boss.0 -
Belias wrote:Sog wrote:If you have problems grasping this concept, please contact a senior from your company.
http://www.mibuso.com/forum/viewtopic.php?f=23&t=47596
it's not fair that she's been threw from her boss in nav development without manuals, (as you can read from the link), but it's also not fair (and not "time-effective") to ask a step by step guide in a forum...you have to PRETEND study materials from your boss.
thank you for your comprehension...
That's true, I have no senior developer to ask for.
Unfortunately, the project I should have work on is over but my boss told me I have to continue "homeworks". So I'm alone in this world and I couldn't have manual .
The only resource I could look at is this forum.
I know that I could not ask for a step by step guide and real time responses here, but I appreciate your helpfulness very much.
Thank you0 -
Ok, then let's take this one step at a time.
The first thing you should comprehend is the tables, their relations, behaviour, ...
I hope you have some knowledge of databasedesign, that will make this step a whole lot easier.
Tables consists of a number of fields. One (or more) field(s) will act as primary key, aka a unique identifier per record. Which means that a primary key will always be once in a table.
to create a relation between tables, one of the tables will have the primary key of the foreign table. (aka foreign key)
In a normal parent-child relation, the child table will have a primary key which consists out of the primary key of the parent table and it's own unique identifier. (in nav mostly line no.)
That way we can identify just by the parent's primary key all the records related in the child table. (and that connection is what we put in the subformlink)
The line no. of the child table can be the same, but the combination parent and line no has to be unique. Because this can be the same, we often don't use (like never) the no. series to fill in the line no. because we only have to distinguish lines in the same document. The No. Series table is handier when u have a single field primary key.
We often (like always) use integer for line no. because then the autosplitkey function in forms will be available.
The autosplitkey function on a form enables the last field of the source table's primary key to be split or added. (ie: no next line, last keyfield {line no.} + 10000, else a number in between the previous and current line)
The last thing I'd like to say is F1, the help function is awesome for beginners. You'll find an answer to a lot of your possible questions there. If you want to know more about code, go to the start page of the help and click C/SIDE reference guide. (also a help but for code).0 -
I don't understand anymore.
Can I post my fobs, so someone could look at and suggest where I'm wrong?0 -
export as txt, or copy pasta the code. If that's no option, then yes you may post the .fobs.
Mention the nav version too please.0 -
0
-
Are you sure FOB has tables also? :-k0
-
shit!
I apologize, here the correct link:
http://uploading.com/files/b42c1b78/tablesForms.fob/
luciana0 -
Download Modified objects from
http://uploading.com/files/4ced7c3f/tablesForms%2BMOD.fob/
No need to enter "Nro Riga" in subform..
After inserting the record in subform, it will automatically assign No.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions