Linking field from one form to another..

yuppicideyuppicide Member Posts: 410
edited 2009-11-12 in Navision Attain
Using Navision 3.10.

I've went into a Table and added a field called "Standard Discount" which is text, with a maximum of 3 characters.

I've then went into my Form for Customer Card and added a label and textbox to make the above Standard Discount show up.

That part works fine and will save us time. This way we can easy see if the customer normally gets a discount from us without having to go in and read through all the Customer Comments.

Now, I'd also like this to show up on another Form which is for our Sales Orders. I don't want it to print on the Sales Order when I hit print. Just show up on the screen so we can see it when we're entering the order.

How would I go about linking the two? I do not have access to view C/AL Globals or Code on Forms unfortunately, only on Reports. I have tried giving a source expression as "Standard Discount" and giving it a Table Relation, but was unable to figure out how to get that to work.

I'd like to do this myself if possible because I highly doubt the company will spend money to get our Nav Partner to do this.

Thanks.

Comments

  • DenSterDenSter Member Posts: 8,307
    The easiest way to do this would be to add the same field to the Sales Header table (not editable), and then some code to the Sell-to customer validation code to populate it when the customer is selected. You need access to the C/AL editor in the table designer though. You could add a lookup flowfield to the sales header table, but you'd need to have access to the validation code to do a CALCFIELD for it in the validation code either in the table or the form to be able to see it right when a customer is selected. Without the CALCFIELD it would still work, you would just have to save the order before it shows up in the form.
  • SavatageSavatage Member Posts: 7,142
    I believe what you are saying is that when you are entering a sales order - you would like to see the value that has been assigned on THAT customer's card, not just linking this table to the sales order - correct.

    It's so simple if you can get to the code but since you can't then this is not possible, unless you want to use a flowfield . The only other suggestions would to use another field or an unused field that exists on the sales order header as well as the customer card. perhaps dimensions if you're not using them for anything particular.

    Or get a developer - to make the change for you on a one time pay basis.
  • SavatageSavatage Member Posts: 7,142
    When you say "A table" did you mean you simply added a new field to the customer table? for some reason I was thinking you has some other table holding that field and you were showing it on the custmer card as a lookup.
  • yuppicideyuppicide Member Posts: 410
    Okay two things..

    On Table 18 Customer I've added a field for Standard Discount. Then I went into Form 21 Customer Card and made it show that field. Now on Report 50000 which is our Sales Order is where I wanted it to show up. When you enter a new Sales Order you first select a customer. When you do, all those fields get automatically populated. I'd like one to populate for this "Standard Discount" as well, taking the information from the Table.

    I've located some documents from our partner. 99% of them are in reference to using basic functions in Navision, but one is about the Object Designer. There's 3 pages on FlowFields I am reading.

    As reading this I seem to need a FlowField that does a Lookup from another table..

    It states
    There are two properties that need to be changed in order to define this field as a FlowField.
    The first property is the FieldClass property. Change this field to FlowField."

    This I can do fine. Then it says
    The second property is the CalcFormula property. This property will define what field will populate this field and how it will be calculated.

    I have no clue where to find CalcFormula property. They quickly mention something about updating a FlowField, you must use the C/AL function <Record>.CALCFIELDS.

    In the example they showed how to create a new table of Ledger Entries and make that flow into an already existing Test Customer Table into the Amount field.
  • SavatageSavatage Member Posts: 7,142
    for the report - on the Sales Header section onaftergetrecord if you do a

    Customer.GET("Sell-To Customer No.");
    you will then be able to add a text box in a section with sourceexp "Standard Discount" and it will appear.

    To make is show on your Sales Order Form (Header)
    Add a new field to the sales Header "Standard Discount" same TYPE & SIZE you used to create in in the customer table.
    Then view the properties of that field
    The FieldClass = FLOWFIELD
    The CalcFormula = Lookup(Customer."Standard Discount" WHERE (No.=FIELD(Sell-to Customer No.)))

    Now add the "Standard Discount" Field to the Sales header card & when you enter the Sell-=to customer name - it will show the value of that field for that particular customer no.
  • yuppicideyuppicide Member Posts: 410
    Messed that last post up. I'm trying to add the Standard Discount thing to a FORM.

    I think I might contact my partner and re-ask about this. Based on the documentation I found, maybe I should be allowed to do what I need.
  • SavatageSavatage Member Posts: 7,142
    What part is confusing you. I tested this and it works fine.

    I understand you want to add a field to the sales header FORM but you need to create a new field in the 50000+ range to accept the value you will be getting from the customer table.

    Customer Table - Create a new "Standard Discount" field
    Customer Form -> Add the field to the form.
    Sales Header Table - Create a new "Standard Discount" field
    Sales Header Form-> Add the field to the form.

    Changing the properties of the Sales Header Field to a flowfield lookup will only take the value stored in the customer table and display it on the sales header.

    I will gladly print screen step by step instructions if you need them & post it.
  • SavatageSavatage Member Posts: 7,142
    Here ya go.
    http://savatage99.googlepages.com/Flowf ... xample.pdf

    No special License needed. Note this is for visual purposes. You're not using it for any calculations correct?
  • yuppicideyuppicide Member Posts: 410
    Wow! Thank you so much. No, I am not using it for calculations. It'll only be to display the message.

    I am going to wait until 5pm when everyone is leaving for the day or tomorrow morning to give this a try.

    I followed along just fine and got an error message when I tried to go in Sales Orders. I had to remove it from Sales Header temporarily.
    Savatage wrote:
    Here ya go.
    http://savatage99.googlepages.com/Flowf ... xample.pdf

    No special License needed. Note this is for visual purposes. You're not using it for any calculations correct?
  • SavatageSavatage Member Posts: 7,142
    good luck - don't forget to post the error message if you get one.

    Basic steps, add same field to two tables, add same field to two Forms, change the properties of sales order field to lookup flowfield.
  • SavatageSavatage Member Posts: 7,142
    Extra Bonus - I read about your 1.8ghz pc on the other forum.

    If your company thinks cheap (& we do too) try
    http://www.intechraoutlet.com/home/sear ... bin_id=web

    Dell OPTIPLEX GX280
    Pentium 4 - 3.6GHz
    80GB HD SATA
    CD-RW DVD Combo
    1GB RAM
    Fast Ethernet (100Base-X) Network Adapter
    Sound Card Included
    Video RAM:32 MB VRAM (Card)
    Price: $162.25

    You supply the software. 8)
  • yuppicideyuppicide Member Posts: 410
    Thanks for the link! I only wish you could see the "condition class" on that main page, but it's okay most of them are C which is decent condition.
  • yuppicideyuppicide Member Posts: 410
    Going to wait until the office is on lunch today.

    Below you say add to two tables and two forms. Don't you mean one form? Just Sales Order form where I want it? Instructions I have are for one form.
    Savatage wrote:
    good luck - don't forget to post the error message if you get one.

    Basic steps, add same field to two tables, add same field to two Forms, change the properties of sales order field to lookup flowfield.
  • SavatageSavatage Member Posts: 7,142
    The condition of the PC's are pretty good! we have a bunch here - no problems - also comes with keyboard & mouse.

    If you don't add it also to the customer card then how will you enter data? (PS It's probably already there - you added it)
  • yuppicideyuppicide Member Posts: 410
    I got it to work. I must have entered something wrong when I did the lookup flowfield yesterday is why I got the error.

    I made the one on my Sales Order non-editable. The only thing I can't figure out is how to make it not have an arrow next to it. You know where you click the arrow and it opens up. Those two Special Instructions boxes above it have no arrow when you click in them.

    Screen shot:
  • SavatageSavatage Member Posts: 7,142
    It's a lookup that's why you have the arrow.
  • yuppicideyuppicide Member Posts: 410
    Ahh.. got it..good enough. I'll just tell people not to use it. It pulls up information on that Customer such as outstanding amount, etc.
    Savatage wrote:
    It's a lookup that's why you have the arrow.
  • yuppicideyuppicide Member Posts: 410
    Earlier you guys helped me make a Discount Comment on the customer card that only shows up on sales header, but does not print. Have a similar situation to the above, but want it to print.

    I can't find if we discussed this or not or if my license won't allow me.

    Let's say I've made a new textbox called "Invoice Instructions" on the customer card. I've already set it up.

    I want that field to print on my Picking Sheet.
Sign In or Register to comment.