Data Conversion from Text to Decimal!!!
Hanen
Member Posts: 281
Hello,
I have a problem to convert text to decimal, help!!!
I have a problem to convert text to decimal, help!!!
lQty:= lCdu_ADO.ReadField_TEXT(pADORecSet,'ValeurParametre');
lcontractRec.SETRANGE(lcontractRec.NAboPere,lTxt_Temp);
IF lcontractRec.FINDFIRST THEN BEGIN
lCustomerRec.SETRANGE(lCustomerRec."No.",lcontractRec."Customer No.");
IF lCustomerRec.FINDFIRST = TRUE THEN BEGIN
EVALUATE(lCustomerRec."Taux Récurrent",CONVERTSTR(lQty,'()',' '));
lCustomerRec.VALIDATE(lCustomerRec."Taux Récurrent",lQty);
lCustomerRec.MODIFY;
END;//FIN IF CUSTOMER
END;
Regards
Hanen TALBI
Hanen TALBI
0
Comments
-
Hi,
sry I dont read your code but the text to decimal problem you can solve like this:
txt = text
dec = decimalSalesLine.RESET; SalesLine.SETFILTER(Amount, txt); txt := SalesLine.GETFILTER(Amount); EVALUATE(dec, txt)
The sales line table is only one possibility! important is the field on which you filter! it must be an decimal field.0 -
May be that the decimal have different format than NAV is using? WHat is exact error?0
-
It's no surprise that you can't make any sense of it, that code looks like a big fat mess. You have to do something about your code indentation and make it easier to read. You also have to start thinking about why you would use FINDFIRST, as opposed to FINDSET or even GET.0
-
I do not understand this code:
EVALUATE(lCustomerRec."Taux Récurrent",CONVERTSTR(lQty,'()',' ')); lCustomerRec.VALIDATE(lCustomerRec."Taux Récurrent",lQty);
If lQty is text (you are using CONVERTSTR to it), why you are trying to VALIDATE the string into the decimal field? If it is decimal, why you are using EVALUATE and CONVERTSTR on it? You need to rething your code, make it clear for yourself. It seems that you have get lost in your own code (if it is your code)... :whistle:0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 329 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

