Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

put a condition based on a field in the caller form selected record

(0) ShareShare
ReportReport
Posted on by 47

Dear All;

I have Form A which has the following grid

8686.jpg

and form B which is called by form A

7752.jpg

i want to filter form B based on status column whenever Form A record "steptype" field have different status

my code was 

    if (element.args().caller() && element.args().dataset() == tableNum(ADVChecksMultiPost))
    {
    if (element.args().refField(ADVChecksMultiPost.ADVCHKStepTypeNew) == ADVCHKStepType::UnderCollection)
    {
     this.query().dataSourceTable(tableNum(ADVChecks)).addRange(fieldNum(ADVChecks, ADVCHKStepType)).value(enum2str(ADVCHKStepType::Recieve));
    }
    }

the third line doesn't seem to be working

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 on at
    RE: put a condition based on a field in the caller form selected record

    Thanks for providing the solution to your own question. I have marked your answer as verified to get the status of this question changed to 'Answered'.

  • Verified answer
    m.salah297 Profile Picture
    m.salah297 47 on at
    RE: put a condition based on a field in the caller form selected record

    Thanks Andre I have changed the code to

     

    if (element.args().parmEnum(2))

    it works fine now

  • m.salah297 Profile Picture
    m.salah297 47 on at
    RE: put a condition based on a field in the caller form selected record

    Hi Andre;

    no i want records to be changed be changer wherever i open form b based on the selected row from form B.

    and what i tried is to remove the step type condition in line 3 and then the filter is applied successfully.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 on at
    RE: put a condition based on a field in the caller form selected record

    Hi m.saleh297,

    Can you explain what you mean with 'whenever'? Do you want to change the filter when you change a record on Form A and form B is still open? Have you also used the debugger to check what is actually being executed?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans