Is executing a refresh the best solution?

Greetings,

I’m relatively new and I’ve been tasked with creating a solution. I’ve created a UD field on the Vendor table (Inactive_Since) that displays the date with an epiDateEditor if/when Inactive checkbox is checked on Supplier Maintenance.

I’ve created a BPM that dictates a check must be paired with a date and vice versa. For example, if a user selects a date in the Inactive_Since date editor, the Inactive checkbox will automatically fill. The problem that I’m encountering is if an active Vendor is changed to Inactive, the text in the date field will not clear until the form is refreshed, but does clear in the dB. Is there a way to force a form refresh using custom code? In Data Directives In-Transaction, I’ve tried oTrans.Refresh() in the custom code editor and received the error “Error CS0103: The name ‘oTrans’ does not exist in the current context [InTran.InactiveDate2.cs(312,13)]”

Does anyone know how to fix this or how to find a better solution? Attached is the copy of the BPM. Many thanks.

There’s really no way to tell anything from your BPM screenshot, but just a note about oTrans; that’s the transaction object present in form customizations, but is not present in BPMs. If you search this forum you will find many examples about BPMs and setting/clearing fields.

1 Like

Also this BPM is a Data Directive which runs well below the Business Objects. Any changes made in here should automatically propagate up the chain

1 Like

one trick I used… we chose one of callContextBpmData fields (I believe it it was callContextBpmData.Character01) and set it to a value, such as “RefreshScreen” in the BPM when we knew we needed to refresh the screen…
THEN in the UI Customization, we have some logic that looks at that same variable (yes, it is available) and if we find “RefreshScreen”, then we run the oTrans.Refresh(), and then we reset Character01 to “” so we dont trigger again.

6 Likes

If you are up to make a customization change, you could just detect the field change event of the epidataview? When the checkbox.Checked value is changed, add code to add or remove the date_inactive …?

Pierre

@timshuwy I would love to use your trick in our Quote Entry form customization. What I’m doing is when a user adds a part to the quote, I have a Data Directive that automatically adds another line item for a Project Management fee. But as expected, it doesn’t refresh the UI so the line item doesn’t show up until the user clicks the refresh button. I’ve added in the “RefreshScreen” code into the BPM. Would you happen to know what event would be proper to trigger your trick in the UI customization? Thanks for your time!