on 2013 Jan 31 12:36 PM
Hi ByD studio forum,
recently one of the ByD solution partner raised an interesting questing regarding context dependant codelists. I create this thread to share the question and the answers (provided by Thomas Schneider) to it with the community.
Most of the ByD codelists are context independant and contain a list of unique values. Some of the codelists (i.e. WorkAgreementAdministrativeCategoryCode) are context dependant and the code value is only unique within a certain context, i.e. country, region.
Example - WorkAgreementAdministrativeCategoryCode:
List ID | Code Value | Description |
---|---|---|
AT | 1 | Hourly |
AT | 2 | Salaried Employee |
AT | 3 | Manager |
AU | 1 | Hourly |
AU | 2 | Salaried Employee |
AU | 3 | Manager |
BE | 1 | Hourly |
BE | 2 | Salaried Employee |
BE | 3 | Manager |
BR | 1 | Salaried Employee |
In a custom BO a element typed with an context dependant codelist is defined and should be placed on a custom UI.
import AP.Common.GDT as apCommonGDT;
businessobject CodeListMapping_Test {
element CustomerWorkAgreementAdministrativeCategoryCode : WorkAgreementAdministrativeCategoryCode;
}
In UI-Designer however is the required ListID not available by default:
So how can a ByD studio developer deal with context dependant codelist?
Best regards,
Ralf
Request clarification before answering.
Hi Ralf,
you need the contxt of the GDT in the BO:
import AP.Common.GDT as apCommonGDT;
businessobject CodeListMapping_Test {
element CountryCode : CountryCode;
element CustomerWorkAgreementAdministrativeCategoryCode :
WorkAgreementAdministrativeCategoryCode;
}
As a next step, go to the UI designer, select the data element CustomerWorkAgreementAdministrativeCategoryCode.content, and select "Codelist Context Mapping" from the context menu. You can maintain the context of the structured code as shown in the following figure:
Save and activate the UI model. The result is as follows:
If you set the CountryCode field (via UI or via coding) the Customer....Code code list is filterted by the country code. You can also set the Customer....Code.listID in ABSL code if the element is filled via code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
21 | |
9 | |
7 | |
6 | |
6 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.