hi all!
i'm looking for a possibility to jump to a new record. i've tried out several ways but had bad look so far.
at last i did the following:
rec.FIND('+');
rec.NEXT;
but navision ignores the next command. and a function like
rec.NEW;
does not exist! can anyone help me?
Comments
This works for tables with the "No." field as primairy key. Such as the Contact, customer, vendor and Item table.
If there is a more complex key like the salesheader you need to clean the complete key.
the code should do nothing else, then set the recordmarker to a new, initial and unposted record. same as i scroll down a table until i come to the new record, right behind the last one.
then the user can fill up the fields, if he want's to do so. if not, no record will be written.
jam176
Normaly the user can use F3 and Navision performs this task. Why can't you use the F3 functionality?
there is a special table i created to prepare relations between production orders. at the moment only a few fields are defined. the production number, 3 fields for production order numbers (which belong to each other) and some others.
by doing this the 3 production order numbers are combined under the production number.
users should be able to see this table in a form which is normally not editable to avoid changings by mistake. but if one single user with special rights wants to insert a new production number to assign production orders, i provide a button named "New..." for him. he can click this button and that's the point:
with the onpush event the form should become editable and the cursor should jump to a new record!
i think my whish is absolutely unspectacular, but i can't find a solution for navision attain.
jam176
If you want this you can search this forum, there are some topics about it.
You can also leave the form uneditable and make some function that creates the record via a report, you can use the request form for the user input. After the report you can jump to the record.
anyway, i will only switch the form to editable mode and the user should press F3 to insert his new record.
but do me a favour and tell me: isn't it strange, that navision does not provide a function for such a simple thing???
jam176
Quote (MBSOnline.org):
And most importantly - remember this is Navision, don't fight it, its just different, doing it the Navision way will make life much easier for you.
David Singleton
this is possible in Navision:
1. create a function in your form with the following code:
- check the requested rights
- clear the "Rec"-variable
- fill the primary key of "Rec"
- Call Rec.INSERT(TRUE)
- Set xRec."primary key fields" to Rec."primary key fields"
- Set form to Editable
- call CURFORM.UPDATE
2. add a menu item to call this funtion (with ShortCutKey = F3)
br
Josef Metz
Josef Metz