Inserting a record from Android into Navsion through SOAP Webservice

prgwar@gmail.com
Member Posts: 1
I am trying to insert a record into Navion through SOAP web Service, I am using Ksoap2 library for making SOAP calls
Below is the TableClass
Public class ESignOrderXSD implements KvmSerializable,Serializable {
public String Key;
public String Ship_To_PO_No;
public String Customer_PO_No;
public String Ship_to_Name;
public int Entry_No;
public String Mobile_Comment;
public String Sell_to_Customer_No;
public String No;
public String Shipment_Date;
public String Ship_to_Code;
public String Sell_to_Customer_Name;
public String BabaBaba;
@Override
public Object getProperty(int i) {
switch (i){
case 0:
return Entry_No;
case 1:
return Sell_to_Customer_No;
case 2:
return No;
case 3:
return Ship_to_Code;
case 4:
return Ship_to_Name;
case 5:
return Shipment_Date;
case 6:
return Sell_to_Customer_Name;
case 7:
return Customer_PO_No;
case 8:
return Ship_To_PO_No;
case 9:
return Mobile_Comment;
case 10:
return BabaBaba ;
default: return null;
}
}
@Override
public int getPropertyCount() {
return 14;
}
@Override
public void setProperty(int i, Object o) {
switch (i){
case 0:
this.Entry_No= (Integer)o;
break;
case 1:
this.Sell_to_Customer_No= (String)o;
break;
case 2:
this.No= (String)o;
break;
case 3:
this.Ship_to_Code= (String)o;
break;
case 4:
this.Ship_to_Name = (String)o;
break;
case 5:
this.Shipment_Date = (String)o;
break;
case 6:
this.Sell_to_Customer_Name= (String)o;
break;
case 7:
this.Customer_PO_No= (String)o;
break;
case 8:
this.Ship_To_PO_No = (String)o;
break;
case 12:
this.Mobile_Comment= (String)o;
break;
case 13:
this.BabaBaba = (String)o;
break;
}
}
@Override
public void getPropertyInfo(int i, Hashtable hashtable, PropertyInfo propertyInfo) {
switch (i){
case 0:
propertyInfo.type = PropertyInfo.INTEGER_CLASS;
propertyInfo.name = "Entry_No";
break;
case 1:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name= "Sell_to_Customer_No";
break;
case 2:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name= "No";
break;
case 3:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name= "Ship_to_Code";
break;
case 4:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Ship_to_Name";
break;
case 5:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Shipment_Date";
break;
case 6:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Sell_to_Customer_Name";
break;
case 7:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Customer_PO_No";
break;
case 8:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Ship_To_PO_No";
break;
case 12:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Mobile_Comment";
break;
case 13:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "BabaBaba";
break;
}
}
}
Here Entry_No is the primary key of the table and its auto incremented
and I am creating a new object of ESignOrderXSD like below
ESignOrderXSD eSignOrderXSD = new ESignOrderXSD();
eSignOrderXSD.setProperty(3,"Test SOPA");
and when I try to post this data i am getting the follwing error
SoapFault - faultcode: 'a:Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException' faultstring: 'You cannot change the value of an AutoIncrement field.
Field: Entry No.
Table: e-Sign Order
Identification fields and values:
Entry No.='0'' faultactor: 'null' detail: org.kxml2.kdom.Node@4175b9a
becuse since Entry_No is an int datatype its assing 0
but if i create a object without Entry_No then its showing
Entry_No cannot be null or Empty so how to create a new record using SOAP webservice in Navsion
Below is the TableClass
Public class ESignOrderXSD implements KvmSerializable,Serializable {
public String Key;
public String Ship_To_PO_No;
public String Customer_PO_No;
public String Ship_to_Name;
public int Entry_No;
public String Mobile_Comment;
public String Sell_to_Customer_No;
public String No;
public String Shipment_Date;
public String Ship_to_Code;
public String Sell_to_Customer_Name;
public String BabaBaba;
@Override
public Object getProperty(int i) {
switch (i){
case 0:
return Entry_No;
case 1:
return Sell_to_Customer_No;
case 2:
return No;
case 3:
return Ship_to_Code;
case 4:
return Ship_to_Name;
case 5:
return Shipment_Date;
case 6:
return Sell_to_Customer_Name;
case 7:
return Customer_PO_No;
case 8:
return Ship_To_PO_No;
case 9:
return Mobile_Comment;
case 10:
return BabaBaba ;
default: return null;
}
}
@Override
public int getPropertyCount() {
return 14;
}
@Override
public void setProperty(int i, Object o) {
switch (i){
case 0:
this.Entry_No= (Integer)o;
break;
case 1:
this.Sell_to_Customer_No= (String)o;
break;
case 2:
this.No= (String)o;
break;
case 3:
this.Ship_to_Code= (String)o;
break;
case 4:
this.Ship_to_Name = (String)o;
break;
case 5:
this.Shipment_Date = (String)o;
break;
case 6:
this.Sell_to_Customer_Name= (String)o;
break;
case 7:
this.Customer_PO_No= (String)o;
break;
case 8:
this.Ship_To_PO_No = (String)o;
break;
case 12:
this.Mobile_Comment= (String)o;
break;
case 13:
this.BabaBaba = (String)o;
break;
}
}
@Override
public void getPropertyInfo(int i, Hashtable hashtable, PropertyInfo propertyInfo) {
switch (i){
case 0:
propertyInfo.type = PropertyInfo.INTEGER_CLASS;
propertyInfo.name = "Entry_No";
break;
case 1:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name= "Sell_to_Customer_No";
break;
case 2:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name= "No";
break;
case 3:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name= "Ship_to_Code";
break;
case 4:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Ship_to_Name";
break;
case 5:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Shipment_Date";
break;
case 6:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Sell_to_Customer_Name";
break;
case 7:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Customer_PO_No";
break;
case 8:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Ship_To_PO_No";
break;
case 12:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "Mobile_Comment";
break;
case 13:
propertyInfo.type = PropertyInfo.STRING_CLASS;
propertyInfo.name = "BabaBaba";
break;
}
}
}
Here Entry_No is the primary key of the table and its auto incremented
and I am creating a new object of ESignOrderXSD like below
ESignOrderXSD eSignOrderXSD = new ESignOrderXSD();
eSignOrderXSD.setProperty(3,"Test SOPA");
and when I try to post this data i am getting the follwing error
SoapFault - faultcode: 'a:Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException' faultstring: 'You cannot change the value of an AutoIncrement field.
Field: Entry No.
Table: e-Sign Order
Identification fields and values:
Entry No.='0'' faultactor: 'null' detail: org.kxml2.kdom.Node@4175b9a
becuse since Entry_No is an int datatype its assing 0
but if i create a object without Entry_No then its showing
Entry_No cannot be null or Empty so how to create a new record using SOAP webservice in Navsion
0
Answers
-
Hi, I think you need to set "Entry No" to 0 before insert. Just my 5 cents, I don't see if you already are.
Kind regards, Gudmundur0 -
You need to set "Entry No" to 0 before insert.Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions