BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
Expand all | Collapse all

Not able to get folder/case property value using caseEditable in javascript

  • 1.  Not able to get folder/case property value using caseEditable in javascript

    Posted 08/26/20 09:07 AM

    Hi,

    I have local environment with ICM version is 5.2.1 and able to get the case/folder property value by using below method

    caseEdiatble.getProperty("F_CaseFolder","Property_Name").value

    1) But with ICM 5.3.3 can't able to get the property value using below caseEdiatble.getProperty("F_CaseFolder","TST_DateofIssue") 

    Getting value as null .

    2) I also tried to use method toJSON() but getting case id only (

    /ICMCustomWidgets/icm/custom/pgwidget/customSearchWidget/DataSearchCriteria.js:259 1:{"caseSaveAction":"save","caseId":"809BB973-0000-CE19-B1A8-2FC0B8A70AA6","caseTypeName":"HUN_ComplaintorDispute","properties":[]})


    My question is .. how to get case/folder property value considering either 1) & 2)


    Thanks

    Rajesh



    ------------------------------
    Rajesh Verma
    ------------------------------


  • 2.  RE: Not able to get folder/case property value using caseEditable in javascript

    Posted 09/11/20 01:48 PM
    Hi Rajesh!

    There are a few ways to access the case property values but this is the easiest if you are just wanting to read them:

    var location = "";
    var locationPropName = this.solution.getPrefix()+"_Location";
    if (payload.caseEditable) {
    var theCase= payload.caseEditable.caseObject;
    location= theCase.attributes[locationPropName];
    } else {
    if (payload.change.id == locationPropName)
    location = payload.change.value;
    }
    if (location != "") {
    var mapURL = "\/\/maps.google.ca/maps?output=embed&q=" + location;
    /* alert (mapURL); */
    return mapURL;
    }

    You also have a typo in your caseEdi<ta>ble but I assumed that is just here and not your actual code (right?).

    There is also a method on the caseEditable to load the property values. They are not loaded by default since there could be lots of them and and widgets (like Stages) don't need them. Normally one of the page widgets will do this before you access it from a script but that depends on event timing.

    ------------------------------
    DAVE PERMAN
    ------------------------------