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)
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);
Comments
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.
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? ](*,)
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.