Case Of and option Field
pjfilipe
Member Posts: 10
When trying to execute the following code:
CASE SalesHeader."Document Type" OF
SalesHeader."Document Type"::Order,SalesHeader."Document Type"::Quote:
BEGIN
I get the followin error:
"Type conversion is not possible because 1 of the operators contains an invalid type. Option t_testcas Boolean"
Anyone knows what´s wrong in this expression.
CASE SalesHeader."Document Type" OF
SalesHeader."Document Type"::Order,SalesHeader."Document Type"::Quote:
BEGIN
I get the followin error:
"Type conversion is not possible because 1 of the operators contains an invalid type. Option t_testcas Boolean"
Anyone knows what´s wrong in this expression.
0
Comments
-
The structure should be something like this
CASE SalesHeader."Document Type" OF
SalesHeader."Document Type"::Order : x statement;
SalesHeader."Document Type"::Quote : x other statement;
END;0 -
CASE SalesHeader."Document Type" OF SalesHeader."Document Type"::Order, SalesHeader."Document Type"::Quote: BEGIN
There's nothing wrong so far. It must be something to do with your next section of code as Navision will quite happily allow you to write different options values before the Colon so long as they are seperated by a comma.
What are your next few lines of code ????Remember: Keep it simple0 -
CASE SalesHeader."Document Type" OF SalesHeader."Document Type"::Order, SalesHeader."Document Type"::Quote: BEGIN IF Archive.CheckSalesVersion(SalesHeader) THEN BEGIN Archive.StoreSalesDocument(SalesHeader,TRUE); CALCFIELDS(SalesHeader."No. of Archived Versions"); IF SalesHeader."Bill-to Contact No." <> '' THEN SegManagement.LogDocument( 3,SalesHeader."No.",SalesHeader."Doc. No. Occurrence", SalesHeader."No. of Archived Versions",DATABASE::Contact,SalesHeader."Bill-to Contact No." ,SalesHeader."Salesperson Code",SalesHeader."Campaign No.",SalesHeader."Posting Description") ELSE SegManagement.LogDocument( 3,SalesHeader."No.",SalesHeader."Doc. No. Occurrence", SalesHeader."No. of Archived Versions",DATABASE::Customer,SalesHeader."Bill-to Customer No.", SalesHeader."Salesperson Code",SalesHeader."Campaign No.",SalesHeader."Posting Description"); END; END;
This is the complete code statement.
The problem is in the CASE statement, if I change it to an IF statement works good.
It also seems very strange to me.
Thanks for your help.
Paulo0 -
Hi Paulo,
bit too keen with the "Begin" statements
Try this:END ELSE SegManagement.LogDocument( ........your code continued......
Hint:
Try indenting your second begin statement another level. This will help you to track your begin-end statements.
DeanRemember: Keep it simple0 -
Missing one END statement. CASE OF also must finish with END;0
-
Thank you very much
Paulo0 -
what about use this:
IF SalesHeader."Document Type" IN [SalesHeader."Document Type"::Order,SalesHeader."Document Type"::Quote] then begin
... ?
:idea:Martin Bokůvka, AxiomProvis0 -
what about use this:
Code:
IF SalesHeader."Document Type" IN [SalesHeader."Document Type"::Order,SalesHeader."Document Type"::Quote] then begin
... ?
that is another possible option, but I guessed that Paulo is not an experienced developer and I thought the other way might be easier ????Remember: Keep it simple0 -
You are right I'm new to C/SIDE,
give me some more time and I hope to be helping instead of asking for help.
Best Regards
Paulo0 -
pjfilipe wrote:You are right I'm new to C/SIDE,
give me some more time and I hope to be helping instead of asking for help.
Best Regards
Paulo
good luck :-) navision is easy to learn but hard to maintain :-)Martin Bokůvka, AxiomProvis0
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
- 327 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
