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,...
Suggested Answer

Changing field to certain value triggered by person being part of a subscription list.

(0) ShareShare
ReportReport
Posted on by 45

Hey guys!

I really need your help!

My problem is: As soon as a person is part of a subscription list, a certain field in the contact form should be changed to a certain value. is there any way to achieve this? 
it would be reeeeeally important for us to fix that problem. 

thanks for your help! 

Greetings 
Amelie

I have the same question (0)
  • Suggested answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Amelie,

    There is an entity Listmember which saves all mapping records between contact and marketing list.

    e.g:

    List A contains 3 memebers, list B contains 2 members, thus there will be 5 listmember records in system.

    Listid             Memberid

    • List A id     contact 1 id.

    • List A id     contact 2 id.

    • List A id     contact 3 id.

    • List B id      contact 1 id.

    • List B id      contact 2 id.

    If there is a listmember record which its listid field equal to list B id and its memberid field equal to contact 1 id,

    then it indicates that conact 1 is part of list B

    Thus we could do it with JavaScript:

    Create a JScript web resource with code below and add it to Contact form.

    function listmemberChecker(executionContext) {
    
        var formContext = executionContext.getFormContext();
    
        // Get current contact id
        var id = formContext.data.entity.getId().replace(/\{|\}/gi, "").toLowerCase();
    
        // Check whether there is association between contact and the specific marketing list
        var query = "?$filter=_listid_value eq '006552d4-7eb6-ea11-a812-000d3ab64f2b' and _entityid_value eq "   id   "";
    
        Xrm.WebApi.retrieveMultipleRecords("listmember", query).then(
            function success(result) {
                if (result.entities.length > 0) {
                    formContext.getAttribute("xxx").setValue("some value");
                }
            },
            function (error) {
                console.log(error.message);
            }
        );
    
    }

    We can get a subscription list id in URL.

    1374.JPG

    If retrieved result length is larger than 0, then set a certain field to a certain value.

    Please take tutorial below for how to add a javascript web resource to form.

    https://carldesouza.com/how-to-use-formcontext-in-a-web-resource-in-dynamics-365-power-apps/

    Regards,

    Clofly

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 107 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 94

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans