Developer Q&A
Link Document URL to Work Order
Hi. I am trying to link a document stored in a web server to a Work Order. First I am validating the Work Order Number with the following XML by providing not the ID but the number (104740947):
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:int="http://corrigo.com/integration/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<int:CorrigoNetOptions>
<int:ImposeConcurrencyId>false</int:ImposeConcurrencyId>
<int:UpdateLastModified>false</int:UpdateLastModified>
<int:CanDeleteMissingEntity>false</int:CanDeleteMissingEntity>
<int:LockOnDataRetrieval>Default</int:LockOnDataRetrieval>
</int:CorrigoNetOptions>
</soap:Header>
<soap:Body>
<int:RetrieveMultiple>
<int:queryExpression xsi:type="int:QueryExpression">
<int:EntityType>WorkOrder</int:EntityType>
<int:PropertySet xsi:type="int:PropertySet">
<int:Properties>
<int:string>Number</int:string>
</int:Properties>
</int:PropertySet>
<int:Count>0</int:Count>
<int:FirstResultIndex>0</int:FirstResultIndex>
<int:Criteria>
<int:Filters>
<int:FilterExpression>
<int:Conditions>
<int:ConditionExpression>
<int:PropertyName>Number</int:PropertyName>
<int:Operator>Equal</int:Operator>
<int:Values>
<int:anyType xsi:type="xsd:string">104740947</int:anyType>
</int:Values>
</int:ConditionExpression>
</int:Conditions>
</int:FilterExpression>
</int:Filters>
</int:Criteria>
<int:Distinct>false</int:Distinct>
</int:queryExpression>
</int:RetrieveMultiple>
</soap:Body>
</soap:Envelope>
For which I get the following response (acknowledging that the entity exists):
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
1001251
false
7
104740947
Unknown
Unknown
Unknown
0
Unknown
0
0
false
0
Unknown
0001-01-01T00:00:00
0001-01-01T00:00:00
0001-01-01T00:00:00
0001-01-01T00:00:00
</soap:Body>
</soap:Envelope>
Then, using the the Work Order ID returned (1001251), I am trying to add a document link to the Work Order with the following xml:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:int="http://corrigo.com/integration/">
<soap:Header>
<int:CorrigoNetOptions>
<int:ImposeConcurrencyId>false</int:ImposeConcurrencyId>
<int:UpdateLastModified>false</int:UpdateLastModified>
<int:CanDeleteMissingEntity>false</int:CanDeleteMissingEntity>
<int:LockOnDataRetrieval>Default</int:LockOnDataRetrieval>
</int:CorrigoNetOptions>
</soap:Header>
<soap:Body>
<int:Execute>
<int:commandRequest xsi:type="int:CreateCommand" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<int:Entity xsi:type="int:Document">
<int:PerformDeletion>false</int:PerformDeletion>
<int:ConcurrencyId>0</int:ConcurrencyId>
<int:ActorId>1001251</int:ActorId>
<int:ActorTypeId>WO</int:ActorTypeId>
<int:Description>TEST DESCRIPTION</int:Description>
<int:Title>TEST TITLE</int:Title>
<int:DocType>
<int:PerformDeletion>false</int:PerformDeletion>
</int:DocType>
<int:EndDate xsi:nil="true"/>
<int:ExtensionId>0</int:ExtensionId>
<int:IsShared>false</int:IsShared>
<int:IsPublic>false</int:IsPublic>
<int:StorageTypeId>URL</int:StorageTypeId>
<int:DocUrl>https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf</int:DocUrl>
<int:MimeType>application/pdf</int:MimeType>
</int:Entity>
</int:commandRequest>
</int:Execute>
</soap:Body>
</soap:Envelope>
For which I get the following xml response:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
Document
160968
1
</soap:Body>
</soap:Envelope>
My understanding is that for the Work Order ID (1001251) the document (160968) was created successfully. But when I enter the portal with my credentials, browse to the Work Order (using the number 104740947), scroll down to documents, I find out that there was no document attached to the Work Order. This API calls were working correctly a couple months ago, but now they are not. Is there something I am missing, or was there something new added that must be included to achieve this operation?
Any help with this will be greatly appreciated. Thanks in advance.