Where is it getting the "Document Type"?

When you create a sales header from the quote form, the document type is Quote. When you create a sales header from the invoice form, the document type is Invoice. etc. When and how is Navision setting document type? I would like to make a form for a new document type and have it default to my new type. I put it in the form in the OnNewRecord Trigger on my new form and it seems to work but the other forms do not seem to need that. Why?

This is done in “Code Unit1”

quote:


Originally posted by bhagan: When you create a sales header from the quote form, the document type is Quote. When you create a sales header from the invoice form, the document type is Invoice. etc. When and how is Navision setting document type? I would like to make a form for a new document type and have it default to my new type. I put it in the form in the OnNewRecord Trigger on my new form and it seems to work but the other forms do not seem to need that. Why?


Check property “SourceTableView” on the form. It sets the filter on a document type. It goes to a different filtergroup, that can not be removed by a user.

Check the way the filtering is applied to the document type on the form SourceTableView. When creating a new record it uses the current table view/filters and applies them to the creation of the new record. Codeunit 1 does not come into the picture. Add the document type to “Sales Header”.“Document Type”. (add to the end or you will have a lot of interesting times ahead of you!). Modify the GetNoSeries function in the Sales Header table to have a new number series autoallocation setup. Add a new field to Sales & Receivable Setup for the new document type. Add the new field to the Sales & Receivables Setup form too. Do similar for posting number series too if its going to post. Setup a number series for the new type. Create a new form with the appropriate filtering set and add it wherever you want to reference it from. Done. Interesting job of creating all the posting code etc that the standard documents have though… Craig Bradney Technical Manager Navision Solutions & Services, Deloitte Touche Tohmatsu Email:cbradney@deloitte.com.au

I have SourceTableView on the form set to my new type, Deposit – just like in orders, quotes, invoices, etc. When I press F3 to insert a new record, the document type is Quote, not Deposit. What else could be the problem? I have already set up the numbering and modified the sales & receivable setup. No, I won’t be using this form to post - just keeping some info.

Beth The New FORMS SourceTableView = WHERE(Document Type=FILTER(Deposit)) And the Button RunObject = “Form Sales Deposit” Just calls your new form, should work just fine! David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk