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!
0
Comments
Add flowfields (one for costumer and one for vendor name) or add custom function to table, which will return the source name.
Bostjan
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
If it was hard to write, it should be hard to understand."
In CodeUnit 12 "Gen. Jnl.-Post Line" you will need to add this code to the end of Function 'InitGLEntry'
This covers all the Source Type Options. You might have to declare a variable for the FixAsset Table.
I can access the C/AL coding behind reports but not on forms or tables.
Any suggestions (other than buy the licence!)
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.
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.
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.
Tommy
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:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Remember to check code at least twice when typing on the fly, especially when using copy and paste.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯