Hello,
I have been researching on the internet and can’t find a workable way to do this.
The tracker field I want to default is: PriceLstParts_ListCode
I have a dashboard that needs to filter on opening to a certain listcode called: CURRENT
I have tried in the tracker customization and on a deployed version of the dashboard.
If possible, I would need it to load with that data as soon as it is opened. I wasn’t sure if the ‘Auto Refresh on Load’ would work before a customization or after.
if the options that you want to filter by are a specific list, I usually add a drop down list. It will default the whatever is first in the list. Then auto load would load it. The example below I created a calculated field that looks at open and if open has a value of OpenBoth, and if Closed, ClosedBoth. The * in front of Both acts as the wild card so that a begins with filter will work for that. (another user here came up with that trick and I stole it because it was brilliant)
As far as getting text boxes to default, I’ve haven’t been able to make anything work consistently. I think you need to code it to make it work right all of the time.
When I created the tracker view and selected ‘PriceLstParts_ListCode’, it created a drop-down list for me.
I would rather use that and have a default that would load than try and create something else.
That way when they add more pric lists, I won’t have to keep manually updating the tracker.
You can try to add the default text in the properties under customize tracker view. I have gotten some things to stick before, however, it has not been consistent for me. You might have to do a customization with code to force populate the field. (maybe other can help with that code, I’m a copy and paste guy when it comes to code) Probably on form load, don’t use the auto refresh, then set the customization to run after load so you can populate the field first before getting all of the data, and then force a refresh with code so it acts like auto refresh. I wish I had better guidance on the technical part of it, but I’m still learning too.
That was pretty much what I had in mind but I haven’t learned enough to figure how to do it. If there any generous coders out there who can work me through it, I would definitely appreciate it.
An example from another source I found but couldn’t get to work was:
var txt = csm.GetNativeControlReference(“1685c535-de49-43f5-88ed-12cefa5a9bc3”);
txt.Text = “CURRENT”;
}
After deploying with auto refresh on, I added to menu as ‘Dashboard-Assembly’ and customized it.
I added to the Script editor and changed the GUID in the code to the dropdown’s GUID and the text to ‘CURRENT’.
Saved and did a test. Didn’t seem to work.
The error it gave me was: Exception has been thrown by the target of an invocation.
*Another note, I have the tracker set to input only. If not, then it populates my other search with a part number.