Skip to main content

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.

Note

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

  1. Search for Job Queue Entries.
  2. Open the list.
  3. 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

FieldValueExplanation
DescriptionUpdate Opportunity Elements from Item ChangesAutomatically generated name
Object Type to RunCodeunit
Object ID to Run72077784Codeunit DYCEACDOppElementManagement
Parameter StringOPPELEMENTUPDATEInternal parameter for update operation
No. of Minutes between Runs5Runs every 5 minutes

What does this Job Queue entry do?

  1. The job queue runs every 5 minutes.
  2. All items and their Default Dimensions are scanned.
  3. For every new combination of the configured dimensions, an Opportunity Element is created.
  4. 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

FieldValueExplanation
DescriptionDelete Unused Opportunity ElementsAutomatically generated name
Object Type to RunCodeunit
Object ID to Run72077784Codeunit DYCEACDOppElementManagement
Parameter StringOPPELEMENTDELETEUNUSEDInternal parameter for delete operation
No. of Minutes between Runs60Runs every 60 minutes

What does this Job Queue entry do?

  1. The job queue runs every 60 minutes.
  2. All existing Opportunity Elements are processed.
  3. For each Opportunity Element, it checks if items with this dimension combination still exist.
  4. 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
Important

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:

  1. Open the job queue entry.
  2. Set Status to Ready.

Monitor Job Queue Entries

Check Log Entries

  1. Open the Job Queue Entry.
  2. Click on Job Queue - Log Entries.
  3. 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:

  1. Open the job queue entry.
  2. Click on Process - Run Once (foreground).
  3. The job queue entry is executed immediately.