Color Change For Credit Memo's

Savatage
Member Posts: 7,142
When I pay a Vendor I go to the Payment Journal,
Enter the vendor #, blah blah & hit apply entries.
In which all that vendors OPEN enties appear.
I hit f9 to select which Invoices & credits I want to Pay & Use.
Some Vendors Have A ton of Entries. How can I make the Apply Vendor Enties Form show the credits in red?
01/01/01 - Invoice - 200
01/02/01 - Invoice - 201
01/03/01 - Invoice - 202
01/01/02 - Credit - 100
01/04/01 - Payment - 150
Enter the vendor #, blah blah & hit apply entries.
In which all that vendors OPEN enties appear.
I hit f9 to select which Invoices & credits I want to Pay & Use.
Some Vendors Have A ton of Entries. How can I make the Apply Vendor Enties Form show the credits in red?
01/01/01 - Invoice - 200
01/02/01 - Invoice - 201
01/03/01 - Invoice - 202
01/01/02 - Credit - 100
01/04/01 - Payment - 150
0
Answers
-
OK if I put it on
OnFormat(VAR Text : Text[1024];)CASE "Document Type" OF "Document Type"::"Credit Memo" : CurrForm.Amount.UPDATEFORECOLOR(255); "Document Type"::Payment : CurrForm.Amount.UPDATEFORECOLOR(32768); ELSE CurrForm.Amount.UPDATEFORECOLOR(0); END;
But How Can I Get The Whole Line To Be colored Without having to put this code on every field?
Code Above Makes
Credit=Red
Payment=Green0 -
Savatage wrote:[...] But How Can I Get The Whole Line To Be colored Without having to put this code on every field? [...]No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Savatage wrote:[...]
But How Can I Get The Whole Line To Be colored Without having to put this code on every field?
[...]
You can make it easier if you put your code in a function and only calls the function in the OnFormat-Trigger. This function then returns the color value.
OnFormat(VAR Text : Text[1024]):CurrForm.YourControlName.UPDATEFORECOLOR(SetForeColor);
SetForeColor() : IntegerCASE "Document Type" OF "Document Type"::"Credit Memo" : EXIT(255); "Document Type"::Payment : EXIT(32768); ELSE EXIT(0); END;
Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Luc Van Dyck wrote:Savatage wrote:[...] But How Can I Get The Whole Line To Be colored Without having to put this code on every field? [...]
That's what I was Afraid of. Oh Well.0 -
out of all the changes I have made in Navision - this one has gotten one of the best responses.
I've added it to several forms and even did the little
if unit price = 0 change to red on sales orders thing.
I guess when staring at a screen for 8 hrs a day - little changes like this really make the users happy.0 -
hi,
sorry for reactivate this :roll:
How would the code look like if I would like to have unit price = 0 in the sales line ?0 -
-
Thanks,0
-
Now we're allowed to add images0
-
-
Unfortunately Endless Beauty is out of business0
-
Savatage wrote:OnFormat(VAR Text : Text[1024];)
CASE "Document Type" OF "Document Type"::"Credit Memo" : CurrForm.Amount.UPDATEFORECOLOR(255); "Document Type"::Payment : CurrForm.Amount.UPDATEFORECOLOR(32768); ELSE CurrForm.Amount.UPDATEFORECOLOR(0); END;
Debugger is pointing at ELSE... I was just trying to use this as a starting point to play around with this and I immediately got nailed with this error I don't understand.
I put this in the OnFormat(VAR Text : Text[1024];) of Document Type of Customer Ledger Entries, not Amount.0 -
AlexWiley wrote:Savatage wrote:OnFormat(VAR Text : Text[1024];)
CASE "Document Type" OF "Document Type"::"Credit Memo" : CurrForm.Amount.UPDATEFORECOLOR(255); "Document Type"::Payment : CurrForm.Amount.UPDATEFORECOLOR(32768); ELSE CurrForm.Amount.UPDATEFORECOLOR(0); END;
You have to change your code slightly for each column you want to change
for example for the "Document No" column you would put this:OnFormat(VAR Text : Text[1024];) CASE "Document Type" OF "Document Type"::"Credit Memo" : CurrForm."Document No.".UPDATEFORECOLOR(255); "Document Type"::Payment : CurrForm."Document No.".UPDATEFORECOLOR(16711680); ELSE CurrForm."Document No.".UPDATEFORECOLOR(0); END;
For Posting Date this:OnFormat(VAR Text : Text[1024];) CASE "Document Type" OF "Document Type"::"Credit Memo" : CurrForm."Posting Date".UPDATEFORECOLOR(255); "Document Type"::Payment : CurrForm."Posting Date".UPDATEFORECOLOR(16711680); ELSE CurrForm."Posting Date".UPDATEFORECOLOR(0); END;
etc etc0 -
Yar, I can't believe I missed that, I got focused on 'CASE "Document No." OF and thought that was the call, I didn't even pay attention to the CurrForm call. Thank you Savatage, works perfectly now!0
-
Hy All,
I read this topic, but I couldn't do line color change.
I understand the code, but in case sales line color, where have to write the code?
I couldnt find it!
thx0 -
It's pretty clear if you back over the posts that the ON FORMAT trigger of the FORM is where the code goes.
You have to put the code on every field you want to change - it will not do the whole line in one shot (I Know ](*,) )
the only thing you have to change in the code as you go field by field isto change this part.
CurrForm.Amount.UPDATEFORECOLOR(255); <<-- Use this on the Amount Field
CurrForm."Posting Date".UPDATEFORECOLOR(255); <<--You would alterthe code to this if you are putting on the posting date field
CurrForm."Document Type".UPDATEFORECOLOR(255); <<--You would alterthe code to this if you are putting on the document type field
CurrForm."ETC, etc etc etc".UPDATEFORECOLOR(255);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