Problem using SELECTSTR

shettarvikas
Member Posts: 106
Hi,
From web service, I am getting the data into navision as a string seprated by comma (as per HL 7 format),
Eg: Cutomer Id,First Name,Second Name, Address, Address 1...email
I tried to capture the values using SELECTSTR function, but the problem is when there is a null value in between 2 comma's. The above function gives run time error. And also I saw in Help file that if the 2 values are same in the string then it also gives run time error.
Please let me kow, is there any other solution or how can it be rectified.
Thanks & regards,
Vikas
From web service, I am getting the data into navision as a string seprated by comma (as per HL 7 format),
Eg: Cutomer Id,First Name,Second Name, Address, Address 1...email
I tried to capture the values using SELECTSTR function, but the problem is when there is a null value in between 2 comma's. The above function gives run time error. And also I saw in Help file that if the 2 values are same in the string then it also gives run time error.
Please let me kow, is there any other solution or how can it be rectified.
Thanks & regards,
Vikas
0
Comments
-
Hi Vikas,
You could try to use the COPYSTR function for this. I seem to recal that there is something in the Tips & Tricks forum
Edit or you could use a dataport to accomplish this
Albert0 -
Hi Albert,
I cannot use dataport, as it will take time. But using COPYSTR, can you give some more detail, like pseduocode for parsing the string..0 -
for System functions (or self defined) like copystr use the C/AL Symbol Menu (F5) :!:
Here you see all variables, Functions and when press F1 the help for System functions. There is also an understandable example.
RegardsDo you make it right, it works too!0 -
Thanks for the info. It worked0
-
Hi,
i also had the same problem with SELECTSTR. I made a loop that replaces null values with spaces and this solved it. But now I have a new one:
when I have string like this: test1,-1,test2,test3,etc..
and I process it with the following code:
Txt := test1,-1,test2,test3,etc.. ;
Txt1 := SELECTSTR(1,Txt);
Txt2 := SELECTSTR(2,Txt);
Txt3 := SELECTSTR(3,Txt);
Txt4 := SELECTSTR(4,Txt);
The following error occurs: parameter 2 invalid for function SELECTSTR, etc...
What seems to be the problem here? -1 is the second value in a comma seperated string so I would expect it to run fine. The other strange thing is that this code ran fine for a few days and that strings containing -1 were processed correctly (and I am absolutely sure of this). Nothing has changed in the past few days, but today this error occurred. Can anyone explain this please?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