ChangeLog - Prefilled date filter by BPM

Hi! ^^

I got a request regarding the ChangeLog form.

They want it pre-filtered (today minus 2 weeks) when it opens from the work order form.

I wanted to give BPM a try. I’m able to put a condition in the BPM when it comes from the work order form, but it doesn’t fill up the date filter as I’d like to.

Here’s the BPM:

I did track with the TraceLog the right BO to use with the parameters:

But nothing is happening. :frowning:
(and I tried “pre” & “post” processing)

Am I missing something or I’m completely lost and don’t have the right approach?

Thanks in advance for your help! :slight_smile:

Unfortunately I think so.

That’s a trace of the Report Monitor you showed :slight_smile:

Nothing to do with the Change Log.

Haha true, totally makes sense. :sweat:

It’s probably this one:


But it doesn’t help in my case I think.

Then, is there a way to automatically fill the date filter using BPM?

I can’t say for certain, but I would assume not.

I would do that in client customization.

If you post a full trace, from form not loaded, to form loaded, I could tell you for sure.
(clear log, open form, view log)

TraceData6884.txt (5.6 KB)
Here’s the full trace.

Sometimes, I like to give BPM a try, but it often ends up in customization.

Here’s what I did:

	public void InitializeCustomCode()
	{
		var DateFilter = (Ice.Lib.Framework.EpiDateTimeEditor)csm.GetNativeControlReference("b2c1a5a9-a179-4174-a86b-02f1caed1a7e");

		DataSet ds = (DataSet)GetPropertyValue(this.ChgLogForm, "MenuItemDS");
		if (ds.Tables[0].Rows[0]["MenuID"].ToString() == "XAPR1002")
		{
			DateFilter.Text = DateTime.Today.AddDays(-14).ToString();
		}
	}

	private object GetPropertyValue(object obj, string propertyName)
	{
		if (obj == null)
		{
			throw new ArgumentNullException();
		}
		
		PropertyInfo propertyinfo = obj.GetType().GetProperty(propertyName, (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy));
		
		if (propertyinfo == null)
		{
			throw new Exception(propertyName);
		}
		
		return propertyinfo.GetValue(obj, null);
	}
1 Like