Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
How to use REST API to update a child object inside an Object structure?
February 27, 2014
2:11 am
Avatar
Ken Gusse
Member
Members
Forum Posts: 4
Member Since:
December 18, 2013
sp_UserOfflineSmall Offline

Hi there,

I created an object structure with parent-child relationship as below. 

 

<AR_NESTSet>
 <ASSET rowstamp=”[0 0 0 0 0 110 -76 -76]”>
  <ASSETID>137</ASSETID>
  <ASSETUID>137</ASSETUID>
  <VENDOR>WES</VENDOR>
  <WORKORDER rowstamp=”[0 0 0 0 0 92 84 123]”>
   <JPNUM>JP1314A</JPNUM>
   <WONUM>41061</WONUM>
   <WOPRIORITY>2</WOPRIORITY>
   <WORKORDERID>615</WORKORDERID>
   <WORKTYPE>PM</WORKTYPE>
   <JOBPLAN rowstamp=”[0 0 0 0 0 12 40 42]”>
    <DESCRIPTION>Conveyor Belt 3 Month Service</DESCRIPTION>
    <JOBPLANID>4</JOBPLANID>
    <JPDURATION>2.0</JPDURATION>
    <JPNUM>JP1314A</JPNUM>
    <STATUS>ACTIVE</STATUS>
    <JOBTASK rowstamp=”[0 0 0 0 0 1 -126 27]”>
     <DESCRIPTION>INSPECT SWITCHES…</DESCRIPTION>
     <JOBPLANID>4</JOBPLANID>
     <JOBTASKID>35</JOBTASKID>
     <JPTASK>10</JPTASK>
    </JOBTASK>
    <JOBTASK rowstamp=”[0 0 0 0 0 1 -125 84]”>
     <DESCRIPTION>INSPECT DRIVE MOTOR AND MOUNTS</DESCRIPTION>
     <JOBPLANID>4</JOBPLANID>
     <JOBTASKID>39</JOBTASKID>
     <JPTASK>20</JPTASK>
    </JOBTASK>
   </JOBPLAN>
  </WORKORDER>
 </ASSET>
</AR_NESTSet>

 

The ASSET contains WORKORDER which contains JOBPLAN which contains JOBTASK. If I want to update the description of the WORKORDER(id=615) by REST API, what is the correct query?

 

I have tried a post like http://hostname/maxrest/rest/os/ar_nest/137?workorder.615.description=newdesc

But get the errror:

Error 400: BMXAA4195E - The Work Order field requires a value.

Thanks for any help.
March 11, 2016
10:32 am
Avatar
mathanjey
New Member
Members
Forum Posts: 1
Member Since:
March 11, 2016
sp_UserOfflineSmall Offline

In order to update the workOrder description which i assume as the parent object. please try as below (directly give the column name as query parameter)

http://hostname/maxrest/rest/o…..on=newdesc

In order to update child objects, Please try as below (Assuming Worklog as child object) and hope the same applies for your Job plan.

http://hostname/maxrest/rest/o…..N=Updating the work log entry 

 

Thanks

Mathan J

Forum Timezone: America/New_York

Most Users Ever Online: 54

Currently Online:
1 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

sun kim: 60

madd0g17: 59

v.barsamov: 51

cgregory: 45

Maximofresher: 45

matta0990: 33

Member Stats:

Guest Posters: 0

Members: 14366

Moderators: 0

Admins: 4

Forum Stats:

Groups: 1

Forums: 8

Topics: 1580

Posts: 4295

Newest Members:

Megan Morgan, Devendra Verma, stephen stephens, maxexpertise Hilal, Jeroen van Proosdij, Neeraja N

Administrators: Chon: 1118, kristensibilia: 0, Joe Grassia: 0, bpaik: 0