Graphical Scheduler exposes most of its integration events in the codeunit 70097925 IWX Scheduler AL Hooks.
Below are the most common integration events.
OnBeforeProdDispatchSearch()
This gets called before the search filters have been applied when searching production order lines.
Use this to extend searching on production order routing lines. For example, if you have an extension with a custom field that you’d like to search or you would like the search to include additional fields not yet searched, use this event to also search those additional fields.
Syntax
OnBeforeProdDispatchSearch(var ptxtSearch: Text, var precProdOrderRoutingLine: Record “Prod. Order Routing Line”)
Parameters
Parameter | Type | Description |
ptxtSearch | Text | The search text the user supplied. |
precProdOrderRoutingLine | Record “Prod. Order Routing Line” | The production order line record to change filters on. |
OnAfterProdDispatchSearch()
This gets called after the search filters have been applied.
Use this to extend searching on production order routing lines. For example, if you have an extension with a custom field that you’d like to search or you would like the search to include additional fields not yet searched, use this event to also search those additional fields.
Syntax
OnAfterProdDispatchSearch(var ptxtSearch: Text, var precProdOrderRoutingLine: Record “Prod. Order Routing Line”)
Parameters
Parameter | Type | Description |
ptxtSearch | Text | The search text the user supplied. |
precProdOrderRoutingLine | Record “Prod. Order Routing Line” | The production order line record to change filters on. |
OnBeforeJobPlanningLineSearch()
This gets called before the search filters have been applied.
Use this to extend searching on production order routing lines. For example, if you have an extension with a custom field that you’d like to search or you would like the search to include additional fields not yet searched, use this event to also search those additional fields.
Syntax
OnBeforeJobPlanningLineSearch(var ptxtSearch: Text, var precJobPlanningLine: Record “Job Planning Line”)
Parameters
Parameter | Type | Description |
ptxtSearch | Text | The search text the user supplied. |
precJobPlanningLine | Record “Job Planning Line” | The job planning line to add filters to. |
OnAfterJobPlanningLineSearch()
This gets called after the search filters have been applied.
Use this to extend searching on job planning lines. For example, if you have an extension with a custom field that you’d like to search or you would like the search to include additional fields not yet searched, use this event to also search those additional fields.
Syntax
OnAfterJobPlanningLineSearch(var ptxtSearch: Text, var precJobPlanningLine: Record “Job Planning Line”)
Parameters
Parameter | Type | Description |
ptxtSearch | Text | The search text the user supplied. |
precJobPlanningLine | Record “Job Planning Line” | The job planning line to add filters to. |
OnBeforePlanningLineSearch()
This gets called before the search filters have been applied.
Use this to extend searching on planning lines. For example, if you have an extension with a custom field that you’d like to search or you would like the search to include additional fields not yet searched, use this event to also search those additional fields.
Syntax
OnBeforePlanningLineSearch(var ptxtSearch: Text, var precPlanningRoutingLine: Record “Planning Routing Line”)
Parameters
Parameter | Type | Description |
ptxtSearch | Text | The search text the user supplied. |
precPlanningRoutingLine | Record “Planning Routing Line” | The planning routing line to add filters to. |
OnAfterPlanningLineSearch()
This gets called after the search filters have been applied.
Use this to extend searching on planning lines. For example, if you have an extension with a custom field that you’d like to search or you would like the search to include additional fields not yet searched, use this event to also search those additional fields.
Syntax
OnAfterPlanningLineSearch(var ptxtSearch: Text, var precPlanningRoutingLine: Record “Planning Routing Line”)
Parameters
Parameter | Type | Description |
ptxtSearch | Text | The search text the user supplied. |
precPlanningRoutingLine | Record “Planning Routing Line” | The planning routing line to add filters to. |
OnBeforeScheduleChangeBeforeParse()
Consider using OnBeforeScheduleChangeBeforeDataCodeunit first.
This gets called when a schedule change has been triggered, but before the JSON from the javascript has been updated.
This hook can be used to alter the before and after JSON objects prior to them being converted into cells.
Syntax
OnBeforeScheduleChangeBeforeParse(psSourceName: Text, pcodConfig: code[60], pcodEmployeeNo: code[60], ptxtSearch: Text, pjOriginalEvent: JSONObject, pjUpdateRequestObject: JSONObject, var pbHandledAndShouldCancel: Boolean)
Parameters
Parameter | Type | Description |
psSourceName | Text | The data source. |
pcodConfig | code[60] | Only used with Shop Floor Insight; otherwise, ignored. |
pcodEmployeeNo | code[60] | Only used with Shop Floor Insight; otherwise, ignored. |
ptxtSearch | Text | The search text the user supplied. |
pjOriginalEvent | JSONObject | A JSONObject with the original event. |
pjUpdateRequestObject | JSONObject | A JSONObject with only the updated fields. |
pbHandledAndShouldCancel | Boolean | Set to true to replace default behavior. |
OnBeforeScheduleChangeBeforeDataCodeunit()
This occurs when a schedule change has been requested, after the JSON has been parsed into time cells and before the data codeunit has been called. This gives an opportunity to override other datasource providers and is another method to implement handling a write change.
Syntax
OnBeforeScheduleChangeBeforeDataCodeunit(precDataSource: Record “IWX Scheduler DataSource”, pcodConfig: code[60], pcodEmployeeNo: code[60], ptxtSearch: Text, pjOriginalEvent: JSONObject, pjUpdateRequestObject: JSONObject, ptrecBeforeCopy: record “IWX Scheduler Time Cell Buffer” temporary, ptrecAfterCopy: record “IWX Scheduler Time Cell Buffer” temporary, var pbHandledAndShouldCancel: Boolean)
Parameters
Parameter | Type | Description |
precDataSource | Record “IWX Scheduler DataSource” | The datasource involved. |
pcodConfig | code[60] | Only used for Shop Floor Insight; otherwise, ignored.
|
pcodEmployeeNo | code[60] | Only used for Shop Floor Insight; otherwise, ignored. |
ptxtSearch | Text | The search text the user supplied. |
pjOriginalEvent | JSONObject | A JSONObject with the original event. |
pjUpdateRequestObject | JSONObject | A JSONObject with only the updated fields. |
ptrecBeforeCopy | record “IWX Scheduler Time Cell Buffer” temporary | A record representing the cell data before the change. |
ptrecAfterCopy | record “IWX Scheduler Time Cell Buffer” temporary | A record representing the cell data after the change. |
pbHandledAndShouldCancel | Boolean | Set to true to replace product behavior. |
OnCollectEasyConfigOptions()
Subscribe to this event if you want your datasource to show up in a user-friendly list. You are expected to add a new record to the temporary record. Do not replace the existing records.
Syntax
OnCollectEasyConfigOptions(var ptrecEasyConfigOption: Record “IWX Scheduler DataSource” temporary)
Parameters
Parameter | Type | Description |
ptrecEasyConfigOption | Record “IWX Scheduler DataSource” | The temporary record to add additional records to.
|
OnCollectSuggestionsFor()
Subscribe to this event if you want to suggest specific configurations for the supplied record type. This can be used for graphically scheduling from anywhere. You are expected to add a new record to the temporary record. Do not replace the existing records.
Syntax
OnCollectSuggestionsFor(var precRefIn: RecordRef, pfrefDocNo: FieldRef, var ptrecEasyConfigOption: Record “IWX Scheduler DataSource” temporary)
Parameters
Parameter | Type | Description |
precRefIn | RecordRef | The record to make suggestions for. |
pfrefDocNo | FieldRef | The input field document reference. |
ptrecEasyConfigOption | Record “IWX Scheduler DataSource” | Populate the temporary record with the supplied suggestion. |
OnGetSuggestedBasicFieldsFor()
Use to suggest the basic fields for the supplied table number.
Use piTableToSuggest for the table number. precOptionalContext is not necessarily the matching table; precOptionalContext can often be the header table, such as the production order, when piTableToSuggest is the prod order routing line.
This allows you to suggest different fields based on the context of the header. For example, with the sales line table you may suggest different date fields if the header is a quote versus an order or if the order is late or special.
Note: If there are multiple subscribers that provide suggestions for the same table, the system will only use one of the results from one of the subscribers.
Syntax
OnGetSuggestedBasicFieldsFor(piTableToSuggest: Integer, precOptionalContext: RecordRef, var piOutDocFieldNo: Integer, var piOutDocLineFieldNo: Integer, var piOutStartingFieldNo: Integer, var piOutEndingFieldNo: Integer, var piOutCapacityTypeFieldNo: Integer, var piOutCapacityFieldNo: Integer, var piOutSuggestedTreeCodeunit: Integer, var piOutAutoStartFilterFieldNo: Integer)
Parameters
Parameter | Type | Description |
piTableToSuggest | Integer | The input table to provide suggestions for. |
precOptionalContext | RecordRef | May not be supplied; when supplied, is not necessarily the same as piTableToSuggest. |
piOutDocFieldNo | Integer | N/A |
piOutDocLineFieldNo | Integer | N/A |
piOutStartingFieldNo | Integer | N/A |
piOutEndingFieldNo | Integer | N/A |
piOutCapacityTypeFieldNo | Integer | N/A |
piOutCapacityFieldNo | Integer | N/A |
piOutSuggestedTreeCodeunit | Integer | N/A |
piOutAutoStartFilterFieldNo | Integer | N/A |
OnGetTreeProvider()
Subscribe to this event if you are making your own tree provider.
If piCodeunitIn is your provider, you are expected to set ptrProvider to a codeunit instance.
Syntax
OnGetTreeProvider(piCodeunitIn: Integer, var ptrProvider: Interface “IWX Scheduler Tree Provider”)
Parameters
Parameter | Type | Description |
piCodeunitIn | Integer | The codeunit ID. Use this to determine if it is yours. |
ptrProvider | Interface “IWX Scheduler Tree Provider” | An instance of a codeunit that implements this interface. Only populate this when piCodeunitIn is yours. |
OnGetAvailableTreeProviders()
Subscribe to this event to add to the dictionary. Integer equals the codeunit of the provider; Text equals friendly human name of the provider.
Syntax
OnGetAvailableTreeProviders(piOptionalCompatibleWith: Integer, var pdictAddToThis: Dictionary of [Integer, Text])
Parameters
Parameter | Type | Description |
piOptionalCompatibleWith | Integer | When 0, add yourself; otherwise, this represents the table #. Add yourself if you are compatible with this. |
pdictAddToThis | Dictionary of [Integer, Text] | When subscribing to this event, you are expected to add to this dictionary. |
OnBeforeNavigateWithRecordRef()
Obsolete. Do not use. Use OnBeforeNavigateWithRecordRefAndCell instead. Use OnBeforeNavigateWithRecordRefAndCell instead, GS1.6.
Syntax
OnBeforeNavigateWithRecordRef(precRef: RecordRef, pdtStartDateTime: DateTime, pdtEndDateTime: DateTime, var pbHandled: Boolean)
Parameters
Parameter | Type | Description |
precRef | RecordRef | Obsolete |
pdtStartDateTime | DateTime | Obsolete |
pdtEndDateTime | DateTime | Obsolete |
pbHandled | Boolean | Set to true to replace existing behavior. |
OnBeforeNavigateWithRecordRefAndCell()
Occurs before navigation (the Details button).
If you want to replace the navigation behavior, use this event to override the base behavior. OnBeforeNavigateDefaultPage can also be implemented as an alternative if you only want to be informed when a custom table has been navigated.
Syntax
OnBeforeNavigateWithRecordRefAndCell(precRef: RecordRef, var ptrecLastTimeCell: Record “IWX Scheduler Time Cell Buffer” temporary, pdtStartDateTime: DateTime, pdtEndDateTime: DateTime, var pbHandled: Boolean)
Parameters
Parameter | Type | Description |
precRef | RecordRef | The record that will be navigated. |
ptrecLastTimeCell | Record “IWX Scheduler Time Cell Buffer” | The last time cell, and the time cell that supplied the precRef reference. |
pdtStartDateTime | DateTime | Optional use for page loads that need date ranges, such as work center load. |
pdtEndDateTime | DateTime | Optional use for page loads that need date ranges, such as work center load. |
pbHandled | Boolean | Set to true to replace existing behavior. |
OnAfterNavigateWithRecordRef()
Occurs after navigation. If you want to run your logic after navigation has occurred, use this event.
Syntax
OnAfterNavigateWithRecordRef(precRef: RecordRef, pdtStartDateTime: DateTime, pdtEndDateTime: DateTime)
Parameters
Parameter | Type | Description |
precRef | RecordRef | The record that will be navigated.
You may need to re-fetch the record depending on the page that started. |
pdtStartDateTime | DateTime | Optional use for page loads that need date ranges, such as work center load. |
pdtEndDateTime | DateTime | Optional use for page loads that need date ranges, such as work center load. |
OnBeforeNavigateProductionOrder()
Specific to production orders. When navigating to a production order, this gives a chance to change the base behavior.
Syntax
OnBeforeNavigateProductionOrder(precRef: RecordRef, var pbHandled: Boolean)
Parameters
Parameter | Type | Description |
precRef | RecordRef | The record that will be navigated.
You may need to re-fetch the record depending on the page that started. |
pbHandled | Boolean | Set to true to replace existing behavior. |
OnAfterNavigateProductionOrder()
Specific to production orders. After navigating to a production order, this gives a chance to run additional logic after the order has been displayed.
Syntax
OnAfterNavigateProductionOrder(precRef: RecordRef)
Parameters
Parameter | Type | Description |
precRef | RecordRef | The record that will be navigated.
You may need to re-fetch the record depending on the page that started. |
OnBeforeGuessProdOrderRtngLineByConvention()
If you have a custom data provider that references production order related data and want to leverage other built-in functionality (e.g., navigating to the work center), use this event to use the recordref for your custom table and supply a suggested production order line and production order routing line. Without implementing this event, it will guess based on common naming conventions.
If you are showing data that is not related to production orders, do not implement this event.
Syntax
OnBeforeGuessProdOrderRtngLineByConvention(var prrefLastSelectedSourceRow: RecordRef, var precOutProdOrderLine: record “Prod. Order Line”, var precOutProdOrderRtngLine: record “Prod. Order Routing Line”, var pbHandled: Boolean)
Parameters
Parameter | Type | Description |
prrefLastSelectedSourceRow | RecordRef | The source record to find the prod order line and prod order routing line from. |
precOutProdOrderLine | record “Prod. Order Line” | Your preferred production order line. |
precOutProdOrderRtngLine | record “Prod. Order Routing Line” | Your preferred production order routing line. |
pbHandled | Boolean | Set to true to replace existing behavior. |
OnAfterGuessProdOrderRtngLineByConvention()
Similar to OnBeforeGuessProdOrderRtngLineByConvention, but occurs after the system has guessed from convention and after other extensions have supplied their suggestions.
Syntax
OnAfterGuessProdOrderRtngLineByConvention(var prrefLastSelectedSourceRow: RecordRef, var precOutProdOrderLine: record “Prod. Order Line”, var precOutProdOrderRtngLine: record “Prod. Order Routing Line”)
Parameters
Parameter | Type | Description |
prrefLastSelectedSourceRow | RecordRef | The source record to find the prod order line and prod order routing line from. |
precOutProdOrderLine | record “Prod. Order Line” | Your preferred production order line. |
precOutProdOrderRtngLine | record “Prod. Order Routing Line” | Your preferred production order routing line. |
OnBeforeNavigateDefaultPage()
Similar to OnBeforeNavigateWithRecordRefAndCell, but only gets called when the data is not something the app natively recognizes.
If your default page navigation on your custom table already navigates to your preferred page, you do not need to implement this; implement this event only if you want to change which page is used instead.
Syntax
OnBeforeNavigateDefaultPage(precRef: RecordRef, pdtStartDateTime: DateTime, pdtEndDateTime: DateTime, var pbHandled: Boolean)
Parameters
Parameter | Type | Description |
precRef | RecordRef | The record to navigate to. |
pdtStartDateTime | DateTime | Optional use for page loads that need date ranges, such as work center load. |
pdtEndDateTime | DateTime | Optional use for page loads that need date ranges, such as work center load. |
pbHandled | Boolean | Set to true to replace existing behavior. |
OnGetSupportsDocumentZoom()
Implement this if your data provider supports document zooming. Document zooming allows the data provider to zoom to the beginning and end of a document and to filter to a specific document.
By not implementing this, the answer is no.
Syntax
OnGetSupportsDocumentZoom(piCodeunitIn: Integer, var pbOutSupportsZoom: Boolean, var ptxtOutDocumentFieldName: Text, var ptxtOutStartFieldName: Text, var ptxtOutEndFieldName: Text)
Parameters
Parameter | Type | Description |
piCodeunitIn | Integer | The data codeunit being inquired about. |
pbOutSupportsZoom | Boolean | Yes/no whether it supports document zoom. |
ptxtOutDocumentFieldName | Text | The name of the field that represents the document. |
ptxtOutStartFieldName | Text | The name of the field that represents the start date field. |
ptxtOutEndFieldName | Text | The name of the field that represents the end date field. |
OnZoomToDocumentCalculate()
Implement this to provide zoom data for a document. If you implement this, you are expected to supply the start, end, and document no.
Syntax
OnZoomToDocumentCalculate(ptrecLastTimeCell: record “IWX Scheduler Time Cell Buffer” temporary, piDatasourceOfSelectedCell: Integer, ptxtDatasourceZoomField: Text, var pdtOutStart: DateTime, var pdtOutEnd: DateTime, var ptxtOutDocumentNo: Text)
Parameters
Parameter | Type | Description |
ptrecLastTimeCell | record “IWX Scheduler Time Cell Buffer” temporary | The cell containing the data to start zooming on. |
piDatasourceOfSelectedCell | Integer | The data codeunit that supplied the cell. |
ptxtDatasourceZoomField | Text | Input zoom field name. |
pdtOutStart | DateTime | The suggested output start time. |
pdtOutEnd | DateTime | The suggested output end time. |
ptxtOutDocumentNo | Text | The suggested output document no. |
OnBeforeHandlePageEmptyClick()
Implement this if you want to change the behavior or add additional behavior when the user clicks in an empty area of the scheduler.
Syntax
OnBeforeHandlePageEmptyClick(precView: record “IWX Scheduler View”, pdtClickedDateTime: DateTime, var lbHandled: Boolean)
Parameters
Parameter | Type | Description |
precView | record “IWX Scheduler View” | A reference to the view the empty click occurred on. |
pdtClickedDateTime | DateTime | The approximate date and time where the click occurred. This can be 0DT if the scheduler isn’t sure. |
lbHandled | Boolean | Set to true to replace existing behavior. |
OnBeforeHandlePagePartEmptyClick()
Similar to OnBeforeHandlePageEmptyClick, but for the page part instead.
Syntax
OnBeforeHandlePagePartEmptyClick(precView: record “IWX Scheduler View”, pdtClickedDateTime: DateTime, var lbHandled: Boolean)
Parameters
Parameter | Type | Description |
precView | record “IWX Scheduler View” | A reference to the view the empty click occurred on. |
pdtClickedDateTime | DateTime | The approximate date and time where the click occurred. This can be 0DT if the scheduler isn’t sure. |
lbHandled | Boolean | Set to true to replace existing behavior. |
OnAdjustPageCaption()
This gives an opportunity to change the page caption.
Syntax
OnAdjustPageCaption(var ptxtSuggestedCaption: Text, recView: record “IWX Scheduler View”, trecSelectedCellBuffer: record “IWX Scheduler Time Cell Buffer”, eScale: enum “IWX Scheduler Time Scale Enum”, dtHumanStart: DateTime, dtHumanEnd: DateTime, dtCalculatedStart: DateTime, dtCalculatedEnd: DateTime)
Parameters
Parameter | Type | Description |
ptxtSuggestedCaption | Text | The current suggested caption. |
recView | record “IWX Scheduler View” | The current view. |
trecSelectedCellBuffer | record “IWX Scheduler Time Cell Buffer” | The selected cell. |
eScale | enum “IWX Scheduler Time Scale Enum” | The current scale. |
dtHumanStart | DateTime | What the user requested for start. |
dtHumanEnd | DateTime | What the user requested for an end date. |
dtCalculatedStart Type: |
DateTime | What the system calculates as the display start. |
dtCalculatedEnd | DateTime | What the system calculates as the display end. |
OnAdjustPagePartCaption()
This gives an opportunity to change the page part caption. Similar to OnAdjustPageCaption, but when used as a page part.
Syntax
OnAdjustPagePartCaption(var ptxtSuggestedCaption: Text, recView: record “IWX Scheduler View”, trecSelectedCellBuffer: record “IWX Scheduler Time Cell Buffer”, eScale: enum “IWX Scheduler Time Scale Enum”, dtHumanStart: DateTime, dtHumanEnd: DateTime, dtCalculatedStart: DateTime, dtCalculatedEnd: DateTime)
Parameters
Parameter | Type | Description |
ptxtSuggestedCaption | Text | The current suggested caption. |
recView | record “IWX Scheduler View” | The current view. |
trecSelectedCellBuffer | record “IWX Scheduler Time Cell Buffer” | The selected cell. |
eScale | enum “IWX Scheduler Time Scale Enum” | The current scale. |
dtHumanStart | DateTime | What the user requested for start. |
dtHumanEnd | DateTime | What the user requested for an end date. |
dtCalculatedStart | DateTime | What the system calculates as the display start. |
dtCalculatedEnd | DateTime | What the system calculates as the display end. |
OnBeforeGetSuggestedDescriptionAndProbableDocumentNo()
Provides an ability to override the default suggested description and default guessed document number. This is used with the anything provider and document navigation.
If you have implemented OnGetSuggestedBasicFieldsFor, you don’t also need to implement this event.
Syntax
OnBeforeGetSuggestedDescriptionAndProbableDocumentNo(ptxtOptionalPrefix: Text, var precRefIn: RecordRef, var pfrefDocNo: FieldRef, var ptxtOutDescription: Text, var pbHandled: Boolean)
Parameters
Parameter | Type | Description |
ptxtOptionalPrefix | Text | Optional prefix to add to the suggested description. |
precRefIn | RecordRef | Input record reference to the parent record to reference from. This will be the record starting it which may not be the record in the datasource provider. |
pfrefDocNo | FieldRef | Output field reference to the Document No. field you require. |
ptxtOutDescription | Text | Output description. |
pbHandled | Boolean | Set to true if you want to avoid the built-in utility. |
OnAfterGetSuggestedDescriptionAndProbableDocumentNo()
Similar to OnBeforeGetSuggestedDescriptionAndProbableDocumentNo, except this occurs after the system has guessed the document and description.
Syntax
OnAfterGetSuggestedDescriptionAndProbableDocumentNo(ptxtOptionalPrefix: Text, var precRefIn: RecordRef, var pfrefDocNo: FieldRef, var ptxtOutDescription: Text)
Parameters
Parameter | Type | Description |
ptxtOptionalPrefix | Text | Optional prefix to add to the suggested description. |
precRefIn | RecordRef | Input record reference to the parent record to reference from. This will be the record starting it which may not be the record in the datasource provider. |
pfrefDocNo | FieldRef | Output field reference to the Document No. field that you would like to use. |
ptxtOutDescription | Text | Output description. |
OnBeforeDetermineDataFields()
Used to determine the list of data fields.Occurs before the system calculates default data fields. Data fields are fields used as part of the underlying data and data used for the cell templates and tooltip templates. If you are extending behavior of cell templates and tooltip templates, you may also need to extend this.
Syntax
OnBeforeDetermineDataFields(var plstDataFields: List of [Text], var precDatasource: record “IWX Scheduler DataSource”, var pbHandled: Boolean)
Parameters
Parameter | Type | Description |
plstDataFields | List of [Text] | Before sanitization. Add to this list if you have data fields you need above and beyond what the system will calculate. |
precDatasource | record “IWX Scheduler DataSource” | The datasource parameter this is relevant to. |
pbHandled | Boolean | Set to true to override system behavior. |
OnAfterDetermineDataFields()
Used to determine the list of data fields. Occurs after the system calculates default data fields. Similar to OnBeforeDetermineDataFields, but occurs after the system has determined the list of fields.
If you always know you’re adding data fields, this is preferred over OnBeforeDetermineDataFields.
Syntax
OnAfterDetermineDataFields(var plstDataFields: List of [Text], var plstInvalidFields: List of [Text], var precDatasource: record “IWX Scheduler DataSource”)
Parameters
Parameter | Type | Description |
plstDataFields | List of [Text] | Input is a list of sanitized and validated fields. Add to this list if you have data fields you need above and beyond what the system will calculate. |
plstInvalidFields | List of [Text] | List of invalid fields. |
precDatasource | record “IWX Scheduler DataSource” | The datasource parameter this is relevant to. |