Vendor/Customer Name on G/L Entries Table

AEL
Member Posts: 12
I am a new user of Navision and have a really easy question (I hope!).
Does anyone know how to show the customer/vendor name on the g/l entries table?
I can get the customer/vendor number to show against the entries (using source no.) but not the name.
Thanks!
Does anyone know how to show the customer/vendor name on the g/l entries table?
I can get the customer/vendor number to show against the entries (using source no.) but not the name.
Thanks!
0
Comments
-
AEL wrote:I am a new user of Navision and have a really easy question (I hope!).
Does anyone know how to show the customer/vendor name on the g/l entries table?
I can get the customer/vendor number to show against the entries (using source no.) but not the name.
Thanks!
Add flowfields (one for costumer and one for vendor name) or add custom function to table, which will return the source name.
Bostjan0 -
that would be the easiest way to do it!
But not the best (imho).
Better to create one new field "name text 30" which is filled with either the customer name or the vendor name.
Thing is that's pretty difficult to fill this field if you are a beginner.
So if you wanna know, post a reply"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
I wanna know, please.0
-
Me too!0
-
You will need to to add a new field to the "GL Entry" table eg "Source Name" Text 30 or if Attain then Text 50.
In CodeUnit 12 "Gen. Jnl.-Post Line" you will need to add this code to the end of Function 'InitGLEntry'Case GLEntry."Source Type" of GLEntry."Source Type"::Customer: If Cust.GET(GLEntry."Source No.") THEN GLEntry."Source Name" := Cust.Name; GLEntry."Source Type"::Vendor: If Vend.GET(GLEntry."Source No.") THEN GLEntry."Source Name" := Vend.Name; GLEntry.Source Type"::"Bank Account": If Cust.GET(GLEntry."Source No.") THEN GLEntry."Source Name" := BankAcc.Name; GLEntry."Source Type"::"Fixed Asset": If Cust.GET(GLEntry."Source No.") THEN GLEntry."Source Name" := FixAsset.Description; END;
This covers all the Source Type Options. You might have to declare a variable for the FixAsset Table.Answer the question and wait for the answer.0 -
Thanks Stephen - I think that explains my problem then. My company has not bought the licence to the codeunits.
I can access the C/AL coding behind reports but not on forms or tables.
Any suggestions (other than buy the licence!)0 -
In the form or in the report
Create un variable Text lenght 30
In the trigger "OnAfterGetRecord" put this code
if recVendor.get(TableEntry."Vendor no.) then
txtvar:=recvendor.name
else
txtvar:='';
After display the variable.0 -
Hi AEL
You can still use the basics of the code i posted on forms (OnAfterGetRecord) or Reports (OnAfterGetDataItem) triggers.
You'll just have to create a Variable SourceName Text 30 or 50 and possibly variables for The Cust,Vend... Tables, don't forget to clear the variable first.Answer the question and wait for the answer.0 -
I would recommend you use StephenG's code to fill a variable on the forms on which you want the cust./vendor-name displayed. Putting the info directly into the various ledger entry tables would result in a LOT of extra data that you really don't need
Create a variable on a form. Fill it according to StephenG's code and put a textbox on the form showing the variable you created. Put the code on AfterGetRecord and be sure to start it with clearing your variable.Best regards
Tommy0 -
There are 2 bugs in code:
Case GLEntry."Source Type" of
GLEntry."Source Type"::Customer:
If Cust.GET(GLEntry."Source No.") THEN
GLEntry."Source Name" := Cust.Name;
GLEntry."Source Type"::Vendor:
If Vend.GET(GLEntry."Source No.") THEN
GLEntry."Source Name" := Vend.Name;
GLEntry.Source Type"::"Bank Account":
If Cust.GET(GLEntry."Source No.") THEN
GLEntry."Source Name" := BankAcc.Name;
GLEntry."Source Type"::"Fixed Asset":
If Cust.GET(GLEntry."Source No.") THEN
GLEntry."Source Name" := FixAsset.Description;
END;
First Cust should be replaced with BankAcc
Second Cust should be replaced with FixAsset
The code should then look like this:Case GLEntry."Source Type" of GLEntry."Source Type"::Customer: If Cust.GET(GLEntry."Source No.") THEN GLEntry."Source Name" := Cust.Name; GLEntry."Source Type"::Vendor: If Vend.GET(GLEntry."Source No.") THEN GLEntry."Source Name" := Vend.Name; GLEntry.Source Type"::"Bank Account": If BankAcc.GET(GLEntry."Source No.") THEN GLEntry."Source Name" := BankAcc.Name; GLEntry."Source Type"::"Fixed Asset": If FixAsset.GET(GLEntry."Source No.") THEN GLEntry."Source Name" := FixAsset.Description; END;
®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
:oops: Ooops :oops:
Remember to check code at least twice when typing on the fly, especially when using copy and paste.Answer the question and wait for the answer.0 -
Don't be :oops: . It's common to all of us who think faster then type. If it would be oposite, you could be the blond sitting and smileing in front of boss' office...®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯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