Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Proofreading

...

  • Get the current processed item (e.g., product):

    Code Block
    languagegroovy
    api.currentItem()

    Sometimes this does not work in the debug mode; then you can use:

    Code Block
    languagegroovy
    if (!api.isDebugMode()) {  return api.currentItem() }


    Code Block
    languagegroovy
    def currentItem = api.currentItem() != null ? api.currentItem() : api.getProduct(api.product("sku")) 
    


  • Get the attribute of the current product:
    • formula: Product("MatNr. 8 Stellen")
    • Groovy: api.product("MatNr. 8 Stellen")
  • Get the parameters for CFS:
    • return api.option("Add Products to Price Grid","Yes","No")?:"Yes"
  • Track the progress when running:
    Admin > Job/TaskTracking > find CFS by its ID

...

  • To look up a certain row:
    • formula:   VLookup(“<PP table name>", “<key of the desired row>")
    • Groovy: api.vLookup("Cockpit_Teile", "Value", "Teile") 
  • Iterate through all rows:

    Code Block
    languagegroovy
    def values = api.findLookupTableValues("Reaktivierte_Stati")
    if (values) {
      for (v in values) {
        def a = v.name
        def b = v.attribute1


...

This sample shows how to set values in additionalInfo[1,2,3] attributes (Extra Info columns) on quotes Quotes and contracts Agreements/Promotions via the header logic. 

Code Block
languagegroovy
//Contract header logic (PromotionManager)
cProcessor.updateField("ROOT", "additionalInfo3", "some text")


//Quote header logic (QuoteConfigurator)
quoteProcessor.updateField("ROOT", "additionalInfo3", "some text")

Get

...

Value of

...

Another Element of the Pricing Logic 

Code Block
languagegroovy
api.getElement("<element_name>")

Get

...

Attribute Value by Name

Code Block
languagegroovy
api.getPropertyByElementName(pgi, "SomeLabel")

...