Insert a new item automatically

Leroy
Member Posts: 199
Dear sirs, I want to do the following, but I don’t know if it is possible; I’d like that, on create an item, on item form, and on close it, it detects that that item Nº. finish in ING-A and go automatically to create a new item. How can I do that?.
Thanks in advance.
Thanks in advance.
0
Comments
-
Not sure I understand..
If you enter an item into the form and close it - it's already created.
perhaps you're not wording your question correctly.0 -
Thanks for reply. Sorry my english. I want that, when I close the form (with the item already created) and it detects that item finish in ING-A, it goes to a new item form to insert a new item.
Thanks for help.0 -
Ok so you're entering an item and IF the item number ends in *ING-A you want and F3 (insert) to happen.
This will allow you to enter another new item.
Is this correct?0 -
Yes!! it's correct. Is possible to do that?. I think I've to put the control on OnQueryCloseForm but I'm not sure, anyway I don't know how do the rest.
Thanks for your help.0 -
You'll have to explain why you want this,
note if you do get this to work onquerycloseform (not to mention onNextRecord) everytime you enter & leave any item that contains ING-A you will be prompted to enter a new item everytime if you want to or not.
If you use oninsert on the form you'll have to change the dlayed insert to yes. so i really think you should think this through on how you really want this to work.
You could add a confirm (item contains ING-a would you like to create another item?) but all this seems like alot of work to avoid the simple F3
if you need a simple reminder then
varInteger := STRPOS("No.", 'ING-A');
IF varInteger <> 0 THEN Message('Item %1 Contains ING-A',"No.");
Sendkeys could invoke the F3 but i would really think about auto inserting new items in this manner0 -
Leroy wrote:Yes!! it's correct. Is possible to do that?. I think I've to put the control on OnQueryCloseForm but I'm not sure, anyway I don't know how do the rest.
Thanks for your help.
What ever you are trying to do, it looks like you are going about it the wrong way.
Take two steps back and start again and rep-hase the question by explaining why you are doing this and what you want to achieve, then maybe we can help you with a better solution.David Singleton0 -
Thanks both for reply. The problem is that if I put the code on OnQueryCloseForm it shows me the message everytime that I get the item as you say;Is there any way that it shows only when I create it? How can I do a F3 sendkey automatically by code?, it will be after show the message.
Respondig David I'll try to explain what I want to do. When an user insert a new reference ING-A terminated, I want that the system automatically forced to insert another Item which will be associated in another process. This is so because, the user who must link these two references, don't forget to create the associated Item; I hope to have explained. I can't think of another way to be sure that you insert the second reference.
Thanks for help.0 -
Are these items linked in some way?
do they reference each other somewhere or have something in common?
If so you can have the system check those/that field(s) to see if they filled, else make the item unusable.
for exmaple if the item contains ING-A (onInsert) it sets the blocked field to true and onvalidate of the blocked field you can do a testfield to see if the "linked/reference" field is filled, then it will only allow you to uncheck the blocked field at that time.
else I can't see this happening cleanly without putting the code oninsert and changing the delayedinsert proprty to yes on the item card. This way you won't be prompted to keep inserting everytime you enter this item as you will get using onqueryclose form.
there are plenty of posts about sendkeys if you search the forum. but what's stopping the user from closing the form anyway once a new item insert has been created?
if you want a message only then I can help you with that.0 -
Thanks for reply; they are linked in other way, it's long to explain. With your comments and what I'll find seaching "sendkey" on forum it will be enough.
Thank you very much for your help and time.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