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 :
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
    2 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

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans