justasd
justasd

Reputation: 401

Microsoft Dynamics online: set field's value from another field

I learned that it is not possible to change Type of the field after it's creation (source: https://stackoverflow.com/a/18871910/1600883). My goal is to display "Option Set" instead of "Single Line of Text" in the Appointment Entity Form, field called "Subject". So the solution should be to hide the "Subject" field and to add another custom field, which has "Option Set" as a Type. But the problem is that "Subject" is required, so I'm thinking about taking the value from "Option Set" and set it to "Subject". Is it possible to do that?

Upvotes: 0

Views: 3802

Answers (2)

Scorpion
Scorpion

Reputation: 4575

Yes its possible.

If you don't want Subject on form then remove it from form. Register a plugin on pre-operation of Activity to populate the subject field with the value of OptionSet field.

Upvotes: 0

Guido Preite
Guido Preite

Reputation: 15128

Yes, it is possible, just attach this javascript function to the OnChange optionset event.

function optionsetOnChange() {
    var optionsetText = Xrm.Page.getAttribute("new_optionset").getText();
    Xrm.Page.getAttribute("subject").setValue(optionsetText);
}

and change new_optionset with the name of your optionset field.

Upvotes: 3

Related Questions