cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smileamile
Helper II
Helper II

Combobox OnChange (Edit form) needs to reset fields with a default/ThisItem value

I have a combobox that has an OnChange value that auto-populates a text box and filters the item list for a second combobox. This works great on my New form. However, the same function the New form aren't working as desired for the Edit form.

New Form
Site Name (ComboBox1)

  • OnChange:UpdateContext({varSite:LookUp('CompanySiteDepartment',ComboBox1.Selected.Result = SiteID)});Reset(ComboBox2)

Address (DataCardValue6)

  • Default: varSite.SiteAddress

Department (ComboBox2), No defaults set, Items list is filtered from Site Name

 

Edit Form

Site Name (ComboBox1_1)

  • OnChange: UpdateContext({varSite:LookUp('CompanySiteDepartment',ComboBox1_1.Selected.Result = SiteID)});Reset(ComboBox2_1);
  • DefaultSelectedItems: [Parent.Default]

Address (DataCardValue6_1)

  • Default: ThisItem.Delivery_Address

Department (ComboBox2_1)

  • DefaultSelectedItems: [Parent.Default]

 

Issue: when the user gets to the edit screen, the defaults all reflect what's currently stored on the record. But, when user changes the site, it needs to still update the Address (to the varSite.DeliveryAddress value) and clear the Department default to blank.

Ideas?

Update: I figured out the Delivery Address one by creating a variable that I set on the button to get to the edit screen and then OnChange for the Site Name. However, I am still stuck on how to clear out the Department text box.

1 ACCEPTED SOLUTION

Accepted Solutions
smileamile
Helper II
Helper II

added variables for the defaults instead, and set them on appropriate properties

View solution in original post

1 REPLY 1
smileamile
Helper II
Helper II

added variables for the defaults instead, and set them on appropriate properties

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (48,024)