NOT a lost cause - a function for new labor dtl with no code

Glad an expert weighed in.

But that’s what I deduced, too, is all of these BOReader calls seem to be for generating a dropdown and that sort of thing. Like you said, if you are preventing that in your own UI, then it should be clean. :crossed_fingers:

Man, I am just getting started on this! I’m with you - hoping it works with the minimum needed.

1 Like

Possibly. Remember, all of this code is written by people, so it’s not perfect, and not all possibilities are taken into account all of time, and it’s not 100% consistent from one method to another. In theory, the Update method should prevent you from shooting yourself in the foot. But it doesn’t always work out.

And yes, decompiling and testing with things like the BL tester are all things that can help you understand what’s going on. It’s not too often then you will get through all of the testing and have nothing blow up and create time bombs for later.

1 Like

The other thing I see in all of this - and this should be no surprise - is that a trace is only as good as the scenario you trace.

So, like Tuesday, I traced a labor entry with quantity, then Wednesday I tried it with an operation that prevents quantity, and it failed, because, why was I calling a DefaultQty method with a zero quantity?

So I guess my point - again, an obvious one - is that the trace doesn’t explain the logic tree. It’s just a record of the path you went down that day.

2 Likes

Yeah I love time bombs. I had one cooking (built by someone else) that was a wicked labor reporting customization, super sharp, but little did we know it was not updating in the proper fashion so it was unintentionally reversing backflush transactions for an unrelated job and operation. Whoops! I know I have some of my own that I created too, I just didn’t know it at the time.

YES! That is what I find so difficult. That is why these other methods that are checking for different data might not come into play with the scenario that I traced out or the business process that we follow now… but if the process changes I would imagine the BPM would have to too! Otherwise you could be messing things up or it just doesn’t work anymore.

All of this to try out a function using REST like Wonsil challenged us to do.

I have to now figure out how to turn on REST v2 and then I will build my function for inventory transfer based on the BPM I made.

Loving this post @JasonMcD Thanks for linking the posts that helped you cause they helped me too. Thanks @Banderson for your original post and for your comments here!

1 Like

:scream:
Now I am frantically looking through our system for the bombs.

REST V2 is on by default all you need to do is enable API keys and such.

I have no idea if there are any :woozy_face: If nathan bonner can make them so can I @jdewitt6029 so I wouldn’t be surprised if something I did had an adverse affect on something that wasn’t noticeable right away.

Thank you Jose! I will enable the keys then!

How do you get the execute custom code in the callers section? I only have invoke bo method and invoke function.

You have to predict the future, lol.

When you create the function, you have to deliberately create a new “widget function with code.”

And you may need to check a box on the library, give yourself permissions, etc.

You can literally copy and paste the widgets from the non-code function to the code-able function, though, so all is not lost.

As an update, this function is actually in use every day here as part of a time-entry PowerApps app I made. As of next Monday, it is the only way they are allowed to do time entry here. No paper time cards, no DMT.

So again, thank you to all who made this easy enough for me to understand it! @josecgomez @Banderson @Mark_Wonsil

3 Likes

Is it possible to turn a existing function into one with code without recreating it? I tried to paste the execute custom code into my existing function without code and got this

I think you are going the opposite way that you need to.

  1. Open non-code function; copy all widgets
  2. Open code function and paste widgets
  3. Add custom code block, connect it in, etc.

And of course there is a step zero before all that - create the code function (the header/signature) with all of the inputs and outputs

Or, you know, use the @ckrusen method of automatically binding 283 fields… No code required.

Yeah I tried that and got a ton of compile errors

Blake,
Looks like that error message might be related to your user account. Do you have “BPM Advanced User” permissions on your user account?

image

Well I now know your pain. What is the deal with this one?! It wants an update every time!

Did you find an easier way to set the bins, etc.? Do I even need these objects just to set the bin?

Don’t let @hkeric.wci see this widget mania.

No, I had to keep those rowmods in there. Haso was explaining why in another post and that’s one reason why he doesn’t use the widget approach.

-Utah

2 Likes