SUBSTRING Function - via a tempory table?

r44712
Member Posts: 40
Hi all, happy new year.
I'm trying to perform the following:
For a G/L Entry, if its G/L Account No. contains the substring 'DUM' to set a flag field accordingly. I realise that Navision doesn't have a concept of a SUBSTRING function, and frustratingly the 'DUM' sequence is not in the same place everytime (i.e. its not always the 1st three characters).
What I have done is (GLEntryTemp is defined as being a 'Tempory' variable):
This works so far as copying the record to the temporary store, and no further....
The two commented-out lines represent alternative ways that I have tried to get it working (no luck!).
SO the question is what I'm trying to do, do-able, or do I need to approach the problem differently?
Thanks for any advice!
I'm trying to perform the following:
For a G/L Entry, if its G/L Account No. contains the substring 'DUM' to set a flag field accordingly. I realise that Navision doesn't have a concept of a SUBSTRING function, and frustratingly the 'DUM' sequence is not in the same place everytime (i.e. its not always the 1st three characters).
What I have done is (GLEntryTemp is defined as being a 'Tempory' variable):
GLEntryTemp.COPY("G/L Entry"); GLEntryTemp.RESET; GLEntryTemp.SETFILTER("G/L Account No.",'%1','*DUM*'); //IF (GLEntryTemp.COUNT > 0) THEN tempFS := 'D'; //Account No.s containing 'DUM'.... //IF GLEntryTemp.FIND('-') THEN tempFS := 'D'; IF NOT(GLEntryTemp.ISEMPTY) THEN tempFS := 'D'; END;
This works so far as copying the record to the temporary store, and no further....
The two commented-out lines represent alternative ways that I have tried to get it working (no luck!).
SO the question is what I'm trying to do, do-able, or do I need to approach the problem differently?
Thanks for any advice!
0
Comments
-
-
Job's a good'un - thanks. \:D/0
-
A completely different possibility:
If you want to create DUMMY-accounts, why not create a new toggle "Dummy Account" in the G/L Account table and set that flag for your dummy accounts? That solution is, I think, a lot better. Like this you can use anything for your account No.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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