Skip to main content
Solved

Using CreateAndImportDocument.svc/CreateDocument to create new revision


AndreasIsengaard
Sidekick (Partner)
Forum|alt.badge.img+8

Background: Create new documents works fine using CreateAndImportDocument.svc/CreateDocument, but we often want to create a new revision (in order to keep history intact).

Challenge: When we are invoking CreateAndImportDocument.svc/CreateDocument and supplying a new revision parameter, it doesn’t seem to accept the new revision number, e.g. payload looks as following:

{

    "DocClass": "ADDO_TEST",

    "DocNo": "1365783",

    "DocSheet": "1",

    "DocRev": "A2",

    "Title": "some test of ny revision",

    "CreateFileRef": "YES"

}

Even though the new revision does not exist, IFS Cloud throws:

    "error": {

        "code": "DB_OBJECT_EXIST",

        "message": "Resource already in use.",

        "details": [

            {

                "code": 20112,

                "message": "ORA-20112: DocTitle.DOCTITLEDOCNOEXIST: The document number 1365783 already exists."

            }

        ]

    }

 How can we go about creating new revisions in terms of integration? Any pointers is most welcome.

Best answer by Mathias Dahl

Hi Andreas,

Uploading a file and at the same time creating a new revision, or for the matter just creating a new revision, was not on the requirement list when we made that projection. I suggest you create an idea about adding what you need such that we can look into it.

In the meantime, I would have a look at what happens under the Network tab in Chrome's developer tools to see what happens when we create a new revision from the Document Revision page. It looks like two main calls, of which I think you only need the first one:

POST https://MYSERVER/main/ifsapplications/projection/v1/DocumentRevisionHandling.svc/NewRevInfoSet

Here is the payload:

{"ApprovalUpdate":true,"CopyStruct":false,"CopyStructEnabled":false,"CopyAccess":true,"CopyFile":true,"CopyFileEnabled":true,"CopyApprRouting":false,"CopyApprRoutingEnabled":false,"CopyFieldVals":true,"CopyFieldValsEnabled":true,"DocStructsExists":false,"ShowMarkdownText":false,"DocClass":"200","DocNo":"1200826","DocSheet":"1","SrcDocRev":"A1","NewDocRev":"A2","DocRevText":"QQQQ","OldTitleRev":"A1","DocRefCount":"0","MaxListObjCons":"100"}

Not tested but that probably give you a new revision.

Then there is a call to copy the file from the previous revision to the one you just created, but I think you don't need that one.

Of course, since the is a standard projection we don't guarantee that it will not be changed, as I think has been discussed in other places. It is also not an integration projection.

Good luck!

View original
Did this topic help you find an answer to your question?

2 replies

Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2810 replies
  • Answer
  • August 3, 2022

Hi Andreas,

Uploading a file and at the same time creating a new revision, or for the matter just creating a new revision, was not on the requirement list when we made that projection. I suggest you create an idea about adding what you need such that we can look into it.

In the meantime, I would have a look at what happens under the Network tab in Chrome's developer tools to see what happens when we create a new revision from the Document Revision page. It looks like two main calls, of which I think you only need the first one:

POST https://MYSERVER/main/ifsapplications/projection/v1/DocumentRevisionHandling.svc/NewRevInfoSet

Here is the payload:

{"ApprovalUpdate":true,"CopyStruct":false,"CopyStructEnabled":false,"CopyAccess":true,"CopyFile":true,"CopyFileEnabled":true,"CopyApprRouting":false,"CopyApprRoutingEnabled":false,"CopyFieldVals":true,"CopyFieldValsEnabled":true,"DocStructsExists":false,"ShowMarkdownText":false,"DocClass":"200","DocNo":"1200826","DocSheet":"1","SrcDocRev":"A1","NewDocRev":"A2","DocRevText":"QQQQ","OldTitleRev":"A1","DocRefCount":"0","MaxListObjCons":"100"}

Not tested but that probably give you a new revision.

Then there is a call to copy the file from the previous revision to the one you just created, but I think you don't need that one.

Of course, since the is a standard projection we don't guarantee that it will not be changed, as I think has been discussed in other places. It is also not an integration projection.

Good luck!


AndreasIsengaard
Sidekick (Partner)
Forum|alt.badge.img+8

thx Mr Dahl, that’s what I ended up doing - but it is u said, not guaranteed that it won’t change. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings