Hi, Readers.
Last week, the preview environment for Dynamics 365 Business Central 2021 release wave 1 (BC18) is available. Learn more: https://yzhums.com/10601/.
I will continue to test and share some new features that I hope will help.
In-app contextual help improvements:
Business value:
You can now simplify your AL code and return complex types, instead of passing these in the method parameters.
Feature details:
You can now return variables of complex types.
As an example, the following method will take a name and return the first customer record that matches the name. Notice how the signature specifies the return type at the end of the procedure declaration, and how the procedure exits by returning the found customer record.
procedure GetCustomerByName(Name: Text): record Customer;
var
Customer: record Customer;
begin
Customer.SetFilter(Name, ‘@’ + Name + ‘*’); Customer.FindFirst(); exit(Customer);
end;You can use this new feature to call members directly on the returned variable—for example, in expressions. As an example, you could use the above in an IF statement such as “if GetCustomerByName(‘SomeName’).”Balance (LCY)” > 0 then”
So as described in the release plan, you can now return variables of complex types like following. I am so touched that this used to be the dream of every C/AL and AL developer.
I have listed all return types of the BC17.5 and BC18. Hope this will help.
Return types in BC17.5:
Return types in BC18:
All Return types in AL: The red contents are the new types added in BC18.
BC18.0 | BC17.5 |
array | array |
Action | Action |
AuditCategory | |
BigInteger | BigInteger |
BigText | |
Boolean | Boolean |
Byte | Byte |
Char | Char |
Client type | Client type |
Code | Code |
Codeunit | |
DataClassification | DataClassification |
DataScope | DataScope |
Date | Date |
DateFormula | |
DateTime | DateTime |
Decimal | Decimal |
DefaultLayout | DefaultLayout |
Dictionary | |
Duration | Duration |
Enum | Enum |
ErrorInfo | ErrorInfo |
ErrorType | ErrorType |
ExecutionContext | ExecutionContext |
ExecutionMode | ExecutionMode |
FieldClass | FieldClass |
FieldRef | |
FieldType | FieldType |
FilterPageBuilder | |
Guid | Guid |
HttpClient | |
HttpContent | |
HttpHeaders | HttpHeaders |
HttpRequestMessage | |
HttpResponseMessage | |
Instream | |
Integer | Integer |
Interface | |
JsonArray | JsonArray |
JsonObject | JsonObject |
JsonToken | JsonToken |
JsonValue | JsonValue |
KeyRef | |
List | |
ModuleDependencyInfo | ModuleDependencyInfo |
ModuleInfo | ModuleInfo |
Notification | |
NotificationScope | |
ObjectType | ObjectType |
Option | Option |
OutStream | |
Page | |
PageBackgroundTaskErrorLevel | PageBackgroundTaskErrorLevel |
Query | |
Record | |
RecordId | |
RecordRef | |
Report | |
ReportFormat | ReportFormat |
SecurityFilter | SecurityFilter |
SecurityOperationResult | |
SessionSettings | |
TableConnectionType | TableConnectionType |
TelemetryScope | TelemetryScope |
TestPermissions | TestPermissions |
Text | Text |
TextBuilder | TextBuilder |
TextEncoding | TextEncoding |
Time | Time |
TranscationModel | TranscationModel |
TranscationType | TranscationType |
Variant | |
Verbosity | Verbosity |
Version | Version |
XmlAttribute | XmlAttribute |
XmlAttributeCollection | XmlAttributeCollection |
XmlCData | XmlCData |
XmlComment | XmlComment |
XmlDeclaration | XmlDeclaration |
XmlDocument | XmlDocument |
XmlDocumentType | XmlDocumentType |
XmlElement | XmlElement |
XmlNamespaceManager | XmlNamespaceManager |
XmlNameTable | XmlNameTable |
XmlNode | XmlNode |
XmlNodeList | XmlNodeList |
XmlPort | |
XmlProcessingInstruction | XmlProcessingInstruction |
XmlReadOptions | XmlReadOptions |
XmlText | XmlText |
XmlWriteOptions | XmlWriteOptions |
Update 2021/04/15: Information from Dynamics 365 Business Central Launch Event 2021 release wave 1
END
Hope this will help.
Thanks for reading.
ZHU
コメント