My manager just sent me a mail and he wants me to implement something for him right away. But I am sorta lost. I am not sure how to begin.
Instructions:
*****Modify the No. Series table to include a new boolean field called "Used for Fixed Assets". Also, modify the Purchase Header table to include the same boolean field "Used for Fixed Assets". *****When a user selects a No. Series that has "Used for Fixed Assets" checked, then transfer the checkmark to the Purchase Header as well. If a checkmark appears in this field on the purchase header, then the purchase documents (quotes, invoices, orders) that use the No. Series that has the checkmark will be limited to selecting Fixed Asset as the line type in the line section of the document
The part in '*****' was straight forward and I completed it. I am having trouble with the part after this:
Wrote it initally in OnOpenForm(), which I later realized didnt make sense because user has to select the No. series first and once his selection is done, then i have to look if the Used for fixed asset for that no. series is checked or not. So I ended up moving it to: OnAfterGetRecord on the form (no. series), which doesnt seem to do anything (the "Used for fixed assets" does not get checked even if the no. series is checked for that field.
IF "Used for Fixed Assets" = TRUE THEN
BEGIN
PurchaseHeader."Used for Fixed Assets" = TRUE;
I am pretty sure I am missing something very stupid...
Comments
I would not do it in the form but on the table, more specifically in the OnInsert trigger of the purchase header table.
After the call to "InitRecord" I would read the NoSeries table (308) and set your boolean there.
so it will look like this:
That should do the trick,
regards,
Willy
IF "Used for Fixed Assets" THEN
IF NOT "Used for Fixed Assets" THEN
it's := not just =
keep reading those books [-o<
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanks savatage for the tip...i never knew that...
Does your customer get charged for this time?
If it wasn't for this forum would you have spent all day on this?
http://www.BiloBeauty.com
http://www.autismspeaks.org
My manager is on vacation thats why I couldn't ask him for his assistance. I am glad that you guyz are here to lend a hand. \:D/
I don't want to imply anything about this particular case, but I definitely know of cases where a client was billed for the time that the developer spent on Mibuso. The company saw this as a reasonable thing to charge out as "research".
These days developers need to be billable with in a very short time, so proper training is not really possible.
http://www.mibuso.com/donation.asp
http://www.BiloBeauty.com
http://www.autismspeaks.org
RIS Plus, LLC
Once this condition is satisfied, the system should automatically set the Type (option field in purchase line) to be set to "Fixed Assets". To do this, I wrote this onInsert trigger in Purchase header.
To me this sorta makes sense, but apparently it doesnt make sense to the system since it doesnt do anything. :-k
Why not??
Just a happy frood who knows where his towel is
Just a happy frood who knows where his towel is
Declare a local variable: PurchHeader - Record - Purchase Header
IF "Document No." <> '' THEN
BEGIN
IF NoSeries.GET("No.Series") THEN
BEGIN
PurchHeader.GET("Document Type","Document No.");
IF PurchHeader."Used for Fixed Assets" THEN
Type := Type::"Fixed Asset";
END;
END;
please see your manager and ask for some more training. I will try and help you and even try and give you the solution.
I will add notes to each step to clarify to you why I did the step.
The way to solve this issue is:
1. Create a new trigger on the Purchase Line table called for example CheckFixedAsset, this trigger should return a boolean value.
The code for this trigger should be: I created a new trigger on the table just for the purpose of central code and ease of maintenance. Forms will eventually go away, but tables will remain. If your customer wants this changed later on, you only have to change it in one place and it will work the same everywhere it is used.
2. On the all your purchase subforms (Order, Quote, Invoice, Credit Memo, Return Order) modify the existing code in the OnNewRecord trigger: into I do not like to put code on Forms, but here I have to.
3. On the Onvalidate Trigger of the Type field on the Purchase Line table add the following code: I also allowed the " " blank option to be manually entered so your customer will be able to add "Comment Lines" or blank lines.
I think this should do what is required, but please ask your manager for additional training. This will benefit you, your manager and your customers.
It does you no good when we just give you the code to problems you run in, you will not learn from this.
Let me know if you need more clarification on this.
Regards,
Willy
You cannot makes any changes in the database until a transaction has been started.
I tried applying this fix from Microsoft, but it doesnt seem to do anything. http://support.microsoft.com/kb/2250231
http://www.BiloBeauty.com
http://www.autismspeaks.org
Else it looks like you're just taking info when you need it and not helping others when they need it.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I have a quick question for willy I tried to implement what you suggested: it gave me an error at this part
It kept saying that CheckFixedAsset must be either true or false...then I tried changing the statement to CheckFixedAsset = TRUE (savatage pointed out earlier that writing true would be just redundant...so why did the system throw and error saying the true/false is missing ](*,) )...then it gave me another error saying that you cannot assign a VOID to a boolean...
Chinmoy/Willy - The biggest problem that I had with this particular task was I didn't know where to put the code initially. I mean how did you know that the code will go in OnNewRecord of the form??? What was your through process to determine that, this is the trigger the code will go in...
Willy - Even initially, when you helped me determine how to assign the boolean to true based on the no. series that was selected. How did you know that the code will go in OnValidate trigger. Because when I was initially trying to implement this, I kept trying to find a place to put the code in the No. series table itself. I spent hours trying to debug the no. series table to figure out the exact point where the information would get transfered to purchase line table, I never realzied i was looking at the wrong place to put the code...What was your through process to determine that, this is the trigger the code will go in...
sorry about the huge post...i am just trying to absorb all the knowledge and learn from my mistakes so when i face the same problem again...i would know how to solve it...
http://msdn.microsoft.com/en-us/library/dd301068
This is where the training comes in. Instead of figuring stuff out as it comes up, with proper training you would have created different types of tests & situations. Trying & using each trigger to see what & when it gets activated and what they do.
Perhaps with your free time you can try some excersizes. Knowing where to put your code is super important! As you can probably tell a huge time saver when you're not trying every trigger you an find to see if your code works there.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I disagree with this statement.
In this particular case, the customer gets what he asked for, not what they really need, but a billable solution at least, and the consultant learns a valuable lesson in life "there is such a thing as a free lunch" and is able to mark down 2 days of billable time the "manager" (and I cringe when I think to use that word to describe nverma's boss) gets the work done without having to pay for training nor does he need to pay high salaries to trained consultants and developers, and is able to bill the customer the full price (unless you think that they will deliver this to the client for free).
How many times have people been told "don't put code on forms" and yet they keep doing it, so it is nonsense to say people are learning any more. The only objective at the end of the day is billable hours.
](*,)
In the short term all those billable hours look great, but just wait a year or two down the line when they turn into free work.
The user of NAV (clients employees) are sorta slow I guess, they barely know how to use a computer, so we try to do everything in our power to customize the system so that they only have to do the essential.
Its like you tell them, press f3 and you create a new card....go to no. field and press tab...it will generate a number...those are the instructions that are give to the employees...and they are all happy with that....since most of them are not very savy.... for someone like us, its not a big deal to select type as fixed asset....but for some of the users....its not such a common thing...they ended up selecting G/L as the type...so now we have G/L entries without a fixed asset card associated with it....so that's why i was told to make it a default, so there is no room for error.
The way I have learned how to use NAV is by reading the manuals and writing the certification exams. In the manuals they don't really go through all the triggers...they only go cover the most important triggers.
I think it would be so awesome if someone could make an in-depth manual about it and explain everything with examples. I have seen some books that tried to do this, but nothing really that would blow this fish called NAV out of the water.
I think one of you guyz should write a in depth detail book about this....or it is seems like a mamoth of a task...divide between you guyz...and then publish it....i am sure ppl that are just starting out would buy it....
as an end user also it's very troubling. Most companies spend most of their time & effort on running their own company and not always focusing on the software behind it. We sometimes trust & believe this "Partner" is actually helping us, never thinking they are actually hurting us. Like, when they give us everything we ask to change without mentioning all the future problems and upgrading costs. If they tell you right off the bat that thousands of dollars can be saved, now & in the future, by doing it the Nav-Way rather then altering the entire system..then that's a good "Partner" and worth keeping.
Sorry to hijack your post nverma.
PS. there are books, tell your manager that the company should foot the bill and have these programming books in house!:
http://www.packtpub.com/books?tid=2&ava ... k_limit=30
http://www.BiloBeauty.com
http://www.autismspeaks.org
The point is you appear not not have alot of help & guidence. You shouldn't be getting it from a forum, is basically what we are saying. Your company should provide you proper training in the areas you need help in so you can provide solutions to your customers in a timely manner. I like to call it a WIN-WIN!
Inastead of a STRUGGLE -FRUSTRATION!
http://www.BiloBeauty.com
http://www.autismspeaks.org
you bring up a couple of good points and they are sometimes frustrating to me too:
People are not learning anymore: True and not true.
It is true for a lot of people that resort to these forums to get the answer, because it is easier to Google it then to figure it out themselves or invest in the proper education. However, me personally I spend quite a bit of my personal time trying to learn more about NAV by reading books about NAV, C\AL, SQL, .NET and just by trying things out in my own "play" databases. I do not see that a lot anymore.
Secondly : "The only objective at the end of the day is billable hours." Absolutely true.
But what I want to make clear is this and this is totally my personal opinion:
Yes, billable hours are essential for business, but for me, so are customer satisfaction and a decent billable ratio.
With this particular modification, and we don't know if it was a fixed bid or hourly rate, the customer could get charged over $2000 if it was an hourly rate.
I don't think the customer would be happy with that and the customer would probably get upset with NAV and not the partner.
Another example of this is that we are currently in a situation with a couple of our customers who we inherited from a partner that went out of business. These customers are highly upset with NAV because of the high customization costs they were charged. And when I look at the customization, I can understand why these customers are upset. They were charged a lot of money and it was not working. These customers were almost to the point of dropping NAV and giving NAV a bad name. And when NAV gets really bad reviews, that eventually hurts our business. Because one bad review is more powerful than 20 positive reviews.
Next we should also consider the billable ratio of this programmer. Let's assume this was a 4 hour fixed bid modification. He now has spend 16 hours on a 4 hour modification budget, that is a ratio of only 25%. Eventually him and his "manager" will be held responsible for that ratio.
I get frustrated too when people come on these forums and have a one line sentence demanding the complete code for a major modification. And like a lot of people I notice too that people are not trying anything themselves anymore. But in this particular thread I think Nverma was spending to much time trying.
But most of all I get frustrated that people allow their customers to build customization into NAV so it looks and feels similar to their "old ERP" system, instead of training the customer to use NAV as it should be used. And modifying NAV just to get a couple of billable hours in is the worst thing anybody could do.
I am sorry it became such an off-topic post, but I had to vent,
Regards,
Willy
http://www.BiloBeauty.com
http://www.autismspeaks.org
Oh and sadly this is followed by the following discussion
Consultant: "So if you wanted it to be like your old system, why did you buy Navision?"
Client: "because your sales person told us that Navision could be customized to do everything that our old systme did and they showed us how easy it is to change the code to emulate what we do now."
Consultant: ](*,) #-o :oops: :-#