Form Design Navision

david.weeksdavid.weeks Member Posts: 96
edited 2004-02-18 in Navision Attain
Hello All,

I have been given the task of allowing a user to add multiple comments against a sales quote line.

As we know, standard Navision only allows the user to add comments against the sales quote header.

Any ideas on how to approach this?

One idea is to add a field to the sales comment line - being sublineno.
Add this to the existing primary key for sales comment line.

I then add Comments to the Line button on the quote form.

What do I do then?
Call a new form directly?
Call a function that goes to the Quote Sub-Form and then opens a new comments form automatically?

If you think the second approach sounds good, how do I call such a function and what is the code to open a new form from c/al?
(I am new to all this but learning fast)

Thanks

Comments

  • eromeineromein Member Posts: 589
    dude.... again.... wrong forum....


    ok, very short and quick then.

    Make a new tabel (or expand the existing one). Copy all field from the standard sales comment lines. Add a field Document Line No. below the Document no. field. Add this field to the key. NOT AT THE END, before Line no. Dont forget to set the property AutoSplitKey to yes on the new form.

    Make a function in the salesline that opens the form
    saleslinecommentline.setrange(...);
    form.runmodal(form::form50001,saleslinecommentline)
    

    make a function on the subform of you sales document that calles the function in the table. Add rec. to the call when the function names are the same. else it will call itsself. call the function in the subform from the salesheader like this:

    currform.subformname.form.functionname; (orsomethinglikeit)

    this should do the trick....

    please understand, if I spend two more minutes to this post I could have developed it my self... So that's why it a short and quick post :wink:

    Although you are a beginner, these are not the best thing to start with, as you can see. It's not very diffecult, but you really have to some Navision knowledge to make these kind of things.

    Good luck!
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • david.weeksdavid.weeks Member Posts: 96
    Hi there,

    I have solved the problem by creating a control button within the sales quote subform.

    Within this subform, I have created two variables one that links to the new comments table and the other to the new comments form.

    I have then created a temporary table (view) that links the subform (sales line) with the new comments form.

    All seems to work fine once I have input the above code within the OnPush trigger.

    One last question within this issue - how do I check if the date has already been input, and if not input by the user, how do I force a default of today to go in there. I did it before by using the SetUpNewLine function - but this doesnt work in this case.

    I guess I need to use the onvalidate within the date field to check that a date has been input - but any code use says things like "you cannot compare a date with text".

    Ideas?

    Thanks
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    Topic moved from "Navision Tips & Tricks".
Sign In or Register to comment.