Notify user if price is 0 or empty

Hello there

Not sure if this is a beginners question but we’ll find out along the way :slight_smile:

Basically, i wan’t the user who fills in a sales order to be noticed when a price is set to 0 or when there’s no price at all for that product.

They’ll have to receive a messagebox with a notice, for example “no price set for this article”, and have to press confirm or OK.

Does anyone has a code snippet for this situation?

Thanks in advance.

Hi Dave,

You will have to add code to the form. I would recommend in the onaftervalidate trigger of the quantity and/or No. fields.

You can use

TESTFIELD( “Unit Price Excl. VAT”, 0 );

or for a better mesage

if “Unit Price Excl. VAT” = 0 then

message( Text0001 );

wher Text0001 is a text constant for your message

Dave,

Is the “Unit Price Excl. VAT” a pre-defined variable?

I remember once meeting with a new client, and a discussion with someof the users. They generally concurred that they hate Navision because its so hard to use. I asked for an example, and they said it was impossible to enter big orders with lots of lines in the system becasue of all the random messages that pop up warning about prices and margins and authorized items etc. I did point out that none of these were Navision features, but customizations that THEY had requested their partner to do for them.

My advise on this one is to rethink the whole thing and start again. Analyze the requirement, instead of just trying to convert meeting notes into code.

Take a look at my blog, it may help…

http://dynamicsuser.net/blogs/singleton/archive/2008/10/30/the-most-powerful-tool-that-a-dynamics-nav-consultant-can-use.aspx

First of all,

I’m not a partner but an end-user.

Secondly

We’ve been using this system with the waring at our previous ERP system for 15 years now.

I think it’s highly unlikely people will start get irritated by it now.

I do respect your remark, but i think it is suitable for us to apply this small piece of code.

That is exactly what I assumed. these cases are normally instigated by the end user.

Good lukc with the implementation (you will need it). [:’(]

So why are you changing systems? [:D]

Just so you are aware I thought your reply read as aggressive for a reply that was simply trying to advise you on a best practice approach before you have modified the system to annoyance level for the end user also causing additional cost and issues with upgrades. It was a suggestion to evaluate, you could have replied thanks you had done this and it is needed because of our poor business practices on new product release/pricing roll outs etc.

The forum is here to help, so enjoy the help, otherwise it might not be so forthcoming!

I think my tone got a bit off because of our language differences,

I truly appriciated the remark about the messages popping up.

i just know our company will ‘earn’ money by adding this check.

Please accept my apologies if i sounded a bit rude.

Hi Dave, The guys here raise some valid points, there is a lively discussion in the community about data entry at the moment, but for a different reason (RTC), so its a topic of interest. To get the best of both worlds, I would recommend that you add the code on the “Sales Header Release” function. This function is called automatically if you try to post, or the user can call it manually (Ctrl+F11, of functions key). For the very reason David describes here (data entry) I try to always limit the code to the Release function. Pros - User can enter away with the key strokes they so love. Errors still caught Cons - Not validated at the time the user is focused on the field. Just my input… t

Hi Dave,

Sorry this is the caption it should be “unit price” from the sales line. Of course you will need a developer licence so you will (probably) have to involve your local partner.

I guess you could be the exception, I just doubt it. [;)]

My specialty in Navision is recovering implementations gone wrong, an its amazing how often I see pop ups, and the client needs me to show a way to remove the pop up and give them something more efficient because of how much pop ups are costing them.

lets hope you are the exception, and that this works for you.

There’s always the Bold & Red method - so not pop-up happen

OnFormat(VAR Text : Text[1024]:wink:
IF “Unit Price” = 0 THEN BEGIN
CurrForm.“Unit Price”.UPDATEFORECOLOR(255);
CurrForm.“Unit Price”.UPDATEFONTBOLD(TRUE);
END;

[;)]

I’ve tried your solution but the problem is that the 0 is not showing if the price is unknown.

It just shows a blank field for price so i guess it can’t color anything.

You need to change the “BlankZero” property off on the field on the form. t