Problems inserting Job Task through Page Webservice
nf81
Member Posts: 2
Hi everyone,
I have exposed Page 1002 as a web service and want to read (works like a charm) but also insert Job Tasks through an ASP.NET application.
This is the code snippet I'm using:
Inserting the Job Task alone works great. I also want to insert a Job Planning Line at the same time, but as soon as i try to set the "(Resource)No." i get this error:
It makes no difference if i set it before the "Create" or afterwards and then call "Update". When i check the properties of the "No." Field in the subform mentioned the value of Editable is the global "No.Editable" which is set to True in OnInit of the page. So i guess OnInit is not called when operating with page webservices?
What possibilities do i have to work around this? Setting "Editable" to True is not an option and i wan't avoid creating Codeunit Webservices as much as possible (actually i'm no Dynamics NAV developer at all
).
I have exposed Page 1002 as a web service and want to read (works like a charm) but also insert Job Tasks through an ASP.NET application.
This is the code snippet I'm using:
try
{
Job_Planning_Line_Line line = new Job_Planning_Line_Line();
line.Description = description;
line.Job_Task_No = lineNo;
line.Job_No = projectNo;
line.Planning_DateSpecified = true;
line.Planning_Date = DateTime.Now;
//line.No = "MARLIES";
//line.Quantity = hours;
List <Job_Planning_Line_Line> lines = new List<Job_Planning_Line_Line>();
lines.Add(line);
ProjectLines pl = new ProjectLines();
pl.Job_No = projectNo;
pl.Job_Planning_Line_Line = lines.ToArray();
pl.Description = description;
pl.Job_Task_No = lineNo;
pl.Job_Task_Type = Job_Task_Type.Posting;
service.Create(ref pl);
pl.Job_Planning_Line_Line[0].No = "MARLIES";
pl.Job_Planning_Line_Line[0].Quantity = hours;
service.Update(ref pl);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
//throw ex;
}
Inserting the Job Task alone works great. I also want to insert a Job Planning Line at the same time, but as soon as i try to set the "(Resource)No." i get this error:
System.Web.Services.Protocols.SoapException: Property "Editable" for Job Planning Line Subform is invalid!
It makes no difference if i set it before the "Create" or afterwards and then call "Update". When i check the properties of the "No." Field in the subform mentioned the value of Editable is the global "No.Editable" which is set to True in OnInit of the page. So i guess OnInit is not called when operating with page webservices?
What possibilities do i have to work around this? Setting "Editable" to True is not an option and i wan't avoid creating Codeunit Webservices as much as possible (actually i'm no Dynamics NAV developer at all
0
Comments
-
Hi.
The field is not editable in the page!!!
Set the page Editable=true.
Also other fields.0 -
Or, use new page for the webservices. It is much better. In this way, when somebody change the page because he need to add/remove field for the user, it will crash your app. Keeping the Webservice pages as separate pages from the RTC used one, youhave much better control over the WS interface...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 324 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
