create a field that show division of two fields

Dear All,

I want to add a field in sales line table which automatically divide quantity and unit Of measure.

How should I do this?

Thanks in Progrss

How you approach this may depend on how you intend to use that “field”. First option (my preference) is to not create a field but instead a global function on the table that calculates and returns the desired value.

Option 2 would be to add the field (non-editable) and add validation logic to the “Quantity” and UOM to update the new fields value whenever they are changed. Not my usual approach.

Thanks bbrown would you please provide me the code for these two options please

Give it an attempt yourself first. You will not learn anything if you are just handed the answers. If you have problems, post what you’ve tried and what problems you have encountered. Most users on this forum have full time careers that take priority in their day. They offer some of their uncommitted time to this (and other) forums. We can be much more open to helping users that show an effort in solving the problem.

Your first step would be to decide which of those methods best fits your intended use of this value. Since I don’t know that answer, I can’t answer that question.