Hi all,
I'm currently trying to add a resource in a Job Planning Line record using the OData API. I obtain a Resource Code No and attempt to push this into the Job Planning Line object and update/save. This brings down the entire NAV service and requires a restart.
I have tried multiple ways to populate the Resource field in a Job Planning Line, including:
Creating a Line without a resource then updating one with one later.
Populating the fields that are autocompleted on the form programatically.
Creating a Line with a resource manually, then programatically updating it with another.
Each time, it crashes the system. When a Line is created, the Type is set to Resource, so i'm not sure as to why any time I programatically add anything in the No property of a Job Planning Line, the system crashes.
Is there any way I can programatically set a resource to a Job Planning Line using OData?
Thanks
*This post is locked for comments
Thank you for this post, I was going nuts trying to figure out what I was doing wrong.
I have a similar problem with the Cost field, no matter what I send the value doesnt save. I changed the editable property to true with no success. Any ideas?
That looks like it has worked. Thank you Suresh.
Yes try with <TRUE>
The other properties have <PropertyEditable> and are editable via the web service, what is different about the No. field?
And just to clarify, the Editable Property should have a value of '<TRUE>' ?
In the page 1007 the Editable property for the "No." field,there is a source expression "No.Editable", i think that will always default to false if you are accessing via webservice, can you remove that expression and set it to true and try again.
I believe it's 1007, the object ID of Job Planning Lines, unless I misunderstood your question.
What is the NAV page no. you published ?
Hi Suresh,
The error message is:
Type: Microsoft.Dynamics.Nav.Service.WebMetadata.ServiceBrokerException
HttpStatusCode: InternalServerError
Message: Property "Editable" for No. is invalid!
StackTrace:
at Microsoft.Dynamics.Nav.Service.WebMetadata.MetaControl.IsFieldEditable(NavForm form)
at Microsoft.Dynamics.Nav.Service.ODataServiceProvider.ODataUpdateProviderToNavPage.AssertControlIsEditable(MetaControl control, NavForm form)
at Microsoft.Dynamics.Nav.Service.ODataServiceProvider.ODataUpdateProviderToNavPage.SetValues(ODataResource resource, NavForm form, Dictionary`2 changedValues)
at Microsoft.Dynamics.Nav.Service.ODataServiceProvider.ODataInsertCommand.Execute(NavForm form)
at Microsoft.Dynamics.Nav.Service.ODataServiceProvider.ODataUpdateProvider.ExecutePendingCommands(NavForm form)
at Microsoft.Dynamics.Nav.Service.ODataServiceProvider.NavServiceHelper.<>c__DisplayClass1.<ExecuteUpdateOperation>b__0(NavSession session)
at Microsoft.Dynamics.Nav.Service.ODataServiceProvider.NavServiceHelper.<>c__DisplayClass4.<ExecuteOperation>b__3(NavSession session)
at Microsoft.Dynamics.Nav.Service.ODataServiceProvider.NavServiceHelper.ExecuteOperation[TResult,T1,T2](String companyName, ODataOperation`3 operation, T1 parameter1, T2 parameter2, Boolean isDefaultCompanyRequired)
Source: Microsoft.Dynamics.Nav.Service.WebMetadata
The error confused me as the property is editable in the form itself, so i'm not sure if i've misunderstood what the error message means.
What is the error message you see in the event viewer, when it crashes ?
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156