Related entity typedId
Single action triggered on targetPage
.
Supported modules & actions:
+----------------+-------------------------------------------------------------------------+
| Modules | Actions |
+----------------+-------------------------------------------------------------------------+
| Q, CT, RBA, CO | RECALCULATE, SUBMIT, WITHDRAW, APPROVE, REJECT, DUPLICATE, NEW_REVISION |
+----------------+-------------------------------------------------------------------------+
| Q | CONVERT_TO_DEAL, MARK_AS_LOST |
+----------------+-------------------------------------------------------------------------+
| Custom Forms | RECALCULATE, SUBMIT, WITHDRAW, APPROVE, REJECT |
+----------------+-------------------------------------------------------------------------+
| PL, LPG | RECALCULATE |
+----------------+-------------------------------------------------------------------------+
APPROVE
& REJECT
can be used for approving, rejecting current workflow step.
If you want to use them you also need to send workflow step id in targetPageTabState
.
Please note that APPROVE
, REJECT
and WITHDRAW
can only be applied to submitted CLIC items or Custom Forms.
// Part of targetPageState in groovy logic
...
targetPageAction: "APPROVE",
targetPageTabState: "5f4c7ff0-c0cb-4093-b358-73a05a393d4b"
...
// Part of targetPageState in groovy logic
...
targetPageAction: "REJECT",
targetPageTabState: [
currentStepId: "5f4c7ff0-c0cb-4093-b358-73a05a393d4b",
actionComment: "Too expensive"
]
...
// Action SUBMIT
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493758&targetPageAction=SUBMIT
// Action APPROVE
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493284&targetPageAction=APPROVE&targetPageTabState=fb12cb7b-3b0b-4e3e-84b4-282a76991e28
// Action CONVERT_TO_DEAL
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493758&targetPageAction=CONVERT_TO_DEAL
// Action MARK_AS_LOST
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493758&targetPageAction=MARK_AS_LOST
// Action MARK_AS_LOST with lost reason and lost reason comment
// In targetPageTabState is stringified and URI encoded object
// {
// lostReason: "delay",
// lostReasonComment: "Sample comment"
// }
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147494053&targetPageAction=MARK_AS_LOST&targetPageTabState=%7B%22lostReason%22%3A%22delay%22%2C%22lostReasonComment%22%3A%22Sample%20comment%22%7D
// Action SUBMIT
def controller = api.newController()
controller.addLink("Submit Quote P-2147483858", controller.QC_DETAILS_PAGE, [
id : "P-2147483858",
targetPageAction: "SUBMIT"
])
return controller
// Action APPROVE
def controller = api.newController()
controller.addLink("Approve Quote P-2147483858", controller.QC_DETAILS_PAGE, [
id : "P-2147493284"
tpTarget : "same",
tpAction : APPROVE,
targetPageTabState: [
currentStepId: "fb12cb7b-3b0b-4e3e-84b4-282a76991e28",
actionComment: "Approved from context linking"
]
])
return controller
// Action MARK_AS_LOST with lost reason and comment
def controller = api.newController()
controller.addLink("Mark as lost with reason P-2147483858", controller.QC_DETAILS_PAGE, [
id : "P-2147483858",
targetPageAction: "MARK_AS_LOST",
targetPageTabState: [
lostReason: "delay",
lostReasonComment: "Automatic from dashboard"
]
])
return controller
// Action DUPLICATE
def controller = api.newController()
controller.addLink("Duplicate Compensation plan (with Confirm)", controller.SC_PLANS_PAGE, [
id : "CO-3",
targetPageAction: "DUPLICATE",
targetPageConfirm: true,
targetPageConfirmContent: "Do you want to duplicate this compensation plan?"
])
return controller
// Action RECALCULATE price list
def controller = api.newController()
controller.addLink("Recalculate price list 2147483658", controller.PB_PL_PAGE, [
id: "2147483658.PL", // "2147483658" works too
tpAction: "RECALCULATE"
])
return controller
// Action quote NEW_REVISION
def controller = api.newController()
controller.addLink("New revision for Quote 2147494366", controller.QC_DETAILS_PAGE, [
id: "2147494366",
tpAction: "NEW_REVISION"
])
return controller
This will display confirmation dialog with options to set lost reason and lost reason comment for context linking event, when using targetPageAction = 'MARK_AS_LOST'.
It's also possible to configure the displayed modal title and content using targetPageCommentTitle
, targetPageCommentContent
and targetPageCommentPlaceholder
fields.
Please note that, when using targetPageAction = 'MARK_AS_LOST', modal will be displayed only when also using targetPageAddLostReason = true.
Also, remember that when trying to set lost reason and lost reason comment through modal on a quote whose type has no lost reasons options, there will be only a confirmation modal.
def controller = api.newController()
controller.addLink("Mark as lost with reason P-2147483858", controller.QC_DETAILS_PAGE, [
id : "P-2147483858",
targetPageAction: "MARK_AS_LOST",
targetPageAddLostReason: true
])
return controller
This will display comment dialog for context linking event. This parameter alone will display comment dialog with title and content base on other context linking parameters
return [
targetPage : AppPages.QC_NEW_QUOTE,
targetPageState: [
targetPageComment: true
targetPageTarget: 'same',
targetPageFields: [
label : "Test Quote from Context, confirmed",
]
]
]
Define content for comment dialog. If you define this you can omit targetPageComment
.
It can be text or internationalization key. Check targetPageConfirmContent
for usage.
Define text input placeholder for comment dialog. If you define this you can omit targetPageComment
.
It can be text or internationalization key.
Define title for comment dialog. If you define this you can omit targetPageComment
.
It can be text or internationalization key. Check targetPageConfirmTitle
for usage.
This will display confirmation dialog for context linking event. This parameter alone will display confirmation dialog with title and content base on other context linking parameters
return [
targetPage : AppPages.QC_NEW_QUOTE,
targetPageState: [
targetPageConfirm: true,
targetPageTarget: 'same',
targetPageFields: [
label : "Test Quote from Context, confirmed",
]
]
]
Define content for confirmation dialog. If you define this you can omit targetPageConfirm
.
It can be text or internationalization key.
return [
targetPage : AppPages.QC_NEW_QUOTE,
targetPageState: [
targetPageConfirmContent: 'Renamed dialog content',
targetPageTarget: 'same',
targetPageFields: [
label : "Test Quote from Context, confirmed",
]
]
]
Define title for confirmation dialog. If you define this you can omit targetPageConfirm
.
It can be text or internationalization key.
return [
targetPage : AppPages.QC_NEW_QUOTE,
targetPageState: [
targetPageConfirmTitle: 'Renamed dialog title',
targetPageTarget: 'same',
targetPageFields: [
label : "Test Quote from Context, confirmed",
]
]
]
Identifier of context stored in shared web-worker storage, local storage or backend storage.
The targetPageContextId parameter can appear in the URL, but should not be added there on purpose.
Context linking mechanism removes it after use.
Header type for Quotes, Agreement & Promotion Types, Rebate Agreements and Compensation Plans
Can be also used for defining Custom Form Types or for defining Model Class unique name when is used at Model Object
For historic reasons are in Groovy logics also supported
quoteType
, contractType
, rebateType
and compensationHeaderType
which are equivalent to targetPageEntityType
// New RBA with rebate type from URL
.../app/modules/?targetPage=newRebatePage&tpEntityType=FlexibleLayoutNoSider
def controller = api.newController()
controller.addLink("New Quote with header type: Tab_Order_Changed", controller.QC_NEW_QUOTE, [
targetPageEntityType : 'Tab_Order_Changed' // Quote Type - Name
])
return controller
List of fields which work the same way as inputs. See targetPageInputs
// Open a quote and prefill externalRef and targetDate
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493763&tpFields-targetDate=2023-12-24&tpFields-externalRef=654321
// It also supports encoding of names and values, as in targetPageInputs.
return [
targetPage : AppPages.QC_NEW_QUOTE,
targetPageState: [
targetPageFields: [
// "Name of the field": "Value of the filed"
label : "Test Quote from Context",
targetDate : "2022-11-17",
expiryDate : "2022-11-17",
externalRef : "Quote from button",
userGroupViewDetails: "Empty User Group",
userGroupEdit : "e2e_test_users"
]
]
]
Filters will be applied to the table on the target page. A filter can be either an advanced filter (1st example), or a quick filter (2nd example). Advanced filters can be compounded by more than one criteria at once. To combine multiple filters, the possible operators are:
And the possible operators for the filter itself are:
Advanced filters have a JSON structure, as in the example below:
{ "operator": "and", "_constructor": "AdvancedCriteria", "criteria": [ { "fieldName": "sku", "operator": "iContainsPattern", "value": "MB" } ] }
Possible operators for quick filters are:
Please keep in mind that all operators require the structure "{columnName} {operator} {value}", as "sku ~ 0005" means filtering by SKUs that contain "0005". The operators "is null" and "is not null" require only "{columnName} {operator}", like in "sku !#" which means filtering by SKUs that are not null. When using filters on date columns, please note that the structure should be "{columnName} {startDate} {endDate}", where endDate is optional. It is not supported to filter only by endDate. The expected date format is YYYY-MM-DD. You can also use multiple quick filters together separated by comma, like in "id == 1234,status == READY".
If you expect to use "&" character in some quick filter, please encode it manually (%26) because otherwise, as it's used to separate different query string parameters, it won't be correctly parsed.
Filtering is available on the following modules:
@example <caption><code>targetPageFilters</code> in URL params</caption>
?targetPageFilters={"operator":"and","_constructor":"AdvancedCriteria","criteria":[{"fieldName":"sku","operator":"iContainsPattern","value":"MB"}]}
?tpFilters=sku%20~%200005 (encoded from sku ~ 0005)
?tpFilters=uniqueName%20~%20%26%20Something (uniqueName ~ & Something)
?tpFilters=targetDate%202023-07-10%202023-07-20 (targetDate 2023-07-10 2023-07-20)
?tpFilters=targetDate%202023-07-10 (targeDate 2023-07-10)
@example <caption><code>targetPageFilters</code> in Groovy logic</caption>
controller.addButton("Price Records Quick filter - QUOTES", records, [
targetPageTarget : "new",
tpFilters : "status == REVOKED"
])
controller.addButton("Price Records Adanced filter - Contracts", records, [
targetPageTarget : "new",
tpFilters : [
"_constructor": "AdvancedCriteria",
"operator": "and",
"criteria": [
[
"_constructor":"AdvancedCriteria",
"operator":"and",
"criteria": [
[
"fieldName":"status",
"operator":"equals",
"value":"ACTIVE"
],
[
"fieldName":"lineId",
"operator":"iContains",
"value":"X"
]
]
],
[
"criteria" : [
[
"fieldName":"sourceId",
"operator":"notStartsWith",
"value":"P-",
"_constructor": "AdvancedCriteria"
]
],
"operator" :"and"
]
]
]
])
List of inputs and their values which will be fill in at Quotes, Agreement & Promotion Types, Rebate Agreements and Compensation Plans.
In URL you can use format: targetPageInputs-input_name
=input_value
;
Values and names of inputs which contains URL unsafe values has to be encoded by encodeURIComponent:
input name: sampleInput
and value: Multiple words input value with nasty characters like ><#šě&
, has to be passed as
tpInputs-sampleInput=Multiple%20words%20input%20value%20with%20nasty%20characters%20like%20%3E%3C%23%C5%A1%C4%9B%26
.
input name: ě t <>Input
and value: 123
, input name: Name of the Input
and value test value
, have to be passed has to be:
?tpInputs-%C4%9B%20t%20%3C%3EInput=123&tpInputs-Name%20of%20the%20Input=test%20value
.
It is possible to pass objects as value of inputs but the value has to be stringfyied and encoded with encodeURIComponent
Value like this:
targetPageInputs: {
'ě t <>Input': { value: 'A', userEntry: 'B' }
}
can be passed as tpInputs-%C4%9B%20t%20%3C%3EInput=%7B%22value%22%3A%22A%22%2C%22userEntry%22%3A%22B%22%7D
In Groovy logic just to the targetPageState
add targetPageInputs
, which is a key-value map where key is input name and the value is value of this input.
If you need to set value to input which is in another input you can use dot notation to navigate to that input like this:
targetPageInputs: [
// Input stringUserEntry1_collapsible_row1 inside row1 which is in collapsibleSectionWithRow
"collapsibleSectionWithRow.row1.stringUserEntry1_collapsible_row1": "Hello"
]
// Open a quote and prefill externalRef and targetDate
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493763&tpInputs-dateInput=2023-12-24&tpInputs-userEntryInput=654321
return [
targetPage : AppPages.CUSTOM_FORMS_NEW,
targetPageState: [
targetPageEntityType: "36.CFOT",
targetPageInputs : [
"PONumber" : 123,
"Text" : "test\ntest\ntest",
"DateTime" : "2022-11-28T16:02:59.000Z",
"Integer" : 123,
"Date" : "2022-11-28",
"Time" : "17:26",
"Product" : "B-0009",
"MultiTier" : [100: "1", 200: "2", 300: "3"],
"UserEntry" : 123,
"ProductGroup" : ["productFilterCriteria": [
"_constructor": "AdvancedCriteria",
"operator" : "and",
"criteria" : [
[
"fieldName": "attribute4",
"operator" : "equals",
"value" : "Maturity"],
[
"fieldName": "attribute2",
"operator" : "equals",
"value" : "B"]
]
]
],
"CustomerGroup": [
"customerFieldName" : "attribute5",
"customerFieldValue": "Italy",
"customerFieldLabel": "Country",
"label" : "Italy (Country)"],
"SellerGroup" : ["sellerFilterCriteria": [
"_constructor" : "AdvancedCriteria",
"operator" : "and",
"criteria" : [
[
"fieldName": "attribute9",
"operator" : "iContains",
"value" : "EUR"],
],
"Seller" : "SC-003",
"RebateAgreement": "R-2147483651"]
]
]
]]
// Model Object uses slightly different format
def targetPageStateForModelObject = [
targetPageTarget : "new",
targetPageEntityType: "POAI_SLIDER_Test_Eval",
targetPageFields : [
label: "Context Linking Experiment"
],
targetPageInputs : [
// Step name
onetab: [
// Tab name
tab2: [
//Configurator name
InlineConfigurator: [
SliderEntry: 80
]
]
]
]
]
List of items which will be added at targetPage.
Currently supported adding items to Quotes, Agreement & Promotion Types, Rebate Agreements and Compensation Plans, Price Lists and Live Price Grids.
When adding SKUs to a price list, the targetPage should be AppPages.PB_PL_ADD_SKU_PAGE and price list's id should be provided. Same for live price grids, where targetPage should be AppPages.PB_LPG_PAGE and id also must be present.
// Open quote P-2147493280 at items tab and add products MB-0003 & MB-0004
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493280&targetPageItems=MB-0003,MB-0004&tpTab=items
// Contracts
?targetPageItems=conditionTypeName1,conditionTypeName2
// The value has to be encoded by encodeURIComponent for names like 'SKU 1', 'product~Č/#', 'Terrible product name'
?targetPageItems=SKU%201,product~%C4%8C%2F%23,Terrible%20product%20name
return [
targetPage : AppPages.QC_NEW_QUOTE,
targetPageState: [
// List of skus for Quotes. Condition Type names for Agreements & Promotions, Rebate Agreements and Sales Compensation.
targetPageItems: ['B-0001', 'B-0002', 'B-0005'],
// When you add line items, please redirect a user at items tab.
targetPageTab: 'items'
]
]
.../app/modules/#/pb/pricelists/2185392.PL/add?targetPageItems=B-0004,B-0005
def controller = api.newController()
controller.addLink("Add SKUs to a price list", controller.PB_PL_ADD_SKU_PAGE, [
id : "2185392",
targetPageItems : ["B-0004", "B-0005"]
])
return controller
.../app/modules/#/pb/lpgs/219392/detail?targetPageItems=B-0004,B-0005
def controller = api.newController()
controller.addLink("Add SKUs to a live price grid", controller.PB_LPG_PAGE, [
id : "219392",
targetPageItems : ["B-0004", "B-0005"]
])
return controller
List of values for inputs at the line item level with defined type sku
,
contractTermType
, rebateType
or compensationConditionType
.
Please note that when using targetPageItemsStrategy as update
, it is necessary to provide lineId
for each item.
// Create a new quote at items tab and items with prefilled inputs
.../app/modules/?targetPage=newQuotePage&tpTab=items&tpItemsInputs=%5B%7B%22sku%22%3A%22B-0001%22%2C%22ProdClassAdj%22%3A%22C%22%7D%2C%7B%22sku%22%3A%22B-0003%22%7D%2C%7B%22sku%22%3A%22B-0005%22%2C%22Configuration%22%3A%7B%22How%20Many%20Input%20Blocks%3F%22%3A1%2C%22String%20Default%20Value%22%3A%22Test%20targetPageItemsInputs%22%2C%22PRODUCT%20%230%22%3A%22B-0029%22%7D%7D%5D
// Source data for inputs looks like this:
[
{ sku: 'B-0001', ProdClassAdj: 'C' },
{ sku: 'B-0003' },
{
sku: 'B-0005',
Configuration: {
'How Many Input Blocks?': 1,
'String Default Value': 'Test targetPageItemsInputs',
'PRODUCT #0': 'B-0029'
}
}
]
// data were stringifyied and encoded with encodeURIComponent
return [
targetPage : AppPages.QC_NEW_QUOTE,
targetPageState: [
targetPageItemsInputs: [
// Quote line items with input values
[
sku : "B-0001",
ProdClassAdj: "C" // Input type LOOKUP
],
[sku: "B-0003"],
[
sku : "B-0005",
Configuration: [ // Input type CONFIGURATOR
"How Many Input Blocks?": 1,
"String Default Value" : "Test targetPageItemsInputs",
"PRODUCT #0" : "B-0029"
]
]
// For Agreements & Promotions Condition Types
// [
// contractTermType: "PromotionDiscount",
// inputName : "inputValue"
//],
],
targetPageTab : 'items'
]
]
.../app/modules?targetPage=priceShopPage&tpState=P-2147494358&tpTab=items&tpItemsStrategy=update&tpItemsInputs=[{"lineId":"Vm4yOFSz8VtrVTT","Quantity":10},{"lineId":"QlMxau6aTjM30WA","Quantity":10}]
def controller = api.newController()
controller.addLink("Update items inputs at Quote P-2147483700", controller.QC_DETAILS_PAGE, [
id: "P-2147483700",
targetPageState: [
targetPageItemsInputs: [
[
lineId : "Vm4yOFSz8VtrVTT",
Quantity : 3
],
[
lineId : "QlMxau6aTjM30WA",
Quantity : 5
]
],
targetPageItemsStrategy: "update"
])
return controller
Determines the strategy for adding new line items, or updating them:
append
- Keeps existing and appends new ones to the end of CLIC.
delete
- Removes all items from CLIC, then adds new ones.
update
- Updates inputs for the provided items.
// Open quote P-2147493280 at items tab and add products MB-0003 & MB-0004
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493280&targetPageItems=MB-0003,MB-0004&tpTab=items&tpItemsStrategy=delete
// This will open a quote and delete existing items and add there a B-0001, B-0002, B-0003
def controller = api.newController()
controller.addLink("Replace items at Quote P-2147483700", controller.QC_DETAILS_PAGE, [
id : "P-2147483700",
// Open items tab, because of adding items can take time
targetPageTab : "items",
targetPageItems : ["B-0004", "B-0005", "B-0006"],
targetPageItemsStrategy: "delete"
])
return controller
Name of preference which will be applied on the target page.
Preference setting is available on the following methods:
// URL
?targetPagePreference=Preference 1
?tpPreference=Preference 2
Array of typed IDs which will pre-select corresponding rows when opening a page.
Currently selection is available on the following modules:
Please keep in mind that this field uses typed ID intead of SKU, on Price Lists and Live Price Grids, and lineId on CLIC Detail. Beware that for now, when using selection on CLIC Detail, there might be performance issues when trying to select more than i.e. 100 items at once, specially if they are inside folders. Also, when there are multiple pages of items on the CLIC you are opening, your selection might be spread among those pages. Changes will only affect the selection of your current page. Both will be improved in a further version.
@example <caption><code>targetPageSelection</code> in URL params</caption>
?targetPageSelection=11.PGI
?targetPageSelection=183.PLI,184.PLI
@example <caption><code>targetPageSelection</code> in Groovy logic</caption>
def controller = api.newController()
String priceList = "priceListPage";
controller.addLink(
"Price List selection",
priceList,
[
id : "2147483657",
tpSelection : ["2147483666.PLI"]
]
)
Name of the target tab for Quotes, Agreement & Promotion Types, Rebate Agreements and Compensation Plans, you can use these values:
header
, items
, attachments
, workflow
, workflowHistory
, messages
, notes
, actions
, dashboard
.
In case of custom tab use the custom tab name.
// Open a quote at workflow tab
.../app/modules/?targetPage=priceShopPage&targetPageState=P-2147493280&tpTab=workflow
def controller = api.newController()
controller.addLink("Open Quote P-2147483858 at items", controller.QC_DETAILS_PAGE, [
id : "P-2147483858",
targetPageTab: 'items'
])
return controller
Can vary based on targetPage and targetPageTab.
Currently, supported targeting to specific message on the Messages tab, or to passing current workflow step id for approve and reject with targetPageAction
.
// Navigate to quote P-2147483897 and reply to message 3.M
.../app/modules/?targetPage=priceShopPage&targetPageState=2147483897&tpTab=messages&tpTabState=3.M
// or equivalent
.../app/modules/#/qc/quotes/2147483897?tpTab=messages&tpTabState=3.M
def controller = api.newController()
controller.addLink("Reply to message 3.M at quote P-2147483897", controller.QC_DETAILS_PAGE, [
id : "2147483897.Q",
targetPageTab : "messages",
targetPageTabState: "3.M",
])
return controller
Defines if a link is opened in a new
tab or in the same
window.
The default value is a new tab. This parameter makes sense only in Groovy logic.
Duplicating a newly created CLIC module with autosave off will result in an error. This occurs because attempting to duplicate something that hasn’t been saved/created is not valid.
def controller = api.newController()
controller.addLink("Reply to message 3.M at quote P-2147483897", controller.QC_DETAILS_PAGE, [
id : "2147483897.Q",
targetPageTab : "messages",
targetPageTabState: "3.M",
targetPageTarget: "same"
])
return controller
Generated using TypeDoc
In context linking you work with:
targetPage
- page to be redirected toFor details see:
https://pricefx.atlassian.net/wiki/spaces/KB/pages/3874717746/Deep+Linking
It is defined with values from AppPages interface:
https://qa.pricefx.eu/pricefx-api/groovy/develop/net/pricefx/formulaengine/scripting/AppPages.html
targetPageState
- provides params for context linkingFor details see:
https://pricefx.atlassian.net/wiki/spaces/KB/pages/4336648258/Context+Linking
All context linking parameters mentioned bellow support also short name form. You can use full version
targetPageAction
,targetPageEntityType
, etc. or short version liketpPageAction
,tpEntityType
, etc.In case that you need parameters in URL for Salesforce CRM you can use
c__
prefix. For examplec__targetPageTab
.