{
  "eventsAndFunctions": [
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "OpenInContainer",
            "expressionIcon": "\"\"",
            "expressionStartModel": "{}",
            "expressionTitle": "\"\"",
            "uiComponentName": "CmpSearchVendorsFilter",
            "widgetNameContainer": "filterContainer"
          },
          {
            "command": "Refresh",
            "widgetName": "partyCards"
          }
        ],
        "typeReturn": "any",
        "variables": []
      },
      "name": "main_init"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "args",
            "type": "ArgsLoadRecords"
          }
        ],
        "statements": [
          {
            "command": "Set",
            "expression": "[]",
            "variableName": "filters"
          },
          {
            "command": "Set",
            "expression": "[]",
            "variableName": "sortBy"
          },
          {
            "command": "Push",
            "expressionItem": "\"!IsNull(Party.RefId)\"",
            "variableNameList": "filters"
          },
          {
            "command": "Push",
            "expressionItem": "\"Desc(PartyRoleId)\"",
            "variableNameList": "sortBy"
          },
          {
            "command": "Set",
            "expression": "{}",
            "variableName": "argsList"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "filterPartyType",
            "variableName": "filterPartyType"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "filterLetter",
            "variableName": "filterLetter"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "filterName",
            "variableName": "partyName"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "command": "Push",
                    "expressionItem": "Concat(\"Like(Name, '%'_'\", ^partyName, \"'_'%')\")",
                    "variableNameList": "filters"
                  }
                ],
                "command": "If",
                "expression": "!IsNull(^partyName)"
              }
            ],
            "command": "If",
            "expression": "IsNull(^filterLetter)"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "command": "Push",
                    "expressionItem": "Concat(\"Like(Name, '\", ^filterLetter, \"'_'%')\")",
                    "variableNameList": "filters"
                  }
                ],
                "command": "If",
                "expression": "^filterLetter != \"All\""
              }
            ],
            "command": "Else"
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "\"1\"",
                "variableName": "filterPartyType"
              }
            ],
            "command": "If",
            "expression": "IsNull(^filterPartyType)"
          },
          {
            "command": "Push",
            "expressionItem": "\"Party.RefType == 'Individual'\"",
            "variableNameList": "filters"
          },
          {
            "command": "Push",
            "expressionItem": "\"In(PartyRoleSpec.Code, 'Vendor')\"",
            "variableNameList": "filters"
          },
          {
            "command": "Set",
            "expression": "{ offset: ^args.offset, limit: ^args.limit, filters: ^filters, sortBy: ^sortBy }",
            "variableName": "argsList"
          },
          {
            "command": "Set",
            "expression": "MsBusiness.GetPrPartyRoles(^argsList)",
            "variableName": "list"
          },
          {
            "children": [
              {
                "children": [],
                "command": "ForEach",
                "expressionList": "^list",
                "variableNameItem": "partyRole"
              }
            ],
            "command": "If",
            "expression": "!IsNull(^list)"
          },
          {
            "command": "Return",
            "expression": "^list"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "filters",
            "type": "list(string)"
          },
          {
            "name": "sortBy",
            "type": "list(string)"
          },
          {
            "name": "partyName",
            "type": "string"
          },
          {
            "name": "filterPartyType",
            "type": "string"
          },
          {
            "name": "filterLetter",
            "type": "string"
          },
          {
            "name": "argsList",
            "type": "MsBusiness.ArgsGetPrPartyRoles"
          },
          {
            "name": "partyRole",
            "type": "MsBusiness.PrPartyRole"
          },
          {
            "name": "list",
            "type": "list(MsBusiness.PrPartyRole)"
          }
        ]
      },
      "name": "partyCards_loadRecords"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "data",
            "type": "any"
          }
        ],
        "statements": [
          {
            "children": [
              {
                "command": "Refresh",
                "widgetName": "partyCards"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "filterName"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "filterPartyType"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "filterLetter"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "mainPartyId"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "personId"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "personType"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "partyRoleId"
              }
            ],
            "command": "If",
            "expression": "!IsNull(data.removeFilter)"
          },
          {
            "children": [
              {
                "command": "WriteModel",
                "expression": "^data.filterName",
                "modelVariableName": "filterName"
              },
              {
                "command": "WriteModel",
                "expression": "^data.filterPartyType",
                "modelVariableName": "filterPartyType"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "filterLetter"
              },
              {
                "command": "Refresh",
                "widgetName": "partyCards"
              }
            ],
            "command": "ElseIf",
            "expression": "!IsNull(data.searchByFilter)"
          },
          {
            "children": [
              {
                "command": "WriteModel",
                "expression": "^data.filterLetter",
                "modelVariableName": "filterLetter"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "filterName"
              },
              {
                "command": "WriteModel",
                "expression": "null",
                "modelVariableName": "filterPartyType"
              },
              {
                "command": "Refresh",
                "widgetName": "partyCards"
              }
            ],
            "command": "ElseIf",
            "expression": "!IsNull(data.searchByLetter)"
          }
        ],
        "typeReturn": "any",
        "variables": []
      },
      "name": "main_receiveData"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "recordRef",
            "type": "string"
          }
        ],
        "statements": [
          {
            "command": "ReadRecord",
            "expressionRecordRef": "^recordRef",
            "variableName": "partyRole",
            "widgetName": "partyCards"
          },
          {
            "command": "WriteModel",
            "expression": "^partyRole.partyRoleId",
            "modelVariableName": "partyRoleId"
          },
          {
            "command": "WriteModel",
            "expression": "^partyRole.personId",
            "modelVariableName": "personId"
          },
          {
            "command": "WriteModel",
            "expression": "^partyRole.personType",
            "modelVariableName": "personType"
          },
          {
            "command": "WriteModel",
            "expression": "^partyRole.partyId",
            "modelVariableName": "mainPartyId"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "partyRole",
            "type": "MsBusiness.PrPartyRole"
          }
        ]
      },
      "name": "partyCards_selectRecord"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [],
        "typeReturn": "any",
        "variables": []
      },
      "name": "main_submit"
    }
  ],
  "model": [
    {
      "name": "userCredential",
      "required": false,
      "type": "string"
    },
    {
      "name": "partyRoleId",
      "required": false,
      "type": "string"
    },
    {
      "name": "personId",
      "required": false,
      "type": "string"
    },
    {
      "name": "mainPartyId",
      "required": false,
      "type": "string"
    },
    {
      "name": "personType",
      "required": false,
      "type": "string"
    },
    {
      "name": "filterName",
      "required": false,
      "type": "string"
    },
    {
      "name": "filterPartyType",
      "required": false,
      "type": "string"
    },
    {
      "name": "filterLetter",
      "required": false,
      "type": "string"
    }
  ],
  "root": {
    "children": [
      {
        "children": [
          {
            "htmlTemplate": "<div>\n\t<div class=\"sd-text-align-left sd-padding-top-small sd-padding-left-medium\">\n\t\t<span class=\"blz-panel-title blz-header-title blz-color-default\">[[FindPartyToAssociateWithTheOpportunity]]</span>\n    </div>\n</div>",
            "name": "titleSearchParty",
            "widget": "HtmlRenderer"
          }
        ],
        "cssClass": "blz-padding-top-large blz-padding-bottom-large",
        "layout": "fit"
      },
      {
        "children": [
          {
            "cssClass": "blz-padding-right blz-padding-left blz-border-top blz-border-right blz-border-left blz-border-bottom blz-border-radius blz-cast-shadow",
            "name": "filterContainer",
            "widget": "FixedContainer"
          }
        ],
        "cssClass": "blz-area-default",
        "layout": "fit"
      },
      {
        "children": [
          {
            "cssClass": "content-center blz-area-default",
            "htmlTemplate": "<section class=\"blz-cards-customer-brief\">\n    <article class=\"blz-cards-header\">\n        <section class=\"blz-cards-header-logo\">\n\t\t\t<img class=\"header-img\" src=\"{{#if urlImage}}{{urlImage}}{{else}}./icons/user.svg{{/if}}\"/>\n\t\t</section>\n        <section class=\"blz-cards-title\">\n            <article class=\"header-title\">\n                <span class=\"blz-text-title-md blz-text-bold blz-text-xlarge\">{{name}}</span>\n                <section>\n                    <span>[[{{roleType}}]]</span>\n                    <span class=\"blz-text-color-green\">&nbsp;-</span>\n                    <span>&nbsp;{{dateFormat creationDate format=\"DD/MM/YYYY\"}}</span>\n                </section>\n            </article>\n           <section class=\"blz-cards-header-dots\"  style=\"max-width: 24px; max-height: 24px;\" onclick=\"[MultipleRecordAction:select]\">[Icon:dots-menu.svg]</section>\n        </section>\n    </article>\n    <article class=\"middle-section\">\n        <section class=\"blz-area-information\">\n            <p class=\"blz-text-bold blz-text-large\">[[{{personType}}]]</p> \n        </section>\n    </article>\n    <article class=\"description-section blz-area-brief\"> \n          <span>[[CreationDate]] : {{creationDate}}</span> \n    </article>\n</section>",
            "name": "partyCards",
            "pageSize": 12,
            "recordActions": [
              {
                "icon": "edit.svg",
                "key": "select",
                "text": "[[Select]]"
              }
            ],
            "typeName": "ExtPartyRoleManagement.PartyRole",
            "widget": "HtmlRepeater",
            "withPaging": true
          }
        ],
        "cssClass": "blz-flow-designer blz-mini-canvas-panel",
        "layout": "fit"
      }
    ],
    "cssClass": "blz-padding-right",
    "layout": "responsive"
  },
  "routing": null,
  "unused": []
}