Run multiple events onClick

Prior to this running I set the appStore:

storeValue(‘dpfVariation_StartDate’,dpfVariation_StartDate.selectedDate
storeValue(‘dpfVariation_EndDate’,dpfVariation_EndDate.selectedDate

I am not able to find out how to put this all together.

I have a button that onClick I need to:

1: {{storeValue(‘viovStatus’,‘Add’)}}

2: {{iNewVendorItemOfferingVariatio.run()}}

on Success:
set datepicker1 widget to appsmith.store.dpfVariation_StartDate;
set datepicker2 widget to appsmith.store.dpfVariation_EndDate;

on Fail:
{{showAlert(‘Error’,‘error’)}}

@Preston, add this under JS for button’s onClick event

{{
storeValue("viovStatus", "Add");
  iNewVendorItemOfferingVariatio.run(
    () => {
      storeValue("dpfVariation_StartDate", dpfVariation_StartDate.selectedDate),
        storeValue("dpfVariation_EndDate", dpfVariation_EndDate.selectedDate);
    },
    () => showAlert("Error", "error")
  );
}}
1 Like

Thank you. I was missing the , between the two storeValue calls. I had been trying it with a ;