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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Business Rule does not unlock field for Email with Completed status on Unified Interface form

(0) ShareShare
ReportReport
Posted on by

I have an Email form containing a business rule to unlock a field if the Email activity status is Completed:

pastedimage1598960263569v1.png

The field is a lookup to the Subject entity:

pastedimage1598960369334v2.png


In the classic view, the business rule is successful in unlocking the field and allowing the user to edit the value:

pastedimage1598960518016v3.png


However, the same business rule on the same form in the new Unified Interface does not unlock the field:

pastedimage1598960636731v4.png

I also tried unlocking the field in JavaScript but this doesn't work either.

Does anyone know why this might be?

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    When email is received - it's in "Completed" state so it's readonly and you would not be able to unlock that field in supported way. You will have to look for alternative way to implement your scenario and to give any advice would be great to understand it. Can you please describe it?

  • Community Member Profile Picture
    on at

    Hi Zoe,

    I try to write following code and add it to onLoad event of the form.

    And also create a business rule to unlock it.

    function unlockfield(executionContext) 
    {
        const form = executionContext.getFormContext();
        const headerControl = form.getControl('header_statecode');
        var status = headerControl.getAttribute().getText();
        if(status=="Sent")
        {
            Xrm.Page.getControl('new_subjectforcaseid').setDisabled(false);
            Xrm.Page.getControl('subject').setDisabled(false);
            Xrm.Page.getControl('to').setDisabled(false);
        }
    }
    

    The general field ‘subject’ and lookup field ‘To’ unlock successfully, they can be edited, only the ‘subject for case’ can’t be edited,which is a special lookup field.

    pastedimage1599036655489v1.png

    In my opinion, it can’t unlock in UCI,which is by-design.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Community Member Profile Picture
    on at

    Thank you Andrew, I think this is probably a form design issue.  I'm going to try redesigning the forms.

  • Community Member Profile Picture
    on at

    Hi Andrew, 

    We are using Subjects (Subject Tree) to categorise Cases. We have JavaScript triggered via a custom button to convert an Email to a Case.  This passes the RegardingId from the Email (and previously the SubjectId) to xrm.WebApi.createRecord.  It should then create a new Case, set the RegardingId of the Email to the new Case and open the Case...

    pastedimage1599055666218v1.png

    Since we are unable to unlock the Subject field, I tried removing it from the Email form - however, the createRecord fails because the Subject is required on creating a Case.

    pastedimage1599055888642v2.png

    Any ideas on how I can achieve this?

  • Linn Zaw Win Profile Picture
    3,407 on at

    Normally, creating a Case without Subject would not throw an error like that. Seems like it is the custom validation.

    You can either look into that custom validation for such exceptional cases or populate the SubjectId with the default value if there is no Subject value in the email.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
#ManoVerse Profile Picture

#ManoVerse 101

#2
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 66 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans