cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bahalzamon
Advocate III
Advocate III

Set Value Using JS in Quick Create - Alternative?

I am attempting to save a value into the Name field using JS, getting it from a Choice field. The code works fine on the main form but not on a Quick Create form. I do know that formSelector for some reason is not supported in Quick Create forms.

 

Is there any workaround that anyone knows? Here is the code I am using.

 

 

//update name field based on selected type
function advocateTypeChange_OnSave(executionContext) {
    var formContext = executionContext.getFormContext();
    //fields
    var typeChoice = formContext.getAttribute("new_type").getText();
    var nameField = formContext.getAttribute("new_name");
    //set name
    nameField.setValue(typeChoice);
}

 

 

 

0 REPLIES 0

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (2,613)