I am trying to display customer name but not save. I am getting the customer name from the customer table to display it on a form which is using a different table. i don't want the name to save on this table.
can you please help me with this.
thanks
Create a function on your new table [GetCustomerName]. This function would except the value of "Customer No." from your table and return a text value of Customer.Name
Place a textbox on your form and set the source to this new function.
Lets use Form 302 Customer Entry Statistics as an example.
1. ot to Globals and add
(Var)Customer
(DataType)Record
(SubType)Customer
2.OnAftergetrecord of the form add
Customer.GET("No."); //"no." is the link from your table to cust table. can be another name, perhaps "source no." where applicable. I don't know what table you're using.
3.on the form add a textbox with sourceexp = customer.name
I used are variable and it is displaying the customer name, but when i go to the next line to display another customer name, it is displayed but the previous one disappear. I don't want them to disappear, i want them to stay.
here is the code i used
Form - OnAfterGetRecord()
Customer.GET(CustomerNo);
CustomerName := (Customer.Name);
you're using a table form not a card type form I can gather?
customer table? Thought about using a flowfield? Why so against saving the cust name in the table?
add globals
Vendor - Record - Vendor
VenName - Text - 30
On AfterGetRecord()
IF Vendor.GET("Vendor No.")
THEN venname := Vendor.Name;
Hmm but how to drop in a Vendor Name Column.
Drop In "Vendor No." again if alreay on the list - or anyfield for that matter. View the properties of that column and change sourceexp to VenName - change caption too.
Yes it is displaying the customer name, but my problem is when i tab and go to the next link to enter, when i enter the customer the name comes but the previous one disappear. I don't want thsi. how can i make all of them stay on the form but not save.
Thanks
I'm a bit confused too. I thought we were talking about a list form. What kind of form are we talking about here? A List form (displaying a scrollable list of records) or a Card Form (displaying 1 record at a time).
Its a tabular form. If you enter the customer and then hit tab, the customer name appears automatically and you tab to go to the next line, it here where once you enter another customer no. that customer appear but the first/previous one disappear.
thanks
Not clear on what you mean by "tabular" form. In NAV there are only 2 types of forms. (Actually 3 if you count Matrix form which are really a special list form.)
You seem to be describing a List form that you are tabbing thru to enter information
It's list a list form - anyway if you enter the cust number it should get the customer name. Are you setting the cust no by leaving the field/line? I do not get this disappearing problem.
I don't know but my is disapearing. The previous one is disappearing.
Form - OnNewRecord(BelowxRec : Boolean)
EmployerName := '';
I have the above code because when i go to next row/ record the previous one appear. so i did the above code to stop that. I even commented it but the previous one disappearing did not stop.
What am i doing wrong?
Its should be CustomerName. That is what is in the code. This is my mistake when i am posting it.
The table where this form is using not the customer table.
The code is on the form actually.
I am actually using CustomerName. That is what is in the code. This is my typographical error when i am posting it.
The table where this form is using not the customer table.
The code is on the form actually.
Comments
Create a variable on the form and add a textbox or whatever using the var as the source exp.
http://www.BiloBeauty.com
http://www.autismspeaks.org
can you please help me with this.
thanks
Place a textbox on your form and set the source to this new function.
1. ot to Globals and add
(Var)Customer
(DataType)Record
(SubType)Customer
2.OnAftergetrecord of the form add
Customer.GET("No."); //"no." is the link from your table to cust table. can be another name, perhaps "source no." where applicable. I don't know what table you're using.
3.on the form add a textbox with sourceexp = customer.name
4.save & compile & reopen the form
edit BB's was too fast this time
http://www.BiloBeauty.com
http://www.autismspeaks.org
IF NOT Record.GET(primary key values) THEN
Record.INIT
will prevent run-time errors if the record does not exist.
I was imagining getting the cust name at the bottom of a cust ledger entry form or something. bad to assume.
http://www.BiloBeauty.com
http://www.autismspeaks.org
here is the code i used
Thanks
customer table? Thought about using a flowfield? Why so against saving the cust name in the table?
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org
Say you want the Vendor Name on the Item List.
add globals
Vendor - Record - Vendor
VenName - Text - 30
On AfterGetRecord()
IF Vendor.GET("Vendor No.")
THEN venname := Vendor.Name;
Hmm but how to drop in a Vendor Name Column.
Drop In "Vendor No." again if alreay on the list - or anyfield for that matter. View the properties of that column and change sourceexp to VenName - change caption too.
Close - save - compile - reopen - enjoy!
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanks
On AfterGetRecord()
IF Customer.GET(CustomerNo)
THEN CustomerName := Customer.Name;
http://www.BiloBeauty.com
http://www.autismspeaks.org
Baby Steps 8)
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanks
as long as the cust no exists it should be pulling the custname.
http://www.BiloBeauty.com
http://www.autismspeaks.org
thanks
You seem to be describing a List form that you are tabbing thru to enter information
Thanks
http://www.BiloBeauty.com
http://www.autismspeaks.org
Does you from look something like the Customer List that you get when you push F5 from the Customer Card? That is a list form.
close form, open form. do not click on any column now go to the cal code.
and see if that's where you placed your code.
http://www.BiloBeauty.com
http://www.autismspeaks.org
What am i doing wrong?
:-k
are you sure of where you placed your code?
How much code is floating around? What table is this? a custom table?
go back and read read the entire post and see if you did something you shouldn't have.
http://www.BiloBeauty.com
http://www.autismspeaks.org
The table where this form is using not the customer table.
The code is on the form actually.
http://www.BiloBeauty.com
http://www.autismspeaks.org
The table where this form is using not the customer table.
The code is on the form actually.