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, ...
Unanswered

How to add Or condition in Add query range in form

(0) ShareShare
ReportReport
Posted on by 20

I need to provide Or Condition filter between fields(Accepted and Received) of my data source in the form. both fields are of Enum type and I need to provide value Yes to both fields.

I have applied filter on Document_type, Renewed and Validity_Date , these three are working but Received and Accepted are not working after opening the form.

[Form]
public class PwC_Insurance_Monitoring_Form extends FormRun
{
PwCAlertMessageforValidityDate regclass;
TransDate validityFromDate;
TransDate validityToDate;
PwCAlertMessageforValidity selection;
PwC_TRI_PIS_SAFE_DOCUMENT document;

/// <summary>
///
/// </summary>
public void init()
{

super();
if(element.args().parmObject())
regclass = element.args().parmObject();
selection = regclass.parmselection();
validityFromDate = regclass.parmvalidityFromDate();
validityToDate = regclass.parmvalidityToDate();
PwC_TRI_PIS_SAFE_DOCUMENT_ds.executeQuery();

}

[DataSource]
class PwC_TRI_PIS_SAFE_DOCUMENT
{
/// <summary>
///
/// </summary>
public void executeQuery()
{
QueryBuildDataSource querybds;
QueryBuildRange QueryBuildRange;
querybds = this.query().dataSourceTable(tablenum(PwC_TRI_PIS_SAFE_DOCUMENT));
querybds.clearRanges();
querybds.addRange(fieldNum(PwC_TRI_PIS_SAFE_DOCUMENT,RENEWED)).value(enum2Str(PwC_TRI_PIS_PreExecutionAccepted::No));
querybds.addRange(fieldNum(PwC_TRI_PIS_SAFE_DOCUMENT,DOCUMENT_TYPE)).value('INSURANCE');
querybds.addRange(fieldNum(PwC_TRI_PIS_SAFE_DOCUMENT,VALIDITY_DATE)).value(SysQuery::range(validityFromDate , validityToDate));
queryBuildRange = querybds.addRange(fieldNum(PwC_TRI_PIS_SAFE_DOCUMENT, DataAreaId));
queryBuildRange.value(strFmt('((ACCEPTED == %1) || (RECEIVED == "%2"))', any2int(PwC_TRI_PIS_PreExecutionAccepted::Yes), any2int(PwC_PIS_ReceivedType::Yes)));







// queryBuildRange = querybds.addRange(fieldNum(PwC_TRI_PIS_SAFE_DOCUMENT, DataAreaId));



//query=this.query().dataSourceTable(tableNum(PwC_TRI_PIS_SAFE_DOCUMENT));
//query.clearRanges();

//queryBuildRange.value(strFmt('((ACCEPTED == %1) || (RECEIVED == "%2"))', any2int(PwC_TRI_PIS_PreExecutionAccepted::Yes), any2int(PwC_TRI_PIS_PreExecutionAccepted::Yes)));


//query.addRange(fieldNum(PwC_TRI_PIS_SAFE_DOCUMENT,ACCEPTED)).value(strFmt('((ACCEPTED == %1) || (RECEIVED == "%2"))', any2int(PwC_TRI_PIS_PreExecutionAccepted::Yes), any2int(PwC_TRI_PIS_PreExecutionAccepted::Yes)));
//queryBuildRange.value(strFmt('((ACCEPTED == %1) || (RECEIVED == "%2"))', any2int(PwC_TRI_PIS_PreExecutionAccepted::Yes), any2int(PwC_TRI_PIS_PreExecutionAccepted::Yes)));
//query.addRange(fieldNum(PwC_TRI_PIS_SAFE_DOCUMENT,RECEIVED)).value(enum2Str(PwC_TRI_PIS_PreExecutionAccepted::Yes)); */

super();

}

}

[Control("Button")]
class Insurancerenewletter
{
/// <summary>
///
/// </summary>
public void clicked()
{
PwCInsuranceMonitoring_Class tViewCalculation;
;
tViewCalculation = new PwCInsuranceMonitoring_Class();
super();
tViewCalculation.variables_InsuranceMonitoring_Report(validityFromDate,validityToDate,PwC_TRI_PIS_APPLICATION.APPLICATION_NO);
}

}

}

I have the same question (0)

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 616

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 331 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans