Hi All,
Today we are going to see how to create table in email body without using email templates. Please refer below example.
Note - Please make sure your email parameter setup is done and you able to send test email.
Expected result:
Discover essential insights about D365 Finance and Operations (D365FO) through our user-friendly technical blog. Our content covers implementation, customization, troubleshooting, and key trends in D365FO. Stay informed about performance optimization, security updates, and X++ coding techniques. Learn efficient ways for data migration and workflow automation. Simplify your D365FO experience with our expert guidance. Your top resource for D365FO knowledge, designed for easy understanding.#Learn
Dear All,
In this article will see how to create computed column in view. As we all know view are returning records from SQL from multiple tables, but some time we are getting requirement to create calculated column using the available column. Similarly, in below example as well we are going to create calculated column using createdDateTime field of PurchLine table.
We can achieve this requirement using display method, but it will not give you the filter and sorting options so let's learn and implement it together.
Requirement: Return a date difference between CreatedDateTime and today's date and show values to the form grid with filter and sorting should be available on return value column.
Solution: Create computed column on view, add view as a DataSource on form and add computed column field into grid.
Implementation:
Step 1:
Add new static method on view and add code according to your logic.
X++ Code for method -
Step 2: Add computed column on view.
Right click on view and select column according to your requirement.
Step 3: Select method in View method property of new created column.
Step 4: Add DataSource column in form Grid. Assuming you are aware on form design so explaining this step-in details. Link
Step 5: Build and synchronize your project.
Step 6: Verify SQL level changes:
Filter views by name in AxDb and find how your column is created.
SQL view for this computed column.
Step Last: Validate changes on form, try to apply filters and sort using standard sorting functionality.
That's It.
Happy Daxing.
Dear All,
Today, we will explore how to set the count value on Tiles using an X++ query. I encountered this scenario during a recent customization project. This technique is particularly useful when you need to filter the tile data count based on an unbound control on the form, where the control's value is not associated with any of your dataSource columns.
Add an Integer control on the form and upon modification of that control, update the count of the Tile with the condition of records created before a given number of days.
((today's date - Created Date) > number of days given in the control) then show on the count otherwise not.
public void clicked() {
#Task
super();
element.task(#taskRefresh);
}
public TileButtonControlData getData() {
TileButtonControlData ret;
ret = super();
if (FilterNoOfDays.value() != 0) {
int recordCount = element.countFromQuery(queryStr(TestTilePOLInes));
ret.strTileData(any2Str(recordCount));
}
return ret;
}
public Integer countFromQuery(str _query) {
int totalRecords;
Query query = new Query(_query);
QueryRun qr = new QueryRun(query);
while (qr.next()) {
TESTAllPOLinesView dsTest = qr.get(tablenum(TESTAllPOLinesView));
int dateDiff = today() - DateTimeUtil::date(dsTest.CreatedDateTime1);
int filterValue = FilterNoOfDays.value();
if (dateDiff > filterValue) {
totalRecords++;
}
}
return totalRecords;
}
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()
{
}
AOT Range on 2 different date columns
refer below screen shot - I have set the value property with greater than condition on two date column of my data source.
ex - (TestReqShippingDate > TestAllPOLinesView.TestConfirmedShippingDate)
Hi All,
In this article will see how to create multi selection lookup on a form control.
For this we need to create one AOT query like CustTablelookup. for that you can refer the documents provides by Microsoft docs.
Expected Result is below:
Step 1: Create a control on form and set auto declaration property to yes.
Step 2: Override the Init() method of form and add below code.
public class TestLookupTestControl extends FormRun
{
SysLookupMultiSelectCtrl custAccountMultiSelectControl;
}
public void init()
{
super();
custAccountMultiSelectControl = SysLookupMultiSelectCtrl::construct(element,FilterCustAccount, queryStr(CustTablelookup));
}
Thats It. Happy Coding.
Update Values During Data Entity Import in D365FO Updating Field Values During Data Entity Import in Dynamics 365 Finance ...