calculate a field lenght while typing

aldarion
Member Posts: 24
hello,
I'm trying to put a message any time the lenght description of a sales line become greater than 60 characters (the description accept 100 in the database). But I don't find where navision "stocks" the variable before changing the record.
can anyone help?
I'm trying to put a message any time the lenght description of a sales line become greater than 60 characters (the description accept 100 in the database). But I don't find where navision "stocks" the variable before changing the record.
can anyone help?
0
Comments
-
i don't know any trigger which could manage something like this0
-
well I use the oninputchange trigger on the form but the rec is not modified every time you hit the keyboard so I'm a bit stuck0
-
i'd been trying all those options too whilst waiting to post and came up with no answer either.
as for Navision "Stocking" the variable the only way I could do any kind of STRLEN check was on validate. This wont help you though on the checking whilst your typing :!:
What is the reason behind the 60 characters ??? Is it that you only want to allow entry of 60 characters and then append something to the description that takes a further 40 ??? If so , you could always use a variable with max length of 60 characters and then commit this with your addition to the description field
let us know soon .Remember: Keep it simple0 -
:oops: No it is just a reason of appearance on reports. I know it's stupid and it will be much easier to modify the report layout but it seems it will be ugly and as the report is to be sent to customers. So they just want a warning telling that after that number of character some info will not be shown on the report.0
-
In that case... EASY SORTED
Make a variable that only allows 60 characters and transfer that to the Description field using the "OnAfterValidate" trigger of the field on the form.
This way no modification is needed to the description field on the table OR form and your report will look ok
or if you want to look really clever, create a new section of the report with an alternative layout. in the "onePreSection" of that section on the report do something like this:CurrReport.Showoutput(Strlen(Description)>60);
so this means you will have two sections to show line information but you can have two layouts that will format the report layout as you would like to show itRemember: Keep it simple0 -
what do you think about this solution:
- create a new dataitem (using table 2000000026 as dataitemtable) ... this dataitem should be a "child" of the dataitem with the discription
- create a new global named smalldescription or something else (type: text, length: 100)
- add a new section (type: body) for the new dataitem in your report
- code the following in onpredataitem:if strlen(description) > 60 then setrange(number,1,2) else setrange(number,1,1);
- code the following in onaftergetrecord:if number = 1 then smalldescription := copystr(description,1,60) else smalldescription := copystr(description,61,100);
- now add a field to the new section with the sourceexpr 'smalldescription'
i think this will work ... :roll: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