on 07-03-2015 5:14 PM
Hello Experts,
Can we create composite key declaration Inside the BO definition ?
I tired by declaring
[AlternativeKey] [Label("Attribute ID")] element AttributeID:ID;
[AlternativeKey] [Label("Attribute Value")] element AttributeValue:LANGUAGEINDEPENDENT_LONG_Text;
But while maintaining the data if am trying to maintain the data it considering only the attribute as key .
My requirement is to consider Attribute ID and Attribute Value as Composite key.
Regards,
Papps
Hi Papps,
As per my understanding, you want to consider the 2 fiels as the alternative key?
if it is, i think you can try create 3 fields in your BO, 2 of them are Attr ID, Attr Value(do not use AK annotation), and with the 3rd one, for example "combinedAK" to be defined as AK element.
and in your script : conbimedAK = AttrID + AttrValue;
And this result will be considered as AK value.
Regards,
Qiang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Qiang,
Thanks for your reply,
If I understood correctly in the BO I will have those 2 elements but not declaring it as Key , the third element which will be concatenate value of the first two. That I can define as a Key. and in the script I will concatenate the two elements to the third one which is key.
So which Script should I use for doing this ? is it ONLOAD or AFTERMODIFY
would you please provide some more information for this ?
Regrads,
Papps
Hello Horst,
The approach provided by Qiang is working fine .
But by that approach the OVS has suffered and am getting error now on the OVS .
If you find a data type with 2 components which match your requirement you can use that one.
for this point would you please provide one example.
Regards,
Papps
Hello Papps,
I just played around and found the structure FormattedPostalAddress.
It has 3 elements
I used this
[AlternativeKey] element Key : FormattedPostalAddress;
to define the structured key.
It worked (Retrieve via AlternativeKey) for instances filled with only one element as well as with two or with all elements.
I didn't checked it via OVS.
Left this for you.
HTH,
Horst
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.