Setting a default based on a drop menu item

What I would like to do is set the default number based off the drop down menu above it.

  1. Set the form flag UpdateDataOnChange.

  2. Do not set the Value property of the lookuppopup so you can extract the whole row data.

  3. Execute code in the Change event: ${this.form0.form.patchValue({Quantity: event.value.Quantity})} with the condition ${ == 'PO_ID'}.

  4. Execute code in the Change event: ${this.form0.form.patchValue({PO_ID: event.value.PO_ID})} with the condition ${ == 'PO_ID'}

Step 4 is to set the value property back to PO_ID only and not the whole row data. You can, as well, instead of patchValue in the Change event, Object.assign({}, ${event}, {Quantity: this.quantityProperty}) in the Submit event.

1 Like

Which property needs to be set on the change event on step 1? Leaving it blank, generates an error message. skipping that part of step 1 seems to also work.

step 4: a pair {} was missing but I figured that part out, after it generated an error message.

Thank-you very much! Project is working as intended now.

Yes, that part about setting a property in Step 1 was wrong, I forgot to remove it. I modified my answer to inlcude the missing {} as well.