Sum Field for Job Receipt to Inventory

I am trying to add a total part costs to the Job Receipt to Inventory module. I want to add the material, labor, burden, subcontract, and material burden and put the sum in the highlighted field. All those fields are from the PartTran table.

This would be done twice, once for the inventory unit cost, and once for the actual unit cost (parts being received to inventory).

Is there any “easy” way to do this in application studio?

Should be a straight forward event with a Calculation widget.

Try this set-up:
image

image

Calculation Widget (set the binding to whatever you bound your sum/total numeric box to… I just used TransView for testing):
Initial value is zero (0).
image

Add the Operation for each of the (5) addends:
image

Preview & Test… Appears to work:
image

Thanks David,

I’m a little new to application studio and I am hung up on the binding my numeric box…

“Calculation Widget (set the binding to whatever you bound your sum/total numeric box to… I just used TransView for testing):”

Do I need to create a new table column for this (never done)? Or can you show me how your numeric box is set up?

If you don’t have time, I understand. Appreciate the help!

Sure… no problem… hopefully I can help explain without talking in circles…

Not if you don’t NEED to… depends on what you’re trying to do.

Let me ask you this… what are you doing with these calculated total values? Are you saving those somewhere for future use… or do you just want these sum values visible for easy viewing in this one user session?

If you just want them displayed on the screen, then I recommend just binding the numeric boxes to the TransView dataview. This is just a runtime temporary dataview that can be utilized during a single session. After you close the form… it goes away. So, its not for long-term storage of information (if that makes sense).

So, if you look at your numeric box properties… you can set it up something like the below:
image

TransView is the dataview and InventoryTotalCost is the dataview column… which you can name anything you want (more or less). Again, it will only exist for the duration of this one user session on this form.

But the binding is the dataview.column the value of this numeric box is tied to (bound to).

So… in your calculation widget in your event… if you hover your mouse over the EpBinding property, you’ll see the below description (some hover-texts are more informative than others)… its saying that, once all your calculations are complete… where do you want the final value to be placed? What binding? What dataview.column?

image

In this case we want the calculation final value to be place in TransView.InventoryTotalCost (again, just my made up name).

Since the numeric box is ALSO tied to that binding… the value will appear there.

The other-side of my initial question was… if you ARE saving this value somewhere for use down the road, then you may have already had a specific binding you want/need to use.

For example, if you were adding information to a UD column on your Part Record… you may have created a column like Part.MyCustomColumn_c… and you wanted to save the calculation value to that part record in that column. In that case you have a SPECIFIC dataview.column (binding) you want/need to use.

If you don’t have a specific binding you need to use… that’s when TransView comes in.

1 Like

I’ve spent about an hour and a half trying this lol. I have it exactly set up like yours (so I think).

I just want to see the total number, we don’t need it stored anywhere. I’m just tired of adding each one up with a calculator every time we do a job receipt to inventory.

image

image

image

image

This is what I’m showing in preview:

Any thoughts? I tried to change the event target to different things with no luck.

Sorry, for the slow response.

Well, your pictures above show that you set your initial value at (0)… your first operation is to add PartTran.InvMtlBurUnitCost (which in your example, is a value of (0)).

So… sorry, but i have to ask, did you set up the other four operations?

If not, a result of zero makes sense… if you DID set up the other 4 operations and you’re still getting zero, then we can start looking at the debugger and see what we may have missed.

I had 5 operations all being “+” and still getting zero. I wonder if for some reason the event isn’t triggering.

OH… did you enter a quantity for the transaction in the form? That could be why you’re not seeing a value in the Costs tab.

Let’s walk through debugging and you can compare yours to mine. This could be a nice example of using the debugger for planning events… in this case, it’ll help determine the best TRIGGER to use for our event.

Keep in mind the TRIGGER I initially used was After - ColumnChanged_PartTran_ActTranQty

Here’s a post from Expert’s Corner that details how the debugger works, but I’ll walk through it below as well with screen grabs from this particular test:

Preview your layer…

At any point once your new browser tab opens, click F12. This opens the debugger.

You want to be in the Console tab, and hit Ctrl+Alt+8, this should toggle on/off the debug logging. You want this to be true. If Ctrl+Alt+8 doesn’t work, you can type the following in to your Console prompt: epDebug.toggleMetaFxLogging

image

When you enter a job number on the form, a bunch of events fire off in sequence, and you can see the details in the Console pane.

Guess what… I don’t see a total sum value either!!!

If you scroll through the events that fired in the Console pane… you don’t see our event taking place. BUT… remember our event was supposed to trigger After - ColumnChanged_PartTran_ActTranQty. And we never changed the value of the PartTran.ActTranQty.

So, if I got back to my form, and enter a transaction quantity:
image

Then look back at the Console… a bunch of new events fire…

I can now see the ColumnChanged_PartTran_ActTranQty event fired. Now, IN that event, a few other events also fire off. But once they’re done (after the complete PartTran_ActTranQty event), I now see my test event fire:

And it gives nice detail.

It shows the epBinding of the event, and then walks through the operations. I see all (5) of my values that are being added together, and the bottom line shows that the epBinding of TransView.InventoryTotalCost now holds a value of 590.76.

And if I click back on the Cost tab, that’s what I see.

2 Likes

So, the next question (assuming you’re now getting a value)… perhaps the TRIGGER I initially selected wasn’t ideal. We shouldn’t HAVE to enter a quantity just to see the results of the sum. So, let’s find another one.

I’m going to clear my form:
image

Guess what… when I clear my form and look at the Cost tab… I STILL see the value in the sum field:

Not ideal. We cleared the form, but that did not clear the value from our TransView column. To fix this, you would need another event… but it’s not important right now. We can work on that later if you want.

Let’s find a better trigger first. So, with my form cleared… you can also clear your Console in the Debug window:
image

Clicking that icon wipes the slate clean so we can start again.

I’ll add a job number back into the form and see what events fire.

When you change the JobNum, this is the first event that fires:

You’ll also see a BUNCH of other things that fire off as a result. These events include calls to the server to pull down information about that job which populates the unit cost fields (which we need).

So, like before, if we set our event TRIGGER to fire AFTER this ColumnChanging_KeyFields_JobNum event, it should work for us.

We need to go back to App Studio, and change our event trigger:

image

With that change made, you can click the Preview button again.

NOTE: In the debugger, you have to toggle the debugging back on each time! Even if you kept your preview window open… if you restart your preview, you have to have to turn debugging back on again.

Enter a Job on the form… and now I can see my Test event firing immediately after entering a job number:

(I collapsed a bunch of details here so we can see both the trigger event and event-after)

Click on the Costs tab to verify your value is there.

So… liking this Trigger better.

1 Like

I’m seeing the calculation happen but for some reason it doesn’t look like the same as yours and the value isn’t the total?

image

How is your value a sum, and mine is all of the field values put together with it dropping off some zeros? It’s still not putting the calculation value in the numeric box. I have the same binding set for the calculation and the box.

I apologize for taking up your time. This is just frustrating

1 Like

What version are you on? Wondering if the calculation tool is/was buggy in previous versions. I thought I saw a post about that somewhere but can’t find it now. Still digging…

Found it. This individual was seeing the same thing. The Calculation widget was concatenating a string instead of actually performing an addition function.

Does look like he circled back with any resolution (he was using 2024.1.11)…

At this point I would report this as a bug and see if they have any kind of fix/work around for your current version.

1 Like

Well isn’t that nice :slight_smile: .

I really do appreciate you taking the time to help me out!

For reference we are on version 2023.2.7 (11.2.400.0)

I will submit a ticket

1 Like