on 04-08-2009 5:50 AM
Hi All,
We are trying to perform Update functionality using MDM4J APIs, but not able to move furthur as we are getting an exception in the code.
Following is the code we are using:
try {
A2iFields a2iFields = new A2iFields();
A2iField statusField = new A2iField("Current_Status");
Value statusVal = new Value(wdContext.currentVn_Status_changeElement.getVa_Changed_Curr_status());
statusField.SetValue(statusVal);
a2iFields.Add(statusField);
A2iField SubstatusField = new A2iField("Current_SubStatus");
Value SubstatusVal = new Value(wdContext.currentVn_Status_changeElement ().getVa_Changed_SubSts());
SubstatusField.SetValue(SubstatusVal);
a2iFields.Add(SubstatusField);
A2iField ProstatusField = new A2iField("Proposal_status");
Value ProstatusVal = new Value(wdContext.currentVn_Status_changeElement().getVa_Changed_Curr_status());
ProstatusField.SetValue(ProstatusVal);
a2iFields.Add(ProstatusField);
A2iField ProSubstatusField = new A2iField("Proposal_SubStatus");
Value ProSubstatusVal = new Value(wdContext.currentVn_Status_changeElement().getVa_Changed_SubSts());
ProSubstatusField.SetValue(ProSubstatusVal);
a2iFields.Add(ProSubstatusField);
A2iIntArray recIds = new A2iIntArray();
int recID = wdThis .wdGetCO_Resource_Availibility_CheckController() .getRecordID(
"Resource_Availibility_Check","Satyam_ID",associateID);
recIds.Add(recID);
ResultSetDefinition rsd = new ResultSetDefinition("Resource_Availibility_Check");
A2iResultSet rs = catalog.GetRecordsById(rsd, recIds);
int updateResult = catalog.UpdateRecord("Resource_Availibility_Check",
recID,rs.GetChangeStampAt(0),a2iFields);
On executing getting the following exception:
java.lang.NumberFormatException: For input string: "Others"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:468)
at java.lang.Integer.parseInt(Integer.java:518)
at a2i.core.Value.ConvertToType(Unknown Source)
at com.a2i.xcat.internal.conversion.StructsToStructsUtil.ConvertFieldsToModifiedFields(Unknown Source)
at a2i.common.CatalogData.UpdateRecord(Unknown Source)
at a2i.common.CatalogData.UpdateRecord(Unknown Source)
at com.satyam.rf.rac.view.VW_Associate_Selection.onActionShadow(VW_Associate_Selection.java:2032)
Line 2032 is teh line of the UpdateRecord method.
Please suggest what could be the problem in this code.
Thanks in Advance,
Becky.
Hi Becky,
Issue seems to be with the below code:
A2iIntArray recIds = new A2iIntArray();
int recID = wdThis .wdGetCO_Resource_Availibility_CheckController() .getRecordID(
"Resource_Availibility_Check","Satyam_ID",associateID);
recIds.Add(recID);
I think you must initialize an int array and put the record Id at index 0 and then try adding.
You can also try commenting the above code and then try to update the record.
Cheers,
Arafat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You might have created all the context elements of type String and trying to put the string value in the number field. Check the field types and context element type, both should be of same type.
Regards,
Jitesh Talreja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.