C# Windows Form w/ Web Service Error - Job Task Dimensions

boone
Member Posts: 23
I'm working on a C# WFA to expedite our Employee, Vendor, Customer, Job, and Job Task creation process. I've gotten the first 4 done perfectly. Everything works great until I come to the Job Tasks. I am able to create Job Tasks under a given Job, pulling in the Dimensions 1 & 2 that are assigned to the main job. I then need to assign Dimensions 3 & 4 to the Tasks. I'm trying to do this through the same method I've used for all the other creations, but I'm receiving the following error:
I've removed all variables to see if a hard-coded record would go in, but it still errors:
The Job_Task_No, Job_No, Dimension_Code, and Dimension_Value_Code all exist.
Anybody have any ideas where I may have gone wrong?
At least one dimensional value code must have a value. Enter a value or delete the Job Task Dimension. . See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.ServiceModel.FaultException: At least one dimension value code must have a value. Enter a value or delete the Job Task Dimension. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at VendorForm.NAVJobTaskDims.JobTaskDims_Port.EndCreate(IAsyncResult result) at VendorForm.NAVJobTaskDims.JobTaskDims_PortClient.VendorForm.NAVJobTaskDims.JobTaskDims_Port.EndCreate(IAsyncResult result) in c:\*FOLDER PATH*\Reference.cs:line 1328 at VendorForm.NAVJobTaskDims.JobTaskDims_PortClient.EndCreate(IAsyncResult result) in c:\*FOLDER PATH*\Reference.cs:line 1333 at VendorForm.NAVJobTaskDims.JobTaskDims_PortClient.OnEndCreate(IAsyncResult result) in c:\*FOLDER PATH*\Reference.cs:line 1343 at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
I've removed all variables to see if a hard-coded record would go in, but it still errors:
private void button9_Click(object sender, EventArgs e) { var bindingtaskdimjob = new BasicHttpBinding(); bindingtaskdimjob.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; bindingtaskdimjob.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; var clienttaskdimjob = new NAVJobTaskDims.JobTaskDims_PortClient( bindingtaskdimjob, new EndpointAddress("http://*WEBSERVICE*/Page/JobTaskDims")); clienttaskdimjob.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Delegation; NAVJobTaskDims.JobTaskDims taskdimjob = new NAVJobTaskDims.JobTaskDims { Job_Task_No = "AST-1", Job_No = "2107-TESTING", Dimension_Code = "BUS UNIT", Dimension_Value_Code = "CS" }; clienttaskdimjob.CreateAsync(taskdimjob);
The Job_Task_No, Job_No, Dimension_Code, and Dimension_Value_Code all exist.
Anybody have any ideas where I may have gone wrong?
0
Comments
-
Hi,
This is indeed an error that one would not expect.
The error message "At least one dimensional value code must have a value" means
that a dimension was setup with the option "Value Posting" ="Code Mandatory",
but the dimension value was not provided.
I would start NAV -> Job Card and go to "2107-TESTING" job.
From there I would navigate to the Job Task "AST-1", and I would try manually to create
dimension "BUS UNIT" with the Dimension Value "CS".
If I get an error message would look what is the cause.
Anyhow there is a code on inserting a Job Task that creates the same dimension for Job task which exist for the job.
So it may be worth to check whether Job "2107-TESTING" has all dimension and dimension values set.
I hope this helps.0 -
Thanks for the response, vremeni4. I am able to insert the dimensions through the Job Card successfully, but I'm still getting the error through my custom Windows Form. I am getting the Dimensions to automatically pull onto the Job Tasks from the main Job, but unfortunately, the main Job will only be designated with DEPARTMENT and COUNTRY, not BUS UNIT and PRODUCT, as there can be multiple BUS UNIT and PRODUCT tasks for the same Job.
Anybody else with any other ideas? Or does somebody maybe have some experience/knowledge that could tell me that this just isn't doable and I'm wasting my time? ](*,)0 -
Hi,
Is it possible to confirm what page do you use
1005 Job Task Dimensions
OR
1006 Job Task Dimensions Multiple
If it is "Job Task Dimensions Multiple" then I would understand the error message. In that case try the page
"Job Task Dimensions" and your code should work
It may be also worth to create a new page e.g. 50000 My Job Task Dimensions. With no code.
Temporary you can comment out the code on the "Job Task Dimension" table. (No Validation or Insert trigger to be run)
Try to insert the record from this new page.
This would identify whether the problem is on the NAV or C# side.
I hope this helps.0 -
Thanks again, vremeni. I can confirm that I am using page 1005 Job Task Dimensions. After growing extremely irritated with the problem, I decided to try a different method, which worked. I am now creating the Tasks using the web service code, as originally planned, but rather than using a similar code to insert the Dimensions, I have written a code to insert the Dimensions directly into the SQL table. It might not be ideal, but it works.0
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