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
0
Comments
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
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..
Here you see all variables, Functions and when press F1 the help for System functions. There is also an understandable example.
Regards
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?