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

CRM Portals - Need to check a value and redirect to different page

(1) ShareShare
ReportReport
Posted on by

Hi,

I need to check a value in crm Portal web page using a fetchxml as below and if value is false then redirect to a different web page. I have to do this in ~/forms web page onLoad. How can i do this ? 

<fetch mapping="logical" version="1.0" distinct="false" output-format="xml-platform">
  <entity name="subscription">    
    <attribute name="approved" />
    <order descending="false" attribute="dvc_name" />
    <filter type="and">
      <condition value="{D0714C33-9969-EA11-A811-000D3A31EF6C}" attribute="contactsubscriptionid" uitype="contact" uiname="" operator="eq" />
    </filter>
  </entity>
</fetch>
I have the same question (0)
  • Verified answer
    nkhemji Profile Picture
    4 on at

    you can do this through javascript. Use something like below.

    <script>

    window.location.replace( 'your_url' );

    </script>

  • Tilan Bethmage Profile Picture
    on at

    I would like to know how to call fetchxml and call this javascript based on result

  • Suggested answer
    Tilan Bethmage Profile Picture
    on at

    I implemented below logic with liquid and added your code to redirect it worked.

    {% endfetchxml %}  {% for result in query.results.entities %}

    <div style='padding: 15px 30px 0 0; clear: both;' name='content'>

       {% assign x = result.approved %} {% if x %}

       {% else %}

       <script>window.location.replace('~/UnAuthorizedFormsPage');</script>

       {% endif %}

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 184 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 125

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans