I have a lookup column for which I am updating and setting a default value when the form renders. This action causes the on change of the look up field to fire and the value is displayed correctly in the popup.
However when I change the values in the lookup dropdown I get error displayed "[object Object]" on subsequent changes. Any ideas? I have tried opening the form in Incognito window however the same result.
For some reason On form load the list control is not filtering. Scenario is we have a list control and period look up field.
As mentioned once form opens and period is changed the data is filtered as expected. However on the form load we are setting a default value for the period and need to ensure the list is filtered based on the value.
Dear @SamirPateluk,
You have the answer right in your code. In filterDT() function you are getting value.LookupValue which is available if you set the value manually, but it's not available if you set the value with just ID on form load.
You can add another filter condition after setting the field value on load, and keep the filterDT() function for when it's changed by the user.
Hi, I had tried that approach too but it's not working. Could it be that the controlSubmittedTimesheets isn't avaiable when the field Project ready function runs?
I am tearing my hair out.. Can't see why this isn't working...
On change filter is as below and it's filtering against value
dt.filter = "" + value.LookupValue + ""
On load its filtering using ID
dt.filter = "" + items[0].ID + ""
Additionally as the field is changed on load the "Change" of period is also called and should really filter. Once form is loaded and subsequent changes to period field all works as expected!
If one doesn't work and the other one does work, there should be some difference between the two - and you need to make sure the first one matches the second one.
Please, post screenshots from console here if you can't figure it out!
Apologies for the delay. I have updated the query to use ID and it works.
attached the log. As mentioned, On render once 'Period' is loaded we are setting the value of the field. When the form loads its setting the filter value highlighted in blue (If I Disable the On-Change option the filtering on load works as expected).
As we are setting the value onload for the 'Period', it also triggers the 'Period' on change function, on load of the form and in that case the value seems to be 'Undefined' - highlighted in Yellow.
On subsequent changes, the data is refreshed as expected - highlighted in green.
Nikita - it still isn’t working as expected. Once the field loads, I am setting the default value of period, i.e. triggering the “on change”. The triggering of on change seems to send the query as highlighted in yellow however the data isn’t refreshed in the table as expected.
Subsequent triggering of On change works as expected (highlighted in green)