hi Brandon
trust me, sometimes its better to do such upload thingys thru hidden forms.
The biggest advantage is that you dont have write a lot of code and it becomes completely upgradeproof.
Further, you are always sure that all the validations that are associated with the table are always performed. This is so because practically speaking you are emulating what a user does when he creates the journal manually.
I have upgraded about 20 axapta systems so far and upgradability for me has the highest priority than anything else.
Coming back to best practices. I always prefer to follow best practices, but you have to understand that best practices is something that is 100% applicable to code written by Microsoft. When it comes to partners, sometimes you have to deviate from best practices.
A partner never has enough testing resources. If you write the code as above then you have to do a lot less testing compared to the code that actually invokes the classes.
There is one more scenario where the code I have written will be applicable:
(I have actually written this code for someone). My client wanted real transfer journals between warehouses (not the instantaneous one in Axapta). In this case the only choice I had was to create a completely new module. But I used the 'hidden form' concept like this:
Create a new table with fromwarehouse - interimwarehouse - towarehouse - quantity
Create a new table holding two lines
1st line from warehouse - interimwarehouse - date of transfer
2nd line interimwarehouse - towarehouse - date of transfer
At this point of time I linked the two lines to normal inventory transfer journals (a separate journal for each line) and used hidden forms to emulate the functionality.
There was no way I could write an entire module for this functionality (from upgradability point of view). But this way it was a piece of cake, 8 hours of programming and I could deliver exactly what the client wanted.
Last but not the least: I never expect that code on systomatics.biz will go live, it is meant to give new direction in which one can think. I Hope it serves the purpose.
another last but not the least: hey, thanx for putting me on your blog*s*
regards
harry
Brandon George <[EMAIL PROTECTED]> wrote:
Harry I would recommend to anyone that they do your last project through code and classes, not hidden forms. Simply, it not the best of practices to load a form, hide it, and then manipulate the form. It's better to work with classes, and tables directly when doing such a task.Other than that though great resource for projects, and code examples! I make sure to ad an entry to the blog for ya!-Brandon
Yahoo! FareChase - Search multiple travel sites in one click.
Sharing the knowledge on Axapta.
YAHOO! GROUPS LINKS
- Visit your group "Axapta-Knowledge-Village" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.