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 :

How to add range on AOT query and X++ query with two different columns.

Vijay Yelmame VY Profile Picture Vijay Yelmame VY 476
Hi All,
Let's learn about how to add two different columns range on one column value of range in AOT Query. 


Apply range on AOT Query:


Only the point to be consider is we need to use parenthesis correctly and Proper enum name - 
DocumentStatus::None.

Apply range on X Query.

Override the execute query method of your form Datasource and add below code.

public void executeQuery()
{
    //Clear ranges.
    this.query.dataSourceTable(tableNum(TestAllSOLinesView)).clearRanges();
    
    Query query = new Query(this.query());
    
    
    QueryBuildDataSource TestAllSOLinesView_ds1 = query.dataSourceTable(tableNum(TestAllSOLinesView));
    
    queryBuildRange queryBuildRange = TestAllSOLinesView_ds1.addRange(fieldNum(TestAllSOLinesView, DocumentStatus));
    
    queryBuildRange.value(strFmt('((DocumentStatus == %1) || ((TestConfirmationStatus == "%2") 
    
    && (DocumentStatus != %1)))',any2int(DocumentStatus::None),
    any2int(TestConfirmation::ToBeConfirmed)));
    
    this.query(query);
    
    super();
}

AOT Range on 2 different date columns
Refer below screen shot - I have set the value property with greater than condition on two date columns of my data source.

ex - (TestReqShippingDate > TestAllPOLinesView.TestConfirmedShippingDate)

pastedimage1672133595419v1.png



Thats It. Happy Coding.


This was originally posted
here.

Comments

*This post is locked for comments