CRM

Set the value of a Text field in dynamics 365

In this article we will learn How to Set the value of a Text field in dynamics 365 ?

In this blog we will see step by step Set the value of a Text field in dynamics 365.

Step 1. Click on Settings –> Solutions

change-label-of-attribute-in-dynamics-crm

Step 2. Click on your created solution.

Step 3.Next Step to add “Web Resources”.Click On Web Resources and then Click on New Button.

Step 4.Write the name of web resources in Name and Display Name Field after that select type “Script(JScript)” and Select Language after that click on “Text Editor” button like Screenshot.

Step 5. Write this Code on Text Editor and Click On “OK” button.

[php]
function ValueOfField(e){
//pass here logical name of textbox
var firstName = "Monti"
Xrm.Page.getAttribute("lax_name").setValue(firstName );

}
[/php]

Step 6.After that Click on “Save” and “Publish”.

Step 7. Select your Entity and click on “Main Form”.

Step 8. Clicket on “Form Properties”.

Step 9. Here we will add a web resources file name in File Libraries.

Step 10. Search file after that click on “Add button”.

Step 11. In Event handlers section we will select Control “Form” and Event “OnLoad” and click on Add button.

Step 12. Write function name and please click on Save button like screenshot.

Step 13. Finally click on “OK” button after that Save and Publish Main Form.

Output

Leave a Reply

Your email address will not be published.