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 :
Finance | Project Operations, Human Resources, ...
Answered

Workflow form redirect shows all records.

(0) ShareShare
ReportReport
Posted on by 68

Hi all,

I have created a custom workflow and it works perfectly .

The problem is that the approval manager when checks the "work items assigned to me " form , I tiwll show a record saying "abc submitted".

On click of this it actually opens the workflow list form which again has a hyperlink form to the main table but the problem is that when the main form is opened it shows all the records to the approval manager . I am not sure if we need to write some logic on init for this too as I was assuming that this works by std.

Am I missing any setting.

Below requirement when form is opened normally.

Also the custom form on which workflow is set needs to show records to users based on their userid only  So user a will see 10 records submitted by him only and not of other users.

However the manager will see all the records whenever this form is open via normal ways.

Thanks,

VK

I have the same question (0)
  • Suggested answer
    Dynamics Community 101 Profile Picture
    310 on at

    Hi Vicky,

    Please ensure that menu items assigned in workflow approval and workflow type are of detail page form and not list page forms.

  • Suggested answer
    Komi Siabi Profile Picture
    13,190 Most Valuable Professional on at

    Hello Vicky,

    You need to have two form a detail page and a list page. On the detail page, you need to write a line of code on the form init, and on the datasource execute query.

    RecId record;
    
    /// 
    /// Form init
    /// 
    public void init()
    {
        YourTable yourTable = element.args().record();
        record = yourTable.RecId;
        super();
    }

    Datasource

    /// 
    /// Datasource 
    /// 
    public void executeQuery()
    {
        QueryBuildRange         qr;
        
        qr = this.Query().dataSourceTable(tableNum("yourTable")).addRange(fieldNum(yourTable,recid));
        qr.value(SysQuery::value(record));
        qr.status(RangeStatus::Locked);
        super();
    }

  • Suggested answer
    GirishS Profile Picture
    27,833 Moderator on at

    Hi vicky,

    As per komi comment you need to add caller as query range to details form.

    Also you mentioned another requirement - Show data based on the user ID. For this you need to enable created by property to yes on the table level.

    On the execute query you need to check whether logged in user ID is not manager means - add the range to created by field and value should be curuserid() and on the else statement clear range.

    Thanks,

    Girish S.

  • vicky1234 Profile Picture
    68 on at

    Thanks Komi and Girish

    the above code works .

    For the user filteration  ssue I wrote another logic to fix it.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 514 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 390

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans