Form Runmodal - Temptable

JPHSC
Member Posts: 67
The goal is to make a sort of wizard that only alters the record when the Finish butten is hitted.
When i have a temptable and i copy the current record to the temptable
When i try this ;
everything is working perfectly.
When i do it with a variable
I get an error... I don't get it ..
When i have a temptable and i copy the current record to the temptable
temp.init; temp.transferfields(rec); temp.insert; temp.setrecfilter;
When i try this ;
IF FORM.Runmodal(Form::"My Form", temp) = action::lookupOK THEN BEGIN rec.transferfields(temp); rec.modify; CurrForm.update(FALSE); END;
everything is working perfectly.
When i do it with a variable
MyForm.SETRECORD(temp); MyForm.Lookupmode(true); IF MyForm.Runmodal = Action::LookupOK THEN BEGIn MyForm.GETRECORD(temp); Rec.Transferfields(temp); rec.Modify(FALSE); CurrForm.update(FALSE); END;
I get an error... I don't get it ..
0
Comments
-
you got an error...ok.....................
What is the error?!?! :shock:
maybe "...does not exists?"
try to userec.insert;
instead ofrec.Modify(FALSE);
...just an idea looking at your piece of code...you should provide the error text :-k0 -
i don't get an error, it's just that the second way doesn't seem to use the temptable for the form, so that the record is always updated.
I don't want the 'actual record' to be updated, but only the temptable. And if the user chooses finish the code update the actual record, if the user chooses cancel, all the changes are made to the temptable, not the actual table. All i want to do then is clear the temptable so no changes are saved.0 -
MyForm.SETRECORD(temp); Currform.update(false);
you don't need this instruction:
maybe your problem is generated from the use of both setrecord and setrecfilter...(never tested)
setrecfilter should be the only thing you need, try it0 -
JPHSC wrote:The goal is to make a sort of wizard that only alters the record when the Finish butten is hitted. ...
Just don't do this. You owe it to you client to be honest to them and say NO. Teach them Navision and tell them that if they don't like Navision, then maybe its best they go back to their old product.
I have seen many attempts to mimic the wizard concept in Navision, (Items, customers, vendors, sometimes even sales orders), it just get more and more complex and more and more expensive.
Best is to stop now.David Singleton0 -
Boss,Teach them Navision and tell them that if they don't like Navision, then maybe its best they go back to their old product.
Not sure if I agree with you on this...
One of the flaws of Nav is the immediate unintentional update of records in Master Cards which uncountable complaints were received & requests to do something about it.
One of the common requests is to disable edit unless authorized in some way or intended.
Definitely such kind of wizards is going to be expensive initially, but it becomes an advantage for you to have such wizard when other competitors cannot or unwilling to provide. It doesn't modify Nav business logic & adds value (read $) to what the implementer can provide.NAV - Norton Anti Virus
ERP Consultant (not just Navision) & Navision challenger0 -
idiot wrote:One of the flaws of Nav is the immediate unintentional update of records in Master Cards which uncountable complaints were received & requests to do something about it.idiot wrote:One of the common requests is to disable edit unless authorized in some way or intended.
Sounds like a pretty good way to generate some business... :-k0 -
I agree, but i'm JUST the developer ... ](*,)
It has something to do with the hosting licence for the small ( dumb & not interested ) customers .. ?0 -
JPHSC wrote:I agree, but i'm JUST the developer ... ](*,)
It has something to do with the hosting licence for the small ( dumb & not interested ) customers .. ?
Sorry but that is just BS, this all goes back to lazy sales people that just say "Sure Navision can do anything".David Singleton0
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