How to show display record on form only but not save

web
Member Posts: 102
Hi,
How can i display a record on a form and it should not be stored in the table the form writes to?
Thanks
How can i display a record on a form and it should not be stored in the table the form writes to?
Thanks
0
Comments
-
are you entering this record or are you getting it from somewhere?
Create a variable on the form and add a textbox or whatever using the var as the source exp.0 -
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.
thanks0 -
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.There are no bugs - only undocumented features.0 -
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
4.save & compile & reopen the form
edit BB's was too fast this time0 -
When retrieving record for display like this using
IF NOT Record.GET(primary key values) THEN
Record.INIT
will prevent run-time errors if the record does not exist.There are no bugs - only undocumented features.0 -
True, better to accept all possible conditions. \:D/
I was imagining getting the cust name at the bottom of a cust ledger entry form or something. bad to assume.0 -
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 usedForm - OnAfterGetRecord() Customer.GET(CustomerNo); CustomerName := (Customer.Name);
Thanks0 -
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?0 -
Where did you place the function to retrieve the name? It needs to be on the table the form is using.There are no bugs - only undocumented features.0
-
(995) 5 More BBrown - BOYEEEEEE! =D> =D>0
-
Ok example 2
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!0 -
Its the code below ok. What is wrong with it?
Form - OnAfterGetRecord() Customer.GET(CustomerNo); CustomerName := (Customer.Name);
Thanks0 -
Placing the function on the table would allow it to be re-used elsewhere. Say on a report or another form without having to replicate the same code.There are no bugs - only undocumented features.0
-
looks fine, did you try it? You can use the IF option as I used above just in case customerno doesn't always exist. You would know better.
On AfterGetRecord()
IF Customer.GET(CustomerNo)
THEN CustomerName := Customer.Name;0 -
Do you know what BBrown means by create a function?
Baby Steps 8)0 -
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.
Thanks0 -
Tab next link? I'm not sure what your form looks like anymore :-k
as long as the cust no exists it should be pulling the custname.0 -
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).There are no bugs - only undocumented features.0
-
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.
thanks0 -
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 informationThere are no bugs - only undocumented features.0 -
It is a form with columns and rows. matrix i believe.
Thanks0 -
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.0
-
My fault for mentioning matrix forms. :oops: I don't believe we are talking about a matrix form here.
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.There are no bugs - only undocumented features.0 -
are you putting your code on the c/al code of the column or the enties 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.0 -
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?0 -
When did EmployerName get into this converastion?
:-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.0 -
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.0 -
Savatage wrote: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.0 -
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.0 -
are you putting your code on the c/al code of the column or the enties 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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions