Opportunity Elements - Job Queue Setup
To ensure Opportunity Elements are automatically updated when item dimensions change, you should set up two tasks for the job queue.
Why Job Queues?
Opportunity Elements are generated from item dimensions. When item master data changes, the Opportunity Elements must be updated:
Scenarios for updates:
- A new item is created with a new dimension combination - new Opportunity Elements must be created.
- An item receives new Default Dimensions - new Opportunity Elements must be created.
- Dimension Values on items are changed - Opportunity Elements must be updated.
- Default Dimensions are removed from items - unused Opportunity Elements must be deleted.
Using job queues, the system updates Opportunity Elements automatically in the background. This requires two tasks for the job queue:
1. Update Opportunity Elements
Creates new Opportunity Elements when new dimension combinations are added to items.
2. Delete unused Opportunity Elements
Deletes Opportunity Elements that no longer exist in the item master data.
When installing the app, these job queue entries are created automatically. They only need to be checked and adjusted if necessary.
Check Job Queue Entries
- Search for Job Queue Entries.
- Open the list.
- Search for the following entries:
- Update Opportunity Elements from Item Changes (Codeunit 72077784)
- Delete Unused Opportunity Elements (Codeunit 72077784)
Job Queue Entry 1: Update Opportunity Elements
Recommended Settings
| Field | Value | Explanation |
|---|---|---|
| Description | Update Opportunity Elements from Item Changes | Automatically generated name |
| Object Type to Run | Codeunit | |
| Object ID to Run | 72077784 | Codeunit DYCEACDOppElementManagement |
| Parameter String | OPPELEMENTUPDATE | Internal parameter for update operation |
| No. of Minutes between Runs | 5 | Runs every 5 minutes |
What does this Job Queue entry do?
- The job queue runs every 5 minutes.
- All items and their Default Dimensions are scanned.
- For every new combination of the configured dimensions, an Opportunity Element is created.
- Existing Opportunity Elements are not duplicated or deleted.
Example:
- Current: HP-Purchase, HP-Rent, Dell-Purchase
- New item is created: Dell Latitude with dimension Dell-Rent
- Job runs - Opportunity Element "Dell-Rent" is created
Job Queue Entry 2: Delete unused Opportunity Elements
Recommended Settings
| Field | Value | Explanation |
|---|---|---|
| Description | Delete Unused Opportunity Elements | Automatically generated name |
| Object Type to Run | Codeunit | |
| Object ID to Run | 72077784 | Codeunit DYCEACDOppElementManagement |
| Parameter String | OPPELEMENTDELETEUNUSED | Internal parameter for delete operation |
| No. of Minutes between Runs | 60 | Runs every 60 minutes |
What does this Job Queue entry do?
- The job queue runs every 60 minutes.
- All existing Opportunity Elements are processed.
- For each Opportunity Element, it checks if items with this dimension combination still exist.
- Opportunity Elements without associated items are deleted.
Example:
- Current: HP-Purchase, HP-Rent, Dell-Purchase, Dell-Rent
- All Dell items are deleted or the dimension "Dell" is removed
- Job runs - Opportunity Elements "Dell-Purchase" and "Dell-Rent" are deleted
This job should not run too frequently, as it checks all Opportunity Elements and items. This can have performance impacts with large amounts of data. An hourly rhythm (60 minutes) is a good compromise between currency and performance.
Activate Job Queue Entries
If the job queue entries are not yet active:
- Open the job queue entry.
- Set Status to Ready.
Monitor Job Queue Entries
Check Log Entries
- Open the Job Queue Entry.
- Click on Job Queue - Log Entries.
- You see all previous executions with status:
- Success: Successfully executed
- Error: Failed, please check the error details
Run Job Queue manually
You can also run a job queue entry manually:
- Open the job queue entry.
- Click on Process - Run Once (foreground).
- The job queue entry is executed immediately.