GuillaumeR
(Guillaume Ruel)
March 1, 2023, 6:34pm
1
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.
(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!
klincecum
(Kevin Lincecum)
March 1, 2023, 8:51pm
2
GuillaumeR:
completely lost
Unfortunately I think so.
That’s a trace of the Report Monitor you showed
Nothing to do with the Change Log.
GuillaumeR
(Guillaume Ruel)
March 1, 2023, 9:05pm
3
Haha true, totally makes sense.
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?
klincecum
(Kevin Lincecum)
March 1, 2023, 9:08pm
4
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)
GuillaumeR
(Guillaume Ruel)
March 1, 2023, 9:11pm
5
TraceData6884.txt (5.6 KB)
Here’s the full trace.
GuillaumeR
(Guillaume Ruel)
March 2, 2023, 3:04pm
6
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