Interface to update one document to another

Hi All


I am trying to update one document with the details of another.  I have a interface that populates with a document (record A) and a dropdown with a list of documents filtered on the company of Record A.


This stores the doucmentID of the document to update Record A with in a rule input.

Ive tried building an sub-interface with the same fields and dropping that to the right to show the details of the record to update from but couldn't drop that into the form (not sure if you can use other interfaces within a form?)

I was using the following within a column:

rule!DMR_V2_documentTypeDetails_Sub( rule!DMR_V2_DocumentType_MasterByID(ri!documentID))

Got the following:

So for now Ive just dropped some text fields and are populating these using a expression rule that grabs the field based on the documentId - however - although it displays the info, its not storing it into the CDT (the display value is using the expression rule, the save into is pointing to the CDT newDocument

So I was then going to kick off a process model that stores the old details of Doc A in a archive then updates it with the details of Record B, however its not storing anything in the newDocument CDT currently.

Am I going about this the right way, or is there a better method?

Thanks
David

  Discussion posts and replies are publicly visible

  • Not sure I completely understand the question, but if you're just trying to use all the values of objectA to create objectB you can use an expression rule to do it.

    local!objectB: 'type!{urn:com:appian:types}OBJECT_B'(
    field1: ri!objectA.field1,
    field2: ri!objectA.field2,
    field3: ri!objectA.field3,
    field4: ri!objectA.field4,
    ...
    )

    Call that expression rule in your process model and then save the resulting objectB with a Write to Datastore Entity

  • hi david

    i understand what you want in interface .

    you need to call 1 rule input first for document_master for incoming document data a . like ri!document_master :store incoming data .

    you need to createlocal variable to store current details like local!new_document:type!documentmaster

    and at the last you  call a!save(ri!documentmater,local!newdocument)