Use context data from CSD in App Designer

I previously had a context app that receives something like a part number based on what the user is doing in CSD.  I am trying to replicate this in a Widget and build it with the App Designer.  My questions are
1) can you get contextual data from inforBusinessContext to use as an input for an API call? If so, how, and is there any documentation?
2) I see there's a Context Messages section in the app designer, is there any documentation on how to use it?
3) Is there a way to get the operator information from CSD into a widget (using the app designer)?  How, and is there any documentation?
4) Using App Designer, can you add logic to not show anything if the context is not applicable?

Basically for this use case I need to get the product and the operator inits from CSD and use it in my widget.  Any help is appreciated.

  • Theoretically, you can, yes.   Now, my info may be outdated, but the last I recall, context messaging from an app, like CSD, wasn't yet support by App Designer.   You can use context messaging between widgets.   But using iBC messages was still forthcoming (though that may have since changed, I cannot say for sure.)

    That being said, you can write a widget with the widget SDK, and make full use of iBC messages.    App Designer, while being somewhat user / newbie friendly, can be quite limiting.    If need more flexibility then what the App Designer can give you, I encourage you to take a look at the widget SDK.   There's a small learning curve up front, but once over that it's fairly easy to use.

  • 1. Yes OAD widgets can receive IBC messages as input parameters into the API. I made a video demoing this functionality: https://youtu.be/7Q7ybB7sNhE?si=X2wrnu6dGKAU0srB

    2. I have attached the OAD resource guide below with links to all the documentation.

    3. I believe there is an operator API that lists all the CSD operators. Are you wanting that information, or are you trying to receive the operator information of the current user? If there is an API that holds this information, then yes it can be done.

    4. Yes there is an enhancement that is coming out in 2024.08 that will allow the user to specify a default value to be used if the message comes back null or empty. 

    PDF

  • Thank you Caitlin.  I was able to get context data to go into my widget.  However, it ONLY works on the ONE CSD page, the one I took the context message body from the Context Viewer.  If the context body is not identical, it doesn't work.  Even in cases where the context output is basically identical except for the screenId, it just doesn't send anything to the widget.

    In my path of madness, I assumed that the reason was I was selecting the first entity no matter what the context.  So while on ICIP it was $.entities[0].id2, on OEIO it was $.entities[4].id2.  So I added logic to the json path and set it to only pull id2 based on the entityType of ICProductMaster.  Here is my syntax:  $.entities[?(@.entityType=="ICProductMaster")].id2

    Now once I added this, everything stopped working for about 5 hours, no matter what I did.  I finally got frustrated, deleted everything and started over.  And then it was working again.  Well, working at least for the one CSD program (ICIP).  Even if I go to ICIA where the context body in the context viewer is identical except for the data, it doesn't work.  

    Any idea what I am missing here? Surely the context data isn't locked to one CSD program?  

    Here's an example of two context bodies.  The first is from ICIP and the second from ICIA.  It is pulling id2 from the first one just fine, the second it won't.  These are the same except for the screenId and the contextId.  

    {
    "entities": [
    {
    "id1": "1",
    "id2": "100-WX202",
    "id3": "GAL TANK",
    "id4": "; WX-202 ; 310075 ; WX202",
    "entityType": "ICProductMaster",
    "visible": true,
    "readOnly": false,
    "name": "100-WX202",
    "accountingEntity": "1",
    "bodReference": {
    "noun": "ItemMaster",
    "accountingEntity": "1",
    "documentId": "100-WX202"
    },
    "drillbackURL": "?pk=100-WX202&ViewId=icip.detail&LogicalId=lid://infor.sx.sx&accountingEntity=1"
    }
    ],
    "screenId": "sx_icip-detail-overview",
    "logicalId": "lid://infor.sx.sx",
    "originatingTime": 1719269668765,
    "contextId": "1719269668765066294"
    }

    {
    "entities": [
    {
    "id1": "1",
    "id2": "100-WX202",
    "id3": "GAL TANK",
    "id4": "; WX-202 ; 310075 ; WX202",
    "entityType": "ICProductMaster",
    "visible": true,
    "readOnly": false,
    "name": "100-WX202",
    "accountingEntity": "1",
    "bodReference": {
    "noun": "ItemMaster",
    "accountingEntity": "1",
    "documentId": "100-WX202"
    },
    "drillbackURL": "?pk=100-WX202&ViewId=icip.detail&LogicalId=lid://infor.sx.sx&accountingEntity=1"
    }
    ],
    "screenId": "sx_icia-detail-warehouse-availability",
    "logicalId": "lid://infor.sx.sx",
    "originatingTime": 1719271780550,
    "contextId": "1719271780550223762"
    }

    Thanks 

  • Digging deeper, I see in the manifest (if I export the widget after publishing it) that the contextMessages has a specification for screenId.  This means that you can only get context data from one CSD screen for your app.  Is there a way to make this a wildcard, or to remove this limitation?  As mentioned, I don't care what screen it came from in CSD, I just need any id2 from any entity with entityType=='ICProductMaster'.  There are probably 20 different screens in CSD where the context has to do with a product, and specifically with ICProductMaster, and I need the widget to read that product in all 20 cases, not just one.  I don't understand this limitation.

  • Hey there - just talking to product management about this issue, as it stands this functionality currently does not exist. They all deemed it would be a good enhancement request. I am going to document this out and submit it as an enhancement to be able to use a wildcard character (*) for the screenID that way you can reuse a context message over multiple screens.