Boolean data type and flowfield
jsaleh
Member Posts: 6
HI All,
I am new to this forum.
Though I tried to search for my topic, but didn't quite understand the solutions proposed - probably due to my limited experience with Navision 3.7.
I have a Boolean field in my Sales Line table that I would like to bring into my Purchase Line table using flowfield.
I am establishing (or trying using calcformula) the link between Purchase Line and Sales line via Line No. field that gets copied to the Purchase Line table for every line.
I would also like to be able to modify the boolean field from the Purchase side. (Is it even possible with flow fields?)
How can I do this? I 've tried using Lookup and Exist function but no luck.
I am new to this forum.
Though I tried to search for my topic, but didn't quite understand the solutions proposed - probably due to my limited experience with Navision 3.7.
I have a Boolean field in my Sales Line table that I would like to bring into my Purchase Line table using flowfield.
I am establishing (or trying using calcformula) the link between Purchase Line and Sales line via Line No. field that gets copied to the Purchase Line table for every line.
I would also like to be able to modify the boolean field from the Purchase side. (Is it even possible with flow fields?)
How can I do this? I 've tried using Lookup and Exist function but no luck.
0
Comments
-
It is not possible to change a flowfield. There is one exeption, but that might be to complicated and has noting to do with booleans.
What is it you need? It sounds more like a c/al function geting information from the salesline and retruning some information when the value is changed on the purchase order.
PS: Welcome here and enjoy
0 -
I've read it a few times too. What is it you need to see? I'm not getting it.
Especially just linking Line No. fields.
It almost sounds like you want a check mark on a po item if a sales order exists or something??
Can you clarify.0 -
I don't think that flowfields will work. I've tried as same as what you did, but I realise I need some codings in C/AL to make it work
Rgds,
Johnson
"Camino Palmero"subscribe to:
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com0 -
I need to be able to display and control a Boolean field in the Sales Line table, called s_checked, from the Pourchase Order Form.
I gave up on flowfield. I am trying with C/AL.
I added a new Text Control to my PO line sub form, and assigned a new
Boolean variable to it.
I am able to retrieve the Boolean value and display it in the new Text Control called p_checked.
The field is editable, so when the users change/check it in the PO form, I would like to be able to update the sales line field s_checked accordingly. I am using the following code under the OnValidate trigger of the p_checked control:
SalesLine.RESET;
SalesLine.SETRANGE("Line No.","Special Order Sales Line No.");
IF SalesLine.FIND('-') THEN BEGIN
SalesLine."s_checked" := Testing;
END
The field s_checked in sales line table doesn't get updated.
I then included the following line to the above code
CurrForm.UPDATE(TRUE);
But it caused error "CurrForm.UPDATE method can not be called from here.
How would I update this field?0 -
thanks for the help there sparky.
Did u miss the line where i said i am new to this????
I wasn't born with "navision talent" unlike you I guess. I have to learn this thing, unfortunately.
Testing isn't the variable i am using in actual code. Changed it, for a reason, in the posting.
For the rest, thanks for your help guys! I have figured this one out. But I am sure I'll be back on others.0 -
-
BlackTiger wrote:
SalesLine.RESET; SalesLine.SETRANGE("Line No.","Special Order Sales Line No."); IF SalesLine.FIND('-') THEN BEGIN SalesLine."s_checked" := Testing; END
2 errors in 5 lines of code! Amaizing!
Easy my friend. You were once new to Navision as well.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Here is what I've done to tackle this:
__
Under OnAfterGetRecord event of PO Line form, I used the following code to retrieve the field from Sales Line Table:
SalesLine.RESET;
SalesLine.SETRANGE("Document Type","Document Type"::Order);
SalesLine.SETRANGE("Document No.","Special Order Sales No.");
SalesLine.SETRANGE("Line No.","Special Order Sales Line No.");
IF SalesLine.FIND('-') THEN
PriceApproved := SalesLine."Price Approved";
To write the updated value back to the Sales Line Table:
I used the following code under the OnPush event of the control:
SalesLine.RESET;
SalesLine.SETRANGE("Document Type","Document Type"::Order);
SalesLine.SETRANGE("Document No.","Special Order Sales No.");
SalesLine.SETRANGE("Line No.","Special Order Sales Line No.");
IF SalesLine.FIND('-') THEN BEGIN
SalesLine."Price Approved" := PriceApproved;
SalesLine.MODIFY;
END
__
Now sparky, feel free to suggest improvent, but spare me the russion wisdom.0 -
Don't do:
You already have all primary key values, so using GET is more efficient:jsaleh wrote:SalesLine.RESET;
SalesLine.SETRANGE("Document Type","Document Type"::Order);
SalesLine.SETRANGE("Document No.","Special Order Sales No.");
SalesLine.SETRANGE("Line No.","Special Order Sales Line No.");
IF SalesLine.FIND('-') THEN
PriceApproved := SalesLine."Price Approved";IF SalesLine.GET("Document Type"::Order,"Special Order Sales No.","Special Order Sales Line No.") THEN PriceApproved := SalesLine."Price Approved";
Same with the next piece of code, don't set filters and FIND, use GET with
the primary key values instead.0 -
BlackTiger wrote:Also, I like standards. Development standards, coding standards. Beleive me it helps me everyday very much. I like Navision standards. And, yes, field names like "f_abc_1" makes me angry, even in some "theoretical" and "test" code. Filter on "Line No." without filtering by "Document No." makes me angry too.
=D> =D> =D> ...me tooBlackTiger wrote:Yes, everyone is/was a "beginner" in something. But skipping basic manuals like DevGuide - just stupid (IMHO).
..... like e.g. read your f**** notes. yes, you're right...
...no more words...BlackTiger wrote:Also I hate current "software business" itself. Main goal now - to sell! Sell, sell, sell, sell. Nobody thinking about quality, nobody thinking about quality of developers, everybody just thinking how to sell. It's causing a lot of problems, because developers just "underexperienced" and "undereducated" because a lack of time to educate. Also there is alot of "developers" which are developers just bcos "it's cool!" and they has "bigger salary"...0 -
Thanks Daniel!0
-
You're welcome
. So much easier to just answer the question isn't it
Keep the questions coming, don't be shy, soon you will be answering them yourself. 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
- 322 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

