Method Directive Question

I have been working on a simple method directive for the Capability object. Not used by many (APS required I believe), so probably not a lot of directives on this one. The capability object has the main dataset wtih a description, and then two datasets: resources and additional resources. The user wanted to see the resources in the description so it displays in the various methods (Revision, Job, etc.). Cool. I’ll just read through the resources dataset and concatenate the resource ids, and update the description on every method update. Rabbit stew coming up!

run away monty python GIF

This is the object in the education database:

image

If I dump the dataset as a JSON blob:

image

I get this on an update method:

Json
{
  "Capability": [
    {
      "ColumnNames": 0,
      "Company": "EPIC06",
      "CapabilityID": "Simple",
      "Description": "Simple Machining",
      "Inactive": false,
      "PrimaryResourceGrpID": "HAASHOR",
      "AdditionalResourceRequired": false,
      "SetupGroupRequired": false,
      "CapType": "B",
      "OpCode": "HORMACH",
      "OpStdID": "",
      "SysRevID": 5378377,
      "SysRowID": "25013fba-ad49-49f3-b577-a33b015bfe04",
      "ExternalMES": false,
      "BitFlag": 0,
      "OpCodeOpDesc": "Horizontal Machining",
      "OpStdDescription": "",
      "PrimResGrpIDDescription": "Horizontal Haas Machines",
      "RowMod": "",
      "SpecifiedProperties": "//8D",
      "UserDefinedColumns": {}
    },

    {
      "ColumnNames": 0,
      "Company": "EPIC06",
      "CapabilityID": "Simple",
      "Description": "Simple Machinings ",
      "Inactive": false,
      "PrimaryResourceGrpID": "HAASHOR",
      "AdditionalResourceRequired": false,
      "SetupGroupRequired": false,
      "CapType": "B",
      "OpCode": "HORMACH",
      "OpStdID": "",
      "SysRevID": 5378377,
      "SysRowID": "25013fba-ad49-49f3-b577-a33b015bfe04",
      "ExternalMES": false,
      "BitFlag": 0,
      "OpCodeOpDesc": "Horizontal Machining",
      "OpStdDescription": "",
      "PrimResGrpIDDescription": "Horizontal Haas Machines",
      "RowMod": "U",
      "SpecifiedProperties": "//8D",
      "UserDefinedColumns": {}
    }
  ],
  "CapAddl": [],    
  "CapResLnk": [],  <--------------- Empty?
  "ExtensionTables": []
}

If I create a display widget and put a simple table query to show all resources, it’s blank - even though there are resources on the screen. :thinking:

Which outputs this in a message box:

Capability DS
 
Company,CapabilityID,Description,Inactive,PrimaryResourceGrpID,AdditionalResourceRequired,SetupGroupRequired,CapType,OpCode,OpStdID,SysRevID,SysRowID,ExternalMES,BitFlag,OpCodeOpDesc,OpStdDescription,PrimResGrpIDDescription,RowMod
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EPIC06,Simple,Simple Machining  ,False,HAASHOR,False,False,B,HORMACH,,382626,25013fba-ad49-49f3-b577-a33b015bfe04,False,0,Horizontal Machining,,Horizontal Haas Machines,U
 
 
Resource DS (CapResLnk)
 
Company,CapabilityID,ResourceID,ResourcePriority,ProductionFactor,SetupFactor,SysRevID,SysRowID,ExternalMESSyncRequired,ExternalMESLastSync,BitFlag,CapIDDescription,ResourceDescription,RowMod
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
 
Additional Resource (CapAddl)
 
Company,CapabilityID,CapAddID,Description,ProductionCap,SetupCap,SysRevID,SysRowID,ExternalMESSyncRequired,ExternalMESLastSync,BitFlag,RowMod
---------------------------------------------------------------------------------------------------------------------------------------------

Am I doing something wrong? First contact with support indicates this may be intentional. :thinking:

The system is only going to send in the parts of the data set that it needs to do it’s work. There are a lot of BO’s that work that way. You’ll have to do a lookup. It should be already saved in the database (usually there is an auto-save on move of some sort) so a regular DB lookup should do it.

So in Order Entry, if I wanted to iterate across all the details if I made a change in the OrderHed, I shouldn’t have access to any of the OrderDtl lines?

When you make a change to the line, then move the to head, it saves the change. And vice versa. So the “current changes” aren’t actually very many.

Test it with a BAQ, run the BAQ in various stages of change and see what shows up when.

So in my case, I have the capability. I add or delete a resource. The update method runs. I will only get the new line but not any existing lines . I would have to look up the current object and do the same work as the base class (add or delete) to calculate the new description.

:rabbit2: stew my :peach:

I’m surprised I haven’t run across one of these objects in all these years! :exploding_head:

I’ll play with it…

Sorry Mark, when we talked about this the other day, I didn’t fully grasp what you were asking.

Read Book Club GIF

1 Like

No worries. I’ve just never had my hands tied up like that in a BPM…

image

Sure would be nice to have access to the whole object, you know?

An Epicor Idea maybe?

That would be awfully inefficient.

And you do… you just have to go get it :rofl:

And doing a lookup to bring it in isn’t? :thinking:

You’re only doing a lookup when you need it. If you had whole object all of the time, it would be way worse then just a specific use case lookup.

1 Like

Pardon my ignorance, but isn’t the object there already? I see it in all its glory in the trace dataset on the way out. :person_shrugging:

I know I’m missing something here but I am VERY happy to learn new :poop: !

Then the base pulled it, and did something with it.

I’ll go back up and read, but if you can do this in post, you’re gold.

Of course, the Capability screen hasn’t been Kineticized in 2021.2, so Ima gonna have to install a fresh 2022.2 to watch a trace in the browser to see if the whole dataset is going there or not. Maybe I’m seeing it in the classic client trace because I asked to see full datasets in the trace.

The full dataset is at the client. I could calculate the new description and stuff it into BPMData. Logic in the client tho… :face_vomiting:

Oooh, worse. I could do a Data Directive that updates the Capability every time a resource is added or deleted. :nauseated_face:

Maybe call an Epicor Function in post that updates the description. The UI will not match and might get some “Another user has updated this record…” messages if they make other changes…

We’ll get there. I like me some constraints afterall…

I knew if I waited long enough I wouldn’t have to scroll up.

The client will most likely display whatever it gets back in post from that Update.

Do your thing, and update the returned dataset at the same time.