How to do ?

Hi all,

I have created a form named IVP Master (Header and Line parts.)

The Line Part show those Lines which are filtered by the Headers.

This is working fine.

And I have also created functionality (Function → Insert IVP Master) in the Form IVP Master to insert the data in the Line part if No Lines are filtered by the header.

To do this I have write the code in Command Button on the Form to insert the data.

Every thing is going fine. May be the way I ‘m doing is wrong??

So can anybody suggest me what is the best way to do these?

Actually the main purpose of this form is to show the filtered data which is filtered by the Header part and if no data is shown in the Line part than Insert IVP Master can insert it into the Master table, source table of the IVP Master form.

Note: Header part is containing some variable Controls. And Line part is actually TableBox

Thanks with regards.

Hi Subrata,

I have been reading this post many times. But I have still not been able to understand what your question is. You write that “This is working fine” and later “Everything is going fine.”

If everything is fine, then why do you think something is wrong? If something is not working, then it would be great if you could write it! [;)]

Question to Win support: “I installed Windows three years ago, am working daily, but Win has never shown the blue screen of death. WHAT am I doing wrong?”

PS Actually this should be posted in Break Space, sorry, could’t desist posting anyway, besides, it IS Friday evening now [:)]

I think this person has written a modification, that seems to be working. I think they are asking for comments/sugestions as to whether they have taken the correct approach. At least that’s the way I’m reading this.

THANKS babrown[:D]

You have understood my posting if you have any suggestion plz share with me.

Thanks with regards.

I probably would have written the code for “Insert IVP Master” as a function on the header table (or as a codeunit). Then just called it from the form. As a general rule, I try to minimize the amount of code on a form. By keeping code in tables and codeunits, it allows me to easily re-use that code in different forms or reports. It also makes upgrading easier.

Hope this is helpful.

Is there a reason why you don’t want to leave the subform with the lines open for user entry? That’s how standard NAV works, and it would make sense to keep the same feel for custom functionality. Standard NAV doesn’t have such a button to insert a line.

I think I missed that. I was thinking it was a function where the system created lines based on some criteria. Something like copying from a template. If it is just a button to allow a user to add a new line, then no need for the button. Just follow standard NAV.

Hmmmmm…

Worthful suggestin [H]

Thanks Daniel…

I would say that the best advise I can give someone just learning to program in Dynamics NAV is: STEAL!

By that I don’t mean that you should go out and copy other peoples solution. But that you look at how things are done in STANDARD NAV and then copy the structure, including tables, forms and codeunits. This way you do not only make shortcut in creating your new solution, but you do also make your self familar with the standard solution.

Many times when I need a new “solution” then I have been copying the standard tables, forms and codeunits. Then I have deleted what I don’t need, so basically only the structure is left, before I have inserted new fields etc. It’s also an advantages for other developers who later needs to understand your code, then it’s done in the same way as the standard. By copying tables, then you will also have the advantages that ex. fields numbers for the same fields in your solution are the same as in the standard solution. Ex. if you need a new table including name, addresses and phone number, then you could copy the customer table and just delete the fields you don’t need (also remember to delete all the functions on the table you don’t need). But you will get a “clean” solution.