revised: passing a value frm the header form to line subform

navdev3navdev3 Member Posts: 32
We would like to simplify our data entry of invoices. All of our invoice detail lines will have the same dimension values for the entire invoice, so we would like to enter the dimension values just once on the header form and have the detail lines automatically default to the values entered on the header form. This is essentially the way that the two global dimension fields behave except these two global dimension fields are actually stored in both header and line tables. We don't want to change the way Navision handles dimensions so we are not adding the dimension (shortcut dimensions) to the header table.

Is there a way to pass the values of the two shortcut dimension values which are stored in variables only on the header form to the subform?

Revision:
What I really should ask is when you are in the subform, is there a way to get a value that has been entered to a variable on the header form?
«1

Comments

  • ara3nara3n Member Posts: 9,257
    This is standard navision functionality. When you change the dimension on header it asks you if you want to update the lines. You click yes and it updates the lines. This worked in 3.7 and works in 4.0 sp2.


    Also when you create new lines it picks up the dimension from header.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • navdev3navdev3 Member Posts: 32
    Do you know if I can get that to work with shortcut dimensions? We want to duplicate what is happening with the global dimensions with the shortcut dimensions without adding any shortcut dimenstion fields to the header table.

    PS. By "shortcut dimension" I mean shortcut dimensions 3 to 8....
  • themavethemave Member Posts: 1,058
    edited 2006-07-12
    navdev3 wrote:
    Do you know if I can get that to work with shortcut dimensions? We want to duplicate what is happening with the global dimensions with the shortcut dimensions without adding any shortcut dimenstion fields to the header table.

    PS. By "shortcut dimension" I mean shortcut dimensions 3 to 8....
    Try setting up responsibilty centers that have all the dimensions you needed, then you only should have to enter the responsibility center in the header (which by defualt is there) and the dimensions will be filled in. Both the Order header dimension and line dimension, I do this for department code, project code, location code, and a few shortcut dimension we use.

    for instance I have a responsibility center code 07
    is has
    Department code 07
    Location code 07
    Project code PTO
    Rack code - A1 (shortcut 3)
    TACCt code - CASH - (shortcut 4)

    I enter responsibility center 07 on the header, all the codes get entered in the header and the line dimension tables. this sounds like just what you are asking, with no modification needed. If you don't have the responsibility center granual, it would be cheaper to buy it and use then to modify the code and then maintain it during an upgrade later on.

    Just my opinion
  • ara3nara3n Member Posts: 9,257
    One simple suggestion for dimension is to create a subform on header and isplay the document dimensions. This is the simplest least intrusive modification.

    Also shorcut dimension replicate as well from header to lines, not just global dimensions. Just open a chronus db and create an order and select non globa dimension on order.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • navdev3navdev3 Member Posts: 32
    Thank you for the information! I passed this by our project manager and it is not going to work because they want to be able to enter different combinatiosn of dimensions for each invoice independent of the responsibility centers. (ie. two invoices with the same responsibility centers could have different combinations of dimensions.)

    This seemed like such a simple request but I just cannot find the mechanism to make it work. All we want to do is get values stored in variables on the header form from the subform.
  • navdev3navdev3 Member Posts: 32
    edited 2006-07-12
    ara3n wrote:
    One simple suggestion for dimension is to create a subform on header and isplay the document dimensions. This is the simplest least intrusive modification.

    Also shorcut dimension replicate as well from header to lines, not just global dimensions. Just open a chronus db and create an order and select non globa dimension on order.

    Can you please elaborate the replicate of shortcut dimension from header to lines? I thought this was just possible with global dimensions (ie. shortcut dimensions 1 and 2). If this is possible, it sounds like what we need on the dimension side!

    Although, I still need the information on how to get values from variables entered on the header form because there are other fields that the client would like to enter just once on the header form and have that propagated to the detail lines.
  • themavethemave Member Posts: 1,058
    No knowning how you use responsibility center I can only guess,

    but you could set up a variaty of responsibility centers that are similar.

    ie

    07-1 could have one set of dimension
    07-2 could have another combo of dimension

    then for your reporting needs you could filter on responsibility center 07*

    But more likely you are going to be reporting on the dimensions anyways,

    if this doesn't work, then you should use "ara3n" recomendation and do a little coding, otherwise it is going to be hard to add info from the header if you don't want to modify the header, the two needs to not go together, without being creative.
  • ara3nara3n Member Posts: 9,257
    All the dimension are copied from header to line. This is standard navision.

    For other fields that you want to replicate to the lines. You need to make modification for this. In sales Header there is a function called updatesalesline. Modify this function to add the new fields
    Could you be specific what fields you want to replicate to the line?
    Most of the fields that are needed are replicated.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • navdev3navdev3 Member Posts: 32
    ara3n wrote:
    All the dimension are copied from header to line. This is standard navision.

    For other fields that you want to replicate to the lines. You need to make modification for this. In sales Header there is a function called updatesalesline. Modify this function to add the new fields
    Could you be specific what fields you want to replicate to the line?
    Most of the fields that are needed are replicated.

    Re: "All the dimensions are copied from header to line."
    I can see that Shortcut Dim 1 code and Shortcut Dim 2 code are copied from header to line. Shortcut Dim 3 to 8 are not entered on the header form. They are entered on the line subform. Our client has four dimension in total. Two of which are Shortcut Dim 1 and 2 so when we enter these on the header form, they are copied to the detail line. The remaining two are Shortcut Dim 3 and 4 and they are only entered on the line subform so they have to be entered on every single detail line. Since an invoice has the same dimension codes for every detail line, the client would like to simplify data entry by only entering shortcut dim 3 and 4 once on the header just like shortcut dim 1 and 2. Problem is shortcut dim 3 to 8 are not stored on the header table (or the line table for that matter). Only shortcut dim 1 and 2 are stored on the header and line tables.

    Re: "Could you be specific what fields you want to replicate to the line?"
    An example is the tax group code or any other field where the value is the same for all detail lines for a particular invoice header. We want to put a field in the header to capture what the value should be and have the detail line pick up the value from the header.

    We are looking for the least intrusive way of accomplishing this. I could add these fields to the header table and have the detail line read the header record but that seems a little excessive.
  • themavethemave Member Posts: 1,058
    edited 2006-07-13
    on a sales order, if you enter the shortcut dimension 3 and 4 by using the "ORDER" button on the bottom of the sales order, it will also be entered on the Line dimension automatically for all lines. This is standard Navision behavior.

    If you use the "Line" button on the bottom next to the "Order" button, it will show you the same dimensions being entered for each line.

    These values are stored in a separate table before posting - Document dimension table 357.
    They did this so you could access all the extra dimensions you wanted without having to hard code the tables with the extra field, if you follow the approach you are on, you will need to modify the sales header table and the sales line table to add the short cut dimension 3 and 4 to each, then modify the code to record this info. and if in the future you decide you want to also track additional dimensions you will have to again modify the tables and the code. Instead use the built in functionality and modify your report to use the value entry table to get the dimensions. all these values for are stored in the posted document dimension table 359, you can make your report with the posted sales line table and the table 359.
  • navdev3navdev3 Member Posts: 32
    themave wrote:
    on a sales order, if you enter the shortcut dimension 3 and 4 by using the "ORDER" button on the bottom of the sales order, it will also be entered on the Line dimension automatically for all lines. This is standard Navision behavior.

    If you use the "Line" button on the bottom next to the "Order" button, it will show you the same dimensions being entered for each line.

    Unfortunately, the client isn't using Orders. We are trying to do this in both the sales and purchase invoice forms.

    I think I may be leading everyone down a more complicated path than there needs to be. If so, I apologize. :oops: I have been experimenting with CurrForm.Update(TRUE). It seems like it should do what I need. Initialize the fields in the detail line form with values entered on the header form. I'm just haven't gotten the exact results the client wants. Am I using CurrForm.Update correctly? Confused yet??? :?
  • themavethemave Member Posts: 1,058
    navdev3 wrote:
    themave wrote:
    on a sales order, if you enter the shortcut dimension 3 and 4 by using the "ORDER" button on the bottom of the sales order, it will also be entered on the Line dimension automatically for all lines. This is standard Navision behavior.

    If you use the "Line" button on the bottom next to the "Order" button, it will show you the same dimensions being entered for each line.

    Unfortunately, the client isn't using Orders. We are trying to do this in both the sales and purchase invoice forms.

    I think I may be leading everyone down a more complicated path than there needs to be. If so, I apologize. :oops: I have been experimenting with CurrForm.Update(TRUE). It seems like it should do what I need. Initialize the fields in the detail line form with values entered on the header form. I'm just haven't gotten the exact results the client wants. Am I using CurrForm.Update correctly? Confused yet??? :?
    That doesn't matter it still works for sales and purchase invoices

    These values are stored in a separate table before posting - Document dimension table 357.
    They did this so you could access all the extra dimensions you wanted without having to hard code the tables with the extra field, if you follow the approach you are on, you will need to modify the sales header table and the sales line table the posted sales header and posted sales line tables, (and the purchase header, ect ) to add the short cut dimension 3 and 4 to each, then modify the code to record this info. and if in the future you decide you want to also track additional dimensions you will have to again modify the tables and the code. Instead use the built in functionality and modify your report to use the value entry table to get the dimensions. all these values for are stored in the posted document dimension table 359, you can make your report with the posted sales line table and the table 359.
  • navdev3navdev3 Member Posts: 32
    Thank you!!! I just checked out the dimensions option on the invoice button. Hopefully it will work for the client. Really appreciate your patience!!!

    What about the concept of defaulting a field in the detail line subforms with values entered on the header form? Is CurrForm.Update(TRUE) the way to achieve this?
  • ara3nara3n Member Posts: 9,257
    whew.... So dimensions have been taken care of. I am guessing you are totally new to navision. So have to probably write the a little more in detail.
    So I will ask what fields do you want to default. If you tell us what fields. We can help you find the right solution.

    For example Clients wants to default qty to 1 for example. Or want to only see type of item.

    Please tell us what fields you want to default to.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • navdev3navdev3 Member Posts: 32
    What gave me away? Don't answer that... :) I'm used to having a little more control over the interface than I seem to have with forms in Navision. Thank you again for your help (both of you, Ara3n and themave).

    The field that I would like to default from the header form is Tax group code (purchase invoice). There may be a few more coming, I am just waiting to hear from our project manager.[/quote]
  • ara3nara3n Member Posts: 9,257
    Tax group code defaults from the Item. So you don't need to to default it to anything. Just fill the tax group code on all the items.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • navdev3navdev3 Member Posts: 32
    ara3n wrote:
    Tax group code defaults from the Item. So you don't need to to default it to anything. Just fill the tax group code on all the items.

    We are really keen on fast (really, really fast) data entry. So yes the tax group code does default from the item and gl but we want to be able to change the tax group code on the invoice (if the one defaulted in is not correct) in one spot on the invoice screen and have it (tax group code) propagate to the detail lines of that invoice when we enter the details.

    This customization really is for the purpose of fast data entry. We want to key information that is the same for the entire invoice in one spot and have it propagate to the detail lines as the lines are entered without having to key them at each line.
  • themavethemave Member Posts: 1,058
    navdev3 wrote:
    ara3n wrote:
    Tax group code defaults from the Item. So you don't need to to default it to anything. Just fill the tax group code on all the items.

    We are really keen on fast (really, really fast) data entry. So yes the tax group code does default from the item and gl but we want to be able to change the tax group code on the invoice (if the one defaulted in is not correct) in one spot on the invoice screen and have it (tax group code) propagate to the detail lines of that invoice when we enter the details.

    This customization really is for the purpose of fast data entry. We want to key information that is the same for the entire invoice in one spot and have it propagate to the detail lines as the lines are entered without having to key them at each line.
    maybe you could explain the situation that would require the "Tax Group Code" would need to be changed, I do not believe we have ever had to change that code.

    We do sometimes have to change the "tax area code", but that defaults from the customer card, or the ship to address. The only occation we have to change that is when a resale customer is purchasing something for there own internal use and we need to charge sales tax. In that case we change the tax area code on the "invoicing tab" which does change it everywhere on the order.
  • navdev3navdev3 Member Posts: 32
    If we have a customer with tax exempt status (ie. anyone with Native status), we need to change the tax group code even though the item/gl is taxable.
  • ara3nara3n Member Posts: 9,257
    navdev3 wrote:
    If we have a customer with tax exempt status (ie. anyone with Native status), we need to change the tax group code even though the item/gl is taxable.

    On header there is field called tax liable uncheck that field. Do not change the tax group code. The tax liable field will make the whole order nontaxable.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • themavethemave Member Posts: 1,058
    navdev3 wrote:
    If we have a customer with tax exempt status (ie. anyone with Native status), we need to change the tax group code even though the item/gl is taxable.
    I don't think I can walk you through the setup, but this is very common, we have a few thousand customers that are not taxable and 5 times that that are taxable

    You need to setup tax jurisdictions for this,
    for instance you could have a jusisdiction that is native status and the rate would be zero,

    The sales tax setup is complicated, but it does make since. Here in california I have fifty different local tax rates, as well as governments customer at zero, resales customer at zero rate. Once you set the customer tax code that triggers the rate charged on the order.
  • themavethemave Member Posts: 1,058
    ara3n wrote:
    navdev3 wrote:
    If we have a customer with tax exempt status (ie. anyone with Native status), we need to change the tax group code even though the item/gl is taxable.

    On header there is field called tax liable uncheck that field. Do not change the tax group code. The tax liable field will make the whole order nontaxable.
    Be careful with this, the basic thing is every thing is taxable, the rate just might be zero, in which case you should set up a tax jurisdiction with the zero rate and make the customer tax liable with a that jurisdiction, otherwise when you go to fill out a tax report you will not be able to easily get a report of your tax exempt sales. Hope this make since, My California salestax report requires I report all sales, and a detail of all exempt sales, as long as the tax liable is checked, all my sales tax reports give the information. So, I know if the sale was exempt because they have a resale card, or if they are a government agency, or an Indian reservation, or a Farm equipment supplier, who gets a different rate. In any case I think you get my point, everything should be tax liable, but not necessarily taxable. It will depend on your reporting requirements.
  • navdev3navdev3 Member Posts: 32
    We are in the same type of situation then. We want everything to be tax liable because we need to report to the government that the only reason why taxes was not collected on a particular item because the customer has tax exempt status. I will see if there is a reason why we didn't set up a separate jurisdiction for the tax exempt customers.

    Thank you.
  • ara3nara3n Member Posts: 9,257
    themave wrote:
    ara3n wrote:
    navdev3 wrote:
    If we have a customer with tax exempt status (ie. anyone with Native status), we need to change the tax group code even though the item/gl is taxable.

    On header there is field called tax liable uncheck that field. Do not change the tax group code. The tax liable field will make the whole order nontaxable.
    Be careful with this, the basic thing is every thing is taxable, the rate just might be zero, in which case you should set up a tax jurisdiction with the zero rate and make the customer tax liable with a that jurisdiction, otherwise when you go to fill out a tax report you will not be able to easily get a report of your tax exempt sales. Hope this make since, My California salestax report requires I report all sales, and a detail of all exempt sales, as long as the tax liable is checked, all my sales tax reports give the information. So, I know if the sale was exempt because they have a resale card, or if they are a government agency, or an Indian reservation, or a Farm equipment supplier, who gets a different rate. In any case I think you get my point, everything should be tax liable, but not necessarily taxable. It will depend on your reporting requirements.

    As long as you have tax area code filed but the tax liable not checked navision creates the tax entry (actual table name Vat entry ) tables which the report uses for printing the tax information and prints info on sales that were tax exempt.. I'm pretty sure. What version are you using themave?
    Otherwise if you have to create an nontax tax area code for every tax area code and dublicate the tax detail lines which would be nontax joursdictions and have the tax detail combination for every tax group code. If you are shipping to 5 states That will be unmaintainable. Tax is allready as unmaintainable as it is.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • themavethemave Member Posts: 1,058
    ara3n wrote:
    themave wrote:
    ara3n wrote:
    navdev3 wrote:
    If we have a customer with tax exempt status (ie. anyone with Native status), we need to change the tax group code even though the item/gl is taxable.

    On header there is field called tax liable uncheck that field. Do not change the tax group code. The tax liable field will make the whole order nontaxable.
    Be careful with this, the basic thing is every thing is taxable, the rate just might be zero, in which case you should set up a tax jurisdiction with the zero rate and make the customer tax liable with a that jurisdiction, otherwise when you go to fill out a tax report you will not be able to easily get a report of your tax exempt sales. Hope this make since, My California salestax report requires I report all sales, and a detail of all exempt sales, as long as the tax liable is checked, all my sales tax reports give the information. So, I know if the sale was exempt because they have a resale card, or if they are a government agency, or an Indian reservation, or a Farm equipment supplier, who gets a different rate. In any case I think you get my point, everything should be tax liable, but not necessarily taxable. It will depend on your reporting requirements.

    As long as you have tax area code filed but the tax liable not checked navision creates the tax entry (actual table name Vat entry ) tables which the report uses for printing the tax information and prints info on sales that were tax exempt.. I'm pretty sure. What version are you using themave?
    It will make an entry, but you won't know why, our tax exempt sales are several different types, one is resale, one is government, one is out of state, if the tax liable is not checked I have no way of knowing what type of sale it was, with tax liable checked, and the customer coded to tax area code (resale, outst, govt, ect) my sales tax reports list each one, without the tax liable, it all goes in the column tax exempt with no detail as to the reason.
  • ara3nara3n Member Posts: 9,257
    Well that's a different issue. I'm sure it's easier to modify the report to add the info to the report, the customer no and tax exept number, than maintain the tax area codes. In your case, it is not an issue cause you are not shipping to other states, but most companies that ship, have to specify the tax for destination location, usually get the tax area codes and jourisdiction from companies that sell the file, and there are thousands of jourisdiction.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • navdev3navdev3 Member Posts: 32
    Ok. I have more information. The set up theave suggested will work for tax exempt customer. However, we have another layer that complicates things. Our combinations are: customer can be taxable or not, an item/gl can be taxable or not. This is the situation that complicates things: a taxable customer purchases an item/gl that normally is taxable but for some reason (legitamately) the item/gl is not taxable in this transaction. So we need to change the tax group code that is brought in from the item/gl. We especially need to be able to report on these types of transaction to the government because they'll be really interested in why we didn't collect tax. So we need to be able to change the tax group code on the fly at data entry and need it at the header form so it can be propagated to the detail lines.
  • ara3nara3n Member Posts: 9,257
    The question is how many of those transaction do you get, and is it worth the trouble to modify Navision for it. If lets say on a given month you get 1000 orders and only 10 are in that kind of senerio, then ask the user to change them on the line. The reason if you specify the tax group code on header all the lines will get that tax group code, and you mentioned that only some item/gl will not be tax liable.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • navdev3navdev3 Member Posts: 32
    My project manager tells me enough to make it worth while. They want to be able to enter 3 invoices a minute. The situation that I described is applied at the invoice level. So if it applies, the entire invoice would be non taxable even though the client is taxable and the gl/items are taxable.

    so, is there a way to access a variable that exists only in the header form (ie not on the header table) from a subform? Without using single instance code unit.
  • ara3nara3n Member Posts: 9,257
    Yes there is. I would not recomend this because Normally you would do it on the table. You have to create a function in subform called SetTaxGroup with a paramater called NewTaxGroupcode. In the subform you'll create a global variable called HeaderTaxGroup. In the fuction SetTaxGroup write the following

    HeaderTaxGroup := NewTaxGroupcode;


    Now Onaftervalidate of the item,
    if HeaderTaxGroup <> '' then
    validate("Tax Group code", HeaderTaxGroup);

    On Sales Order Form on the new text box, onaftervalidate You are going to put the following code
    CurrForm.Saleslines.SetTaxGroup(HeaderTaxGroup);

    Now you have to remember that if you close the form the text box will be blank.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.