Flow fields

Hello,

I apologize for the confusion in advance. i am not very good at explaining situations. if somtehing is not clear, please let me know.

I have a custom field called weight in kit bom lines that is populated manually by the user. when the user enters the value, it is calced and displayed in bom journal lines (bom journal line is the main form and kit bom lines is the subform) as flowfield. this part is working out fine.

when the user is done populating the weight for all the child components (kit bom lines has multiple child components listed for the parent item), i need to check total weight of the componenets against the total weight of the parent item and make sure it doesnt go over. my error works fine but it doesn’t allow me to change the weight in kit bom lines. it seems to remember the old weight and keeps displaying the error over and over.

I guess i need to find out how to let the system allow to make user change the value in wieght field and then run the check with new value.

Jolly

Hi Jolly,

If i get this right, your problem is that you have created a check-function, that checks the value of the flowfield (located in BOM Journal Line) against another field also in BOM Journal Line, but this function seems to run with the old value instead of the newly entered.
Am i correct?

The easiest thing would be to create some kind of release-button, that the user has to press, in order to run the check-function.
But of course the smoothest thing would be to have this check called from a trigger.

Can you tell me where the function is called from now?
Also i would like to know where the function it self is created (function on BOM Journal Line table or what)

Hi.

Could it be useful that when the user is entering the child component weights, that the CHECK function is run each time and stops the user from exceeding the parent items total weight? “Prevention is better than cure” scenario. [^o)]

If not, then maybe you could post the CHECK function code and it may help us to better understand why it wont allow you to change the value.

Hope this helps.

Pass the “Parent Item Weight” to the subform using a function. Then when the user enters a “Child Component Weight” use CalcSums to get the total child component weight and compare it to the “Parent Item Weight”. You will need to pass the “Parent Item Weight” when it is changed by the user or a new record is selected.

Now that I’ve had more coffee:

You don’t need to pass the value. You can retrieve it from the “kit bom lines”.

Add a function to the “Kit bom lines” table. The function should do the following:

  1. Retrieve (GET) the “Parent Item”

  2. Sum the weight of all related child components

  3. Compare the sum with the parent item weight.