How to Pass Header Input Values to Inline Configurator
If you need to pass Quote, Agreement/Promotion or Rebate Agreement header field values to the inline configurator logic, you can use the api.contextTypedId()
method. This way, you can obtain the TypedId and further work with it (e.g., fetch a Quote).
Agreement/Promotion Header Logic
if (api.isInputGenerationExecution())
return
def configuratorValue = cProcessor.getHelper().getRoot().getInputByName("configurator")?.value
cProcessor.addOrUpdateInput("ROOT",
["name" : "configurator",
"label" : "Configuration",
"type" : "INLINECONFIGURATOR",
"typedId" : api.contextTypedId(),
"url" : "PromotionManagerConfigurator",
"value" : configuratorValue]
)
Agreement/Promotion Configurator Logic
def typedId = api.input("typedId")
def contract = api.find("CT", Filter.equal("id", typedId?.split('\\.')[0]))[0]
//Description
def descriptionParam = ce.createParameter(InputType.STRINGUSERENTRY,"Description")
descriptionParam.setLabel("Description")
descriptionParam.setReadOnly(true)
descriptionParam.setValue(contract.get("label"))
descriptionParam.setParameterGroup("General")
//Start Date
def startDateParam = ce.createParameter(InputType.DATEUSERENTRY,"StartDate")
startDateParam.setLabel("Start Date")
startDateParam.setReadOnly(true)
startDateParam.setParameterGroup("General")
def startDate = api.input("StartDate")
if(!startDate)
startDate = contract.get("startDate")
startDateParam.setValue(startDate)
//Upload Customers
def uploadCustomersParam = ce.createParameter(InputType.PARSABLEINPUTFILE,"UploadCustomers")
uploadCustomersParam.setTypedId(contract.typedId)
uploadCustomersParam.setLabel("Upload Customer(s)")
uploadCustomersParam.setParameterGroup("Upload Customer(s)")
def uploadCustomers = api.input("UploadCustomers")
uploadCustomersParam.setValue(uploadCustomers)
Found an issue in documentation? Write to us.
Â