Error when adding a new company

elwin68
Member Posts: 153
An error occures when doing the following:
- Open a standard CRONUS database in Navision 5.0 SP1
- Create a new company
- Select a company type
- After clicking Ok data will be imported and applied
- When applying data the following error occures:
The value General,Sales,Purchaes,Cash Receipts,
Payments,Assets,Intercompany,Jobs,,,,Cash,Bank for
SELECTSTR parameter no. 2 is not valid.
This happens at the following line (function Texttooptionvalue in codeunit 5302) when counter has the value 9:
IF UPPERCASE(SELECTSTR(Counter,OptionString)) = UPPERCASE(InputText) THEN
Is there a fix for this?
Thanks in advance.
- Open a standard CRONUS database in Navision 5.0 SP1
- Create a new company
- Select a company type
- After clicking Ok data will be imported and applied
- When applying data the following error occures:
The value General,Sales,Purchaes,Cash Receipts,
Payments,Assets,Intercompany,Jobs,,,,Cash,Bank for
SELECTSTR parameter no. 2 is not valid.
This happens at the following line (function Texttooptionvalue in codeunit 5302) when counter has the value 9:
IF UPPERCASE(SELECTSTR(Counter,OptionString)) = UPPERCASE(InputText) THEN
Is there a fix for this?
Thanks in advance.
0
Answers
-
just tried exactly the same thing and didn't get any problems, so maybe a problem with the Dutch localised version?
Anyone in the netherlands able to try this out?
Ian0 -
I have changed the language to english to but with the same error.0
-
In each country the Cronus Db is slightly different. The Db format is the same but the codebase used is different. As a consequence the code it executes to create a new company in your Cronus is different from the code it executes in mine - or at least there are some small differences.
Ian0 -
Try to change the following code in CU 5302, function EvaluateTextToFieldRef():
EVALUATE(Field.Type,FORMAT(FieldRef.TYPE)); CASE Field.Type OF Field.Type::Option: BEGIN IntVar := TextToOptionValue(InputText,FieldRef.OPTIONCAPTION); IF IntVar = -1 THEN EXIT(FALSE);
toEVALUATE(Field.Type,FORMAT(FieldRef.TYPE)); CASE Field.Type OF Field.Type::Option: BEGIN IntVar := TextToOptionValue(InputText,ReplaceText(FieldRef.OPTIONCAPTION, ',,', ', ,', FALSE)); IF IntVar = -1 THEN EXIT(FALSE);
SELECTSTR() does not work correctly with empty options. Seems like you have some empty ("Opt1,Opt2,,Opt4") option values. It's the same with the german version.
Not checked if it works with multiple missing values.Cheers
Carsten
==> How To Ask Questions The Smart Way
This post is my own opinion and does not necessarily reflect the opinion or view of my employer.0 -
Thanks for your answer.
The solution doesn't work because a option value may occure just 1 time.
The following code can help with this:
Field.Type::Option:
BEGIN
OptionText := FieldRef.OPTIONCAPTION;
OptionValue := 0;
WHILE STRPOS(OptionText,',,') > 0 DO BEGIN
OptionValue := OptionValue + 1;
OptionText := INSSTR(OptionText,FORMAT(OptionValue),
STRPOS(OptionText,',,')+1);
END;
IntVar := TextToOptionValue(InputText,OptionText);
IF IntVar = -1 THEN
EXIT(FALSE);0 -
Problem is in Dutch localization indeed.
Error occurs when importing the XML with defaults. Nav is creating Gen. Journal Templates. The XML is not specific dutch, the code in Table 80 is.
Field Type in Table 80 has the following Option String:
General,Sales,Purchases,Cash Receipts,Payments,Assets,Intercompany,Jobs,,,,Cash,Bank
The string ",,,,Cash,Bank" is added.
Do not change the Option Sting! This will give errors in other places of the application.
Try to us the following temp workaround:
Add code to Codeunit 5302 temporary.TextToOptionValue(InputText : Text[1024];OptionString : Text[1024]) : Integer IF InputText = '' THEN InputText := ' '; // >> IF STRPOS(OptionString,',,') <> 0 THEN BEGIN FOR Counter := 1 TO STRLEN(OptionString) DO IF STRPOS(OptionString,',,') <> 0 THEN OptionString := INSSTR(OptionString,FORMAT(Counter),STRPOS(OptionString,',,') + 1); // IF NOT CONFIRM('OptionString: %1\\Continue?',TRUE,OptionString) THEN // ERROR(''); END; // <<
This seems like a bug for the Microsoft Team to me!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