Skip to main content
Solved

Update dependent fields on Filter view for custom processing screen not working


Forum|alt.badge.img+1

I have a custom processing screen and would like to clear out values of other fields on my filter based on a combobox changing.  Iโ€™ve have CommitChanges set to true on my combobox but canโ€™t get the text box values to clear.  

I can set a breakpoint and see that the values are changing to null but they stay on the screen until I change the combobox back to Pallet then back to Truck and back to Pallet again.  But the first time the UI doesnโ€™t show the change.

Here is my FieldUpdated logic: 

 

 

        protected virtual void _(Events.FieldUpdated<PMTaskToAssignFilter, PMTaskToAssignFilter.assign> e) {

            PMTaskToAssignFilter row = e.Row;

            if (row.Assign != AssignTypes.Truck) { 

                row.DeliveryNumber = null;

                row.TrailerNumber = null;

            }

        }

Best answer by Naveen Boga

@rjean09 Iโ€™m NOT sure, why this is NOT working, but you can try with below provided code and verify

protected virtual void _(Events.FieldUpdated<PMTaskToAssignFilter, PMTaskToAssignFilter.assign> e) 
      {

            PMTaskToAssignFilter row = e.Row;

            if ( row != null && row.Assign != AssignTypes.Truck) 
            {  
e.Cache.SetValueExt<PMTaskToAssignFilter.deliveryNumber>(e.Row, string.Empty);
e.Cache.SetValueExt<PMTaskToAssignFilter.trailerNumber>(e.Row, string.Empty);
            }
        }

Above code should work but  Incase above code is NOT working, please use code and checkโ€ฆ

protected virtual void _(Events.FieldUpdated<PMTaskToAssignFilter, PMTaskToAssignFilter.assign> e) 
      {

            PMTaskToAssignFilter row = e.Row;

            if ( row != null && row.Assign != AssignTypes.Truck) 
            { 
               //Assuming below fields are just text fields.
                row.DeliveryNumber = string.Empty;
                row.TrailerNumber = string.Empty;
                e.Cache.Update(row);
            }
        }

View original
Did this topic help you find an answer to your question?

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3404 replies
  • August 7, 2021

Hi @rjean09  Code looks good to me and it should work, but still we can do few modifications in your code. Please find the code below.

  • assuming that you have Commit Change = True at .aspx level for the assign field.
protected virtual void _(Events.FieldUpdated<PMTaskToAssignFilter, PMTaskToAssignFilter.assign> e) 
      {

            PMTaskToAssignFilter row = e.Row;

            if ( row != null && row.Assign != AssignTypes.Truck) 
            { 
               //Assuming below fields are just text fields.
                row.DeliveryNumber = string.Empty;
                row.TrailerNumber = string.Empty;
            }
        }


Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • 77 replies
  • August 7, 2021

Hi @Naveen B 

Yes, Commit Change = True for the Assign field.  Tried the above changes but still does not change the values on the UI without toggling Assign an additional time between Truck/Pallet.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3404 replies
  • Answer
  • August 9, 2021

@rjean09 Iโ€™m NOT sure, why this is NOT working, but you can try with below provided code and verify

protected virtual void _(Events.FieldUpdated<PMTaskToAssignFilter, PMTaskToAssignFilter.assign> e) 
      {

            PMTaskToAssignFilter row = e.Row;

            if ( row != null && row.Assign != AssignTypes.Truck) 
            {  
e.Cache.SetValueExt<PMTaskToAssignFilter.deliveryNumber>(e.Row, string.Empty);
e.Cache.SetValueExt<PMTaskToAssignFilter.trailerNumber>(e.Row, string.Empty);
            }
        }

Above code should work but  Incase above code is NOT working, please use code and checkโ€ฆ

protected virtual void _(Events.FieldUpdated<PMTaskToAssignFilter, PMTaskToAssignFilter.assign> e) 
      {

            PMTaskToAssignFilter row = e.Row;

            if ( row != null && row.Assign != AssignTypes.Truck) 
            { 
               //Assuming below fields are just text fields.
                row.DeliveryNumber = string.Empty;
                row.TrailerNumber = string.Empty;
                e.Cache.Update(row);
            }
        }


Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • 77 replies
  • August 9, 2021

@Naveen B Thank you for the suggestions, however, values continue to not clear on the fieldupdated event.  However, I tried changing Assign combobox to Truck/Pallet mutually exclusive checkboxes and now when I select the Pallet checkbox DeliverNumber and TrailerNumber clear no problem.  Funny thing about this is that the original screen mock-up provided to me showed check boxes and I made the call to use a dropdown.  So, for now, problem solved in a roundabout way.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3404 replies
  • August 9, 2021

Hi @rjean09  Okay!! Thanks for sharing an update.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings