Thursday, 10 October 2019

HOW TO SELECT MULTIPLE VALUES IN ENUMS IN D365 CODE

HOW TO SELECT MULTIPLE VALUES IN ENUMS IN D365 CODE

Below code is used to select multiple enum values in a while loop via a container..

SalesTable  salesTable;
container   con = [SalesType::Sales, SalesType::ReturnItem];
while select SalesId from salesTable
where salesTable.SalesType in con
{
Info(salesTable.SalesId);
}

THanks,
Vikas Mehta.

1 comment:

  1. And if you want to exclude record in container, you should write where !(salesTable.SalesType in con)

    ReplyDelete

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++  Introduction In our previous posts, we explored what Copilot can do o...