Table Extensions:
1) Supported Chain of Command which includes non- implemented base
methods. Enable Chain of Command to target method overrides that have not been
implemented to tables.
2) Chain of command methods are support try-catch- final blocks.
Form Extensions:
1)
Changing form patterns: Enable
changing a form to use a custom pattern using a form extension
2) Edit work
flow properties:
Allow a form extension to
add workflow to a form by editing WorkflowEnabled, WorkflowDataSource,
and WorkflowType.
As an example: Create a form extension for Salestable and edited WorkflowEnabled,
WorkflowDataSource, and WorkflowType. Enable Chain of Command for form methods
by overriding the canSubmitToWorkflow method. as shown below
3) Enable CoC
methods to implement for form-nested concepts,
such as data sources, data fields, and controls.
CoC for Form Data source method:
[ExtensionOf(formdatasourcestr(HcmWorker,
HcmWorker))]
final
class Demo_Extension
{
public boolean validateWrite()
{
boolean ret;
ret =
next validateWrite();
if (ret)
{
info("added additional
validation"); // Custom code
}
return ret;
}
CoC for Form Data source field methods:
[ExtensionOfformdatafieldstr((HcmWorker,
HcmWorker, person))]
final class Demo_Extension
{
public boolean validateWrite()
{
boolean ret;
ret =
next validateWrite();
if (ret)
{
info("added additional
validation");
}
return ret;
}
}
CoC for Form controls methods:
[ExtensionOf(formControlStr(HcmWorker,
TabPage))]
final class FormButton1_Extension
{
public void pageActivated()
{
next pageActivated();
dePaneController.parmUsePluralLabels(false);
}
}
4) Allow changes to UseCaptionFromMenuItem on forms .
5) Allow changes to NeedsRecord and SaveRecord on buttons
6) Allow changes to AllowEdit and NeededPermission on form controls
Query
Extensions:
1) Enable query
extension to add a root data source to a union query:
A union query returns the specified
data for each record in each data source. In the below example added new root
data source to the existing union query DirQuery and used union type as “union
All” which include duplicate records.
Use the below property in the union query Union to eliminate duplicate records and UnionAll to
include duplicate records.
2) query object support for set-based update
statements via an update_recordset/ Insert_recordset method.
As an example:
VendAccruedPurchasesDP class difference between the old and new version of
code. Refactored insert operation with
the help of query object.
Implemented below logic for query
object via insert_recordset method in the below example:
PurchTable purchTableTmp, purchtableloc;
Query query = new Query();
purchtableloc = PurchTable::find("000021");
QueryBuildDataSource qbds = query.addDataSource(purchtableloc.TableId);
qbds.addSelectionField(fieldNum(PurchTable, PurchId));
qbds.addGroupByField(fieldNum(PurchTable, PurchId));
Map purchmap = new Map(Types::String, Types::Container);
purchmap.insert(fieldStr(PurchTable, PurchId), [qbds.uniqueId(), fieldStr(PurchTable,PurchId)]);
Query::insert_recordset(purchtableloc, purchMap, query);
PurchTable purchTableTmp, purchtableloc;
Query query = new Query();
purchtableloc = PurchTable::find("000021");
QueryBuildDataSource qbds = query.addDataSource(purchtableloc.TableId);
qbds.addSelectionField(fieldNum(PurchTable, PurchId));
qbds.addGroupByField(fieldNum(PurchTable, PurchId));
Map purchmap = new Map(Types::String, Types::Container);
purchmap.insert(fieldStr(PurchTable, PurchId), [qbds.uniqueId(), fieldStr(PurchTable,PurchId)]);
Query::insert_recordset(purchtableloc, purchMap, query);
Data Entities
Extension:
1) Enable Chain of Command for data entities methods.
2) Enable
setting SupportsSetBasedSqlOperations on data entity view extensions. Yes, can only be set if all extensions have it set to Yes
including the base element. If any extension or the base element has the value
set to No, then runtime result will be No
a. As an example : FMCustomerEntity, during entity extension followed
below steps
b. Created new filed through extension in the FMCustomerEntity
c. Create COC for the postLoad() and implemented logic for the newly
created virtual filed.
d. Created COC for the mapEntityToDataSource() and assign the value to
the Data entity
3) Subscribe to data events such as preceding / succeeding handlers
4) Non-implemented base method through CoC
No comments:
Post a Comment