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

Add Different Values In Range Of query Or Table

(0) ShareShare
ReportReport
Posted on by 384

Dear Gentlemen,

I want to create a new range On InventTransferTable which includes 2 different values, below is my code please advise if this is possible:

sender.query().dataSourceName(sender.name()).addRange(fieldnum(InventTransferTable, Transferstatus)).value('(TransferStatus=="Shipped") && (Inventlocationidfrom=="Location1") ||(TransferStatus=="Received") && (Inventlocationidfrom=="Location2") ');

The Point is, i want to assign this query range to a certain user to see only the Shipped from location 1 and the Received from location 2, on the Invent Trans Order Form.

Please Note that i also tried to create a new AOT Query and to add the same filter in range but it didn't work.

The results are always blank form with no data.

Appreciate your help.

  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at
  • sylvesterPowerBi Profile Picture
    384 on at

    It's Not working when i insert && instead of || , the return is always Null.

    this is my code :

    sender.query().dataSourceName(sender.name()).addRange(fieldnum(InventTransferTable, Transferstatus)).value(
                strFmt('((%1=="Shipped" )&&(%2=="Location1"))',fieldStr(InventTransferTable, TransferStatus),fieldStr(InventTransferTable, InventlocationidFrom)));

    Please Advise.

  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    It's useful to try to print your range to infolog to see what is wrong with it.

    Perhaps the range is different than you intended.

    Or perhaps there is no data that corresponds to you range.

    And when using enum values in ranges, use enum2str(EnumName::EnumValue) instead of hardcoded strings.

    If you need more help, please share all your range from infolog, and screenshot of your data so that we can see if you should get results with that range or not.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 495 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 432 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 366

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans