Hi Community,
Anyone assist us that how can make a LOV of existing field in Aurena upd13.
Thank in advance
Hi Community,
Anyone assist us that how can make a LOV of existing field in Aurena upd13.
Thank in advance
LOV is a dropdown list of references that display values of one or more database columns.
Example 1
This is a simple example using a reference and a selector
Client file:
lov CalendarIdRef with CalendarIdRefSelector {
size = Small;
}
selector CalendarIdRefSelector for WorkTimeCalendar {
static CalendarId;
static Description;
static Objstate;
}
Projection file:
@Override
entity LaborClass {
reference CalendarIdRef(CalendarId) to WorkTimeCalendar(CalendarId) {
label = "Calendar ID";
}
}
Example 2
Using a query and a list for the advanced view
Client file:
lov LineProgramRef with LineProgramSelector using LineProgramLovs {
label = "Program";
required = false];
description = LineProgramRef.Description;
format = uppercase;
maxlength = 10;
advancedview LineProgramLovList;
}
@DynamicComponentDependency PROJ
selector LineProgramSelector for LineProgramLov {
title = "Program";
field ProgramId;
field Description;
}
@DynamicComponentDependency PROJ
list LineProgramLovList for LineProgramLov {
label = "Program";
static Company;
static ProgramId;
static Description;
}
Projection file:
@DynamicComponentDependency PROJ
entityset LineProgramLovs for LineProgramLov;
@DynamicComponentDependency PROJ
reference LineProgramRef(Company, LineProgramId) to LineProgramLov(Company,
ProgramId);
@DynamicComponentDependency PROJ
query LineProgramLov {
from = "project_program_lov";
where = "objstate in ('Active')";
keys = Company, ProgramId;
attribute Company Text;
attribute ProgramId Text;
attribute Description Text;
}
Example 3
Dynamically change values in LOV dropdown
Scenario
Instead of always getting the same records loaded into LOV dropdown there might be scenarios where you need to show a filtered set of values based on the other attributed in the record. For example, consider a driver who has the license to drive Manual vehicles, he is allowed to select a vehicle with Manual or Automatic transmission from the List of Vehicles, but a driver who has Automatic only driving license should only be able to pick the vehicles with Automatic transmission. It is always good to hide the unavailable LOV options for the user. To implement this in UXx you can use a function which returns a collection of entities as the data source for the LOV instead of an entityset. At runtime you can pass the values from other attributes as parameters into the function. In the function you can apply the necessary logic and send back the filtered set of records to the LOV. In this case you have the flexibility of writing any logic to get the correct records out of the function
Implementation
reference MainRepresentativeRef(MainRepresentativeId) to
BusinessRepresentative(RepresentativeId);
function GetRepresentatives List<Entity(BusinessRepresentative)> {
parameter RepresentativeId Text;
where = "representative_id LIKE SUBSTR(:RepresentativeId,1,1)||'%'";
}
function GetRepresentatives List<Entity(BusinessRepresentative)> {
parameter RepresentativeId Text;
}
FUNCTION Get_Representatives___(
representative_id_ IN VARCHAR2 ) RETURN Objid_Arr
IS
base_collection_ Objid_Arr := Objid_Arr();CURSOR Get IS
2018-10-29
144
SELECT *
FROM BUSINESS_REPRESENTATIVE
WHERE representative_id LIKE SUBSTR(representative_id_,1,1)||'%';
BEGIN
FOR rec_ IN Get LOOP
base_collection_.extend;
base_collection_(base_collection_.last) := rec_.objid;
END LOOP;
RETURN base_collection_;
END Get_Representatives___;
group MainRepresentativeGroup for Activity {
lov MainRepresentativeRef with RepresentativeSelector using
GetRepresentatives(MainRepresentativeId) {
label = "Main Representative Id";
}
}
You can use the same reference with different LOVs populated using different entitysets and functions. In this way you can make sure that the user will get only the available options in the LOV.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.