on 02-12-2007 10:24 PM
I've been looking in MDM Java API Library Reference Guide, MDM SP4 API JavaDoc, and SDN Forums for information on how to Insert/Update different values in a field in the Main Table of a given repository that belongs to a Lookup Flat Multi-valued Table using the Java API with no success.
I also haven't been successful in adding this values in the same way that I'll add a single value, using the MDM Java API, in a single-value Lookup Table (a2iFields.Add(new A2iField(FIELD_CODE,FIELD_VALUE)) for each value I want to add, like for example:
a2iFields.Add(new A2iField("Country","USA")
a2iFields.Add(new A2iField("Country","Mexico")
a2iFields.Add(new A2iField("Country","Germany")
Can anybody point me to the correct documentation that I need to read to fulfill this task? Or, even better, if someone can post a piece of code, I'll be more thankful.
Thanks for your help.
Hi,
You will have to use A2IStringArray for putting the value in MultiValued field.
Create A2IStringArray. Add all the values you want into that array by Add function. And then pass the array to A2IField array.
Hope this helps.
Thanks and Regards,
Mausam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the help guys, I've already figure that this had to be solved with an Array.
Regards..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
little code example, where you add existing lookup values based on there record id:
int USA = 1;
int GERMANY = 2;
A2iValueArray countryArray = new A2iValueArray();
countryArray.Add(new Value(USA));
countryArray.Add(new Value(GERMANY));
A2iFields record = new A2iFields();
record.Add(new A2iField("Country", new Value(countryArray)));
Please reward points if helpful.
Regards,
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i found this piece of code in the API Reference Guide
A2iFields a2iFields = new A2iFields();
a2iFields.Add(
new A2iField("Part Number", new Value("ABC-123")));
a2iFields.Add(
new A2iField("Manufacturer", new Value(100)));
a2iFields.Add(
new A2iField("Category", new Value(40)));
a2iFields.Add(
new A2iField("Price", new Value(9.90)));
int id =
catalogData.AddRecord("Products", a2iFields, 0, 0);
Perhaps: CreateAddRecordsCommand Method (Returns an object for adding multiple records) is useful for you.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.