Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Creating Commlog for Customer Agreement via Rest

    Posted Thu October 26, 2023 09:36 AM

    What object structure should I be posting to, to create a commlog for a custmer agreement? I had duplicated PLUSPAGREEMENT and added the commlog object but when I post a comm log I am getting an error that the customer agreement does not exist. I have tried sending Agreement: A10243 and pluspagreementid: 642 and neither find the agreement. 

    Any thoughts on what I am doing wrong?



    ------------------------------
    Christopher Stewart
    ------------------------------


  • 2.  RE: Creating Commlog for Customer Agreement via Rest

    Posted Sat October 28, 2023 04:23 AM

    Hi Christopher,

    Could you please try to send rest call to Maximo and set minimum these three attributes in the body (json):

    • ORGID
    • AGREEMENT
    • REVISIONNUM

    These attributes are set as primary columns in database configuration.



    ------------------------------
    Bartosz Marchewka
    ------------------------------



  • 3.  RE: Creating Commlog for Customer Agreement via Rest

    Posted Mon November 06, 2023 10:14 AM

    Thanks for the help! I was not passing REVISIONNUM. Once I added it, it stopped erroring out. I am getting a 204 successful, but the COMMLOG is not being written to the COMMLOG table. Here is what I am doing. Does anything look incorrect with this?



    ------------------------------
    Christopher Stewart
    ------------------------------



  • 4.  RE: Creating Commlog for Customer Agreement via Rest

    Posted Mon November 06, 2023 05:02 PM

    Hi Christopher,

    I was trying to reproduce your issue but for me communication log was created successfully for customer agreement that is in status REVISED. I also received http code "204 No Content" which is ok. 

    Maybe you can compare my configuration with yours and I hope it will help you to move forward.

    Maximo changes:

    1.New custom relationship between objects PLUSPAGREEMENT and COMMLOG

    Where Clause: ownerid=:pluspagreementid and ownertable = 'PLUSPAGREEMENT'

    2. Custom Object Structure witch objects PLUSPAGREEMENT and COMMLOG
    Sample curl request:
    curl --location 'http://localhost/maxrest/oslc/os/pluspagreement?lean=1' \
    --header 'Content-Type: application/json' \
    --header 'x-method-override: SYNC' \
    --header 'PATCHTYPE: MERGE' \
    --data-raw '{
        "orgid": "ANONYMIZED",
        "agreement": "26417",
        "revisionnum": 0,
        "commlog": [
            {
                "sendfrom": "test@test.com",
                "createdby": "test",
                "subject": "test",
                "message": "test",
                "inboound": true,
                "_action": "Add"
            }
        ]
    }'
    Result in database:


    ------------------------------
    Bartosz Marchewka
    ------------------------------



  • 5.  RE: Creating Commlog for Customer Agreement via Rest

    Posted Tue November 07, 2023 09:54 AM

    Thanks! I was missing the source object for COMMLOG in the agreement structure. I thought I had checked that but I guess not. It is working now.



    ------------------------------
    Christopher Stewart
    ------------------------------