Set Field BPM - "There are no records in the table"

,

I am trying to set a field on a BPM and keep on getting an error and I don’t understand why. Here are the details:

  • It is a Post BPM on GetNewPODetail
  • There is a custom field on the header that I want to populate in a custom field the line.
  • It is a straightforward BPM; “Set the ttPODetail.Custom field of the added row to the dsPOHeaderRow.UDField<System.Int32>(“Custom”)”
    image
  • I ran a trace and the POHeader ds is there and there is a value in Custom

So, at this point I am totally confused. The only thing I can think of is that the custom field has the same exact name on the header and the detail.

Well, I don’t know specifically for you BPM but I do know some good trouble shooting techniques, so if it was me this is what I would do.

Message boxes can give you a ton on information, especially when you get things like “no rows” etc. You can do a field or table query to send back the rows and you can see what’s coming back and that will usually give you an idea. So I would do that first. My first though would be that the rows aren’t coming through as added (rowmod A) on the Post Process, since it already added the row. But I would have to check with a message box to be sure.

A couple of question about the behavior, does the BPM work as expected when you are adding a row? Does the error message only happen when you are changing/working in PO detail while not adding a row.

If that’s the case, I’ve always had the practice of making the first block a condition before I start doing anything like updating fields. It seems redundant, and maybe it’s not always required, but if you guide the flow of your BPM to only try and update the field when there is actually an added row, it might get rid of the error.

Just some things to try. You don’t really have enough information to get a definitive solution.

1 Like

@Banderson I always forget about that trick, thanks for pointing it out.

I’ve been playing around with the BPM and sure enough, the header is empty when the BPM fires. I’ve only tested adding a row, no changes.

I thought that the header data was always present when a record was loaded in the screen? Am I wrong?

Well, the GetNew method doesn’t change anything, so I don’t think you are going to get a TT table (I could be wrong about that though), so you probably are going to need the BPM on the update method, not get new.

Interesting. I thought the tt tables were always present when there was a record loaded. Thanks for the info!!

Can I ask why you chose the GetNew instead of the update method?

There could be, but I don’t think there will be an added row with GetNew, because it isn’t updating anything.

The users want to have he field default when they create new rows and releases. If I did an update method, the field would not populate until they saved.

Hi guys.

GetNew creates a temporary record. However, it does not update any tables until it is saved.

Thanks @Alphanu

If it’s an ease of use thing, it might be better to put that in a customization instead of a BPM. It’s easier to update real time there. You can use the wizard to do most of the work (it’s a data view notification) and you can default the value there.

BPM’s a really better at preventing bad information from being saved. Although it’s possible to default things, it usually involves customizing to force a save on the UI side.

I guess what is confusing me the most is why I can see the data in the trace, but the BPM cannot.

Does anyone know why? Is it a bug or is that intended?

When you did your message box in the BPM did you check all 4 boxes?

Yes.

The line info shows up, but no header information.

image

So if I understand you, you want to change information on the header table when calling GetNewPODetail?

I’m guess that you’ll will probably have to run a BO in the BPM to do that.

That is the same exact result that I get. But when I run a trace, I see the Header data, and then the Header and Detail data on the return.

If I can see it there, why can’t I access it? It is really confusing me.

Snippet from the trace.

image

That’s the data set that it uses to run the get the New PO detail line. The actual BO isn’t returning the header information, it uses it to perform the method. So it’s a parameter, not a result.

1 Like

Ah. I see what you are saying. Thanks!

I would still recommend doing this is a customization if it truly is a “suggestion” to start with instead of something that has to be that way. (as long as you have access to customization I suppose)