Wizard to create items

kjboloe
Member Posts: 56
Hi
I would like to make a wizard to create items.
I have a problem when I use Item as SourceTable :
I would like the datasource to be blank so that I can fill the field as if it was done by using Item Card and create new, but I get the first record from the Item table.
Is there a way to make the datasource in create mode or is the solution to create a new table and use that as SourceTable ?
I would like to make a wizard to create items.
I have a problem when I use Item as SourceTable :
I would like the datasource to be blank so that I can fill the field as if it was done by using Item Card and create new, but I get the first record from the Item table.
Is there a way to make the datasource in create mode or is the solution to create a new table and use that as SourceTable ?
Kind regards
Kenneth Jarlshøi Bolø
Dynateam A/S
Kenneth Jarlshøi Bolø
Dynateam A/S
0
Comments
-
you colud use a new table where insert all field and when you confirm the insert of item you write in the right table.
other solution is look at the other wizard in the sistem ( form 5077 for iteraction in 3.70)0 -
Hi,
You do not have to have a sourcetable for a form. The New Form Wizard will let you create one without a table (unless that's changed in newer versions), or you can remove it from the form's properties after creation.
You can then just use variables on the form to create the Item entry.
I would try to avoid using an extra 'buffer' table to create these entries.0 -
Hi Allan
I have tried that , but if make the form without a datasource and create a variable for it, I have problems with lookup, because I can't use tableRelation on a variable. Then I have to code the lookup and so on.Kind regards
Kenneth Jarlshøi Bolø
Dynateam A/S0 -
If you create variable Items: Record 27, and in edit box you use in SourceExpression Items.Category (for example) - there is lookup...0
-
Ok, you can still have the sourcetable as Item, but set the InsertAllowed and DeleteAllowed to 'No' on the form. You might also want to change the DataCaptionExpr so that you do not see the record number from the Item table.
You can then add variables to the form. Drop on some textboxes, set the source of the textboxes to the variables AND you will be able to use table relations on the textboxes.
You can then just have an 'Add' button that uses the values from the variables to create a new Item record and insert it.
Let me know if you need any more help.0 -
Hi
I have found a solution :
1) I call a codeunit from form Item Card
2) The codeunit call my wizard
Codeunit :
ItemRec.SETRANGE(ItemRec."No.",'');
CreateItemWizard.SETTABLEVIEW(ItemRec);
CreateItemWizard.SETRECORD(ItemRec);
CreateItemWizard.RUNMODAL;
Then after I have keyed in the Item I insert the record, this works fine.
My wizard have now Item as SourceTable
Thank for all your help \:D/Kind regards
Kenneth Jarlshøi Bolø
Dynateam A/S0 -
New solution to the problem.
I now call my wizard directly from Item Card.
I have created a global variable for the field No. (ItemNumber)
On the trigger OnOpenForm :
SETRANGE("No.",'');
On the trigger OnValidate :
I create a local variable NewItem as Record Item
NewItem."No." := ItemNumber;
NewItem.INSERT;
SETRANGE("No.",NewItem."No.");
On the trigger OnAfterValidate :
CurrForm.UPDATE(FALSE);
\:D/ \:D/ \:D/ \:D/ \:D/ \:D/ \:D/ \:D/ \:D/ \:D/Kind regards
Kenneth Jarlshøi Bolø
Dynateam A/S0
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