web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Create text field with a pre set text

(0) ShareShare
ReportReport
Posted on by 95

Hi,

I am trying to have a pre set text in my multiline text field with a multiple lines.

What is the best way to do so? JScript (example?)?

I know that business rules don't work with multiple lines of text. 

Thanks in advance.

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi HowlingWolf,

    I think JScript  is the best way because there is no OOB way to do this.

    I tested with the description field on the Account entity:

    1. Create a JS type web resource and add it to your form. The sample code:

    function preSetText(executionContext){
        var formContext = executionContext.getFormContext();
        var description = formContext.getAttribute("description").getValue();
        if(description == null || description == ""){
            formContext.getAttribute("description").setValue("This is pre set text.");
        }
    }

    2.Create an onload event with that library:

    pastedimage1638845233118v1.png

    3. Save and publish the form.

    Result:

    pastedimage1638845260726v2.png

  • HowlingWolf Profile Picture
    95 on at

    Thanks Steve,

    Perfect!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 196 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans