Sorry to bother you guys again. But I have another question. This is what I have to do: -
The Health Card No. appears on BOTH the Job and Consumer Cards. So which do we use? As always, exercise caution and assume nothing. Here’s what you should do: If the Job card has a Health Card No. defined, then retrieve it from there. If it doesn’t, then check the Consumer Card. If the Consumer Card does, then show that value. Otherwise, leave the Health Card No. column in the report as blank, but show the rest of the info anyway (as I mentioned above).
HealthCard is a variable I created which is of type text.
This is the code I wrote for it: -
IF Job."Health Card No." <> ' ' THEN
HealthCard := Job."Health Card No."
ELSE
HealthCard := Customer."Health Card Number";
How do I get the report to go through this code for every single Job No. and to display the result accordinly.
Answers
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I wrote this code after reading the instruction that I posted in the first post.
If your dataitem is job you'll have to use Customer.GET(.....) before Customer."Health Card Number";
Now you could either use it before all your if statments or include it with in using "then begin" instead of just "then".
http://www.BiloBeauty.com
http://www.autismspeaks.org
Right now, it just displays the Health Card No. that is in the job card. It doesnt even check the Customer Card. How do I make check customer card if the Job card is empty. and if customer card has a health card number. I want it to display that number.
http://msdn.microsoft.com/en-us/library/dd301056.aspx
We don't use jobs so I don't know the actual field names but it should be something like this
http://www.BiloBeauty.com
http://www.autismspeaks.org
if customer.get(job."Customer No.").
What are you basically trying to do???
How do you plan on getting a record from the customer table?
If you don't use GET the value you show for Customer.anything will be blank.
http://www.BiloBeauty.com
http://www.autismspeaks.org
But the part I was confused with is:-
(job."Customer No.")
Why would I need to look at Job. shouldnt it just be a primary key in the customer table such as No.
so shouldnt it look like this.
if customer.get("No.")
As i stated above, I don't use JOB's so my field names might not be correct but I would hope you were getting the idea of what field should be used.
So I typed Customer.GET(job."Customer No".) hoping that if that was not correct that you would replace job."customer no." with the JOB field that DOES hold the customer's number.
Also, in your previous post I mentioned downloading & printing the application Designers Guide.
This guide has a section on reports, how to build them, How to use GET, what the triggers do.
So this would be a very valuable tool for you and many of your problems you will be able to handle yourself.
By using GET you are telling the system which customer record to get else how would it know which customer health card number it should retrieve?
And by using IF with GET we are avoiding runtime errors.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I am still a little confused about using GET, FIND, SETRANGE, etc
I have gone over the explanations that microsoft has given for each of them numerous times, but they still didnt sink in with me completely.
Is There a PDF or any other source you guyz might know that might, shows how to use these in multiple way OR can give a better explanation for each of them...so I can get this concept.
Knowing this concept is a MUST if I want to work with NAV.
Thank you so much.
If I think about it, it does make sense. Since I am new to NAV, its taking a while to sink in.
I will definately go over this book to hammer this concept out.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Edit your first post and change the attribute to "Solved"
http://www.BiloBeauty.com
http://www.autismspeaks.org