Im in form46(Sales Order Subform).. I want to insert a salesline and in order to do that, I have to know the SalesLine Document No.. It works fine if I hardcode DocNo
Because Im forced to..
its not enough to just enter the No. field.. If it was enough then there wasnt a problem.
If you cant answer the question, then stop replying
Anyway, I see no business requirement whatsoever to add a salesline when you're inserting a salesline on formlevel.
This looks like very bad practise (not to mention the hardcoded parts).
and will give you headaches if you implement this in a live environment.
If you think logically you'd already know why you don't get the document number in your variable.
Because salesheader is completely and utterly empty. It's just a variable of record sales header, but I bet you didn't even bother to fetch the salesheader before you've assigned it to docno. Which makes it a catch22 for you because you don't know the document number.
Anyways, I recommend to get some senior help, (if that's unavailable, then recommend hiring a consultant/company)
But please rethink your solution after you've had some more training in developing solutions in NAV 2009.
|Pressing F1 is so much faster than opening your browser| |To-Increase|
Because Im forced to..
its not enough to just enter the No. field.. If it was enough then there wasnt a problem.
If you cant answer the question, then stop replying
Wow! What a polite way to ask questions in a professional forum :thumbsdown:
As Sog says the problem seems more with the design of the solution you are developing rather than coding. Better ask for some real time help/guidance from senior colleagues/consultants.
Because Im forced to..
its not enough to just enter the No. field.. If it was enough then there wasnt a problem.
If you cant answer the question, then stop replying
I think better to say is that if you don't want help, why are you asking a question? If you are forced to then do what ever you are being forced to do, and when it crashes later, just blame the person that forced you to do it.
Today it looks like I need to close mibuso and not read any posts or I will end up with a headache.
As you see, I have hardcoded the Document No., it works fine.. But I instead of hardcoding, I want to get the Document No dynamically
Dear jaro84, it's obvious that you don't have a clue what your'e doing. A true NAV expert can never be forced into doing something that does not comply to NAV standards. A (this) forum is no place to ask questions which are allready answered a houndred times in numerous NAV docs available online. And one more advice, if an MVP answers with a question then it sure has a meaning. Just cool down and tell us the whole story.
Basically what they are saying is that if explain your biz requirement and what & why you want to do this, perhaps we can point you in the proper direction on how to handle it correctly. But using on insert at form level and hardcoding is never a good path.
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Why do you want to insert it and also in form level code?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Thats where im inserting the line..
SalesLine."Document Type" :=1;
SalesLine."Document No." := '1033';
SalesLine."Line No." := 20000;
SalesLine.Type := 2;
SalesLine."No." := '1';
As you see, I have hardcoded the Document No., it works fine.. But I instead of hardcoding, I want to get the Document No dynamically
Why do you want to do this?
As soon as you enter No. field in Subform..all the common fields will be inserted automatically..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
its not enough to just enter the No. field.. If it was enough then there wasnt a problem.
If you cant answer the question, then stop replying
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Anyway, I see no business requirement whatsoever to add a salesline when you're inserting a salesline on formlevel.
This looks like very bad practise (not to mention the hardcoded parts).
and will give you headaches if you implement this in a live environment.
If you think logically you'd already know why you don't get the document number in your variable.
Because salesheader is completely and utterly empty. It's just a variable of record sales header, but I bet you didn't even bother to fetch the salesheader before you've assigned it to docno. Which makes it a catch22 for you because you don't know the document number.
Anyways, I recommend to get some senior help, (if that's unavailable, then recommend hiring a consultant/company)
But please rethink your solution after you've had some more training in developing solutions in NAV 2009.
|To-Increase|
Wow! What a polite way to ask questions in a professional forum :thumbsdown:
As Sog says the problem seems more with the design of the solution you are developing rather than coding. Better ask for some real time help/guidance from senior colleagues/consultants.
http://ssdynamics.co.in
I think better to say is that if you don't want help, why are you asking a question? If you are forced to then do what ever you are being forced to do, and when it crashes later, just blame the person that forced you to do it.
Today it looks like I need to close mibuso and not read any posts or I will end up with a headache.
http://www.BiloBeauty.com
http://www.autismspeaks.org