Advanced customization of the supplier portal
Survey
Surveys are fully customizable lists used to ask suppliers questions. The answers are recorded in beCPG but not used by formulation.
Creating and adding surveys and answers
First, create questions and possible answers in the survey administration list (surveyList). Then add them to the survey list of the entity template.
Click here for more information.
Note: if the survey list is not present, you can add it to the entity template. Click here for more information.
Supplier wizard
The following customizations are advanced beCPG settings.
Customize supplier wizard
Add survey to wizard
To display the survey in the supplier wizard, modify the becpg-config-custom.xml file.
To learn how to modify this file, click here.
Note: you can create several supplier surveys, for example one per entity type.
Supplier-specific forms
You can define specific forms for the properties and lists used in the supplier portal.
Click here for more information.
Supplier referencing project
Supplier referencing project templates have the “Supplier (bcpg:suppliersAspect)” aspect.
Deliverables
Wizard
Click here for more information.
Script
The supplierPortalScript.js script lets you:
- create a branch;
- associate the task with the supplier account;
- move the entity and the supplier into the portal.
The supplierPortalPrepareSignatures.js script lets you:
- Create signature tasks and assign them to the supplier account
- Generate a document on the entity (based on the supplier data sheet report)
- Associate this document with a project deliverable for signature
- Create the closing task and assign it to the project creator
- Associate a validation script with the closing task to merge the branch back into the initial entity.
The prepare-signature.js deliverable script prepares the document to sign for each signature task. You can modify it to customize the signature parameters via bSign.prepareForSignature(document, recipients, JSON.stringify(params)):
- Signature size (width, height, page)
- Signature position (fromLeftRatio, fromBottomRatio, gap, direction)
- Disable signature at bottom of page
- Place signature next to a specific word (anchor, keyword, xPosition, yPosition)
| Param | Type | Description |
|---|---|---|
| page | String | The page number where the signature should be placed. |
| width | Integer | The width of the signature. |
| height | Integer | The height of the signature. |
| direction | String | Direction of signature placement. Possible values: "right", "left", "up", "down". |
| gap | Integer | The gap between multiple signatures if applicable. |
| fromLeftRatio | Integer | The horizontal positioning ratio from the left. |
| fromBottomRatio | Integer | The vertical positioning ratio from the bottom. |
| anchor | Object | Specifies an anchor keyword-based placement (optional). |
| keyword | String | The keyword that serves as an anchor point. |
| xPosition | String | Horizontal position relative to the keyword. Possible values: "left", "middle", "right". |
| yPosition | String | Vertical position relative to the keyword. Possible values: "top", "middle", "bottom". |
JSON parameters have the following structure:
{
signature: {
page: "string",
width: integer,
height: integer,
direction: "string",
gap: integer,
fromLeftRatio: integer,
fromBottomRatio: integer,
anchor: {
keyword: "string",
xPosition: "string",
yPosition: "string"
}
},
initials: {
disable: boolean,
width: integer,
height: integer,
direction: "string",
gap: integer,
fromLeftRatio: integer,
fromBottomRatio: integer,
anchor: {
keyword: "string",
xPosition: "string",
yPosition: "string"
}
}
}
The default values are:
{
signature: {
page: "last",
width: 200,
height: 75,
direction: "up",
gap: 60,
fromLeftRatio: 60,
fromBottomRatio: 10,
anchor: {
keyword: null,
xPosition: null,
yPosition: null
}
},
initials: {
disable: false,
width: 100,
height: 35,
direction: "up",
gap: 30,
fromLeftRatio: 75,
fromBottomRatio: 10,
anchor: {
keyword: null,
xPosition: null,
yPosition: null
}
}
}
Example:
function main() {
var urlDeliverable = null;
var keyName = deliverable.name.replace(" - prepare", "");
for (var i = 0; i < project.deliverableList.size(); i++) {
var del = project.deliverableList.get(i);
if (del.name == keyName + " - url") {
urlDeliverable = del;
break;
}
}
if (task.resources != null && !task.resources.isEmpty() && urlDeliverable && urlDeliverable.content) {
var recipient = search.findNode(task.resources.get(0));
var document = search.findNode(urlDeliverable.content);
var recipients = [];
var params = {
signature: {
width: 100,
height: 50,
fromLeftRatio: 60,
fromBottomRatio: 5
},
initials: {
disable: true
}
};
recipients.push(recipient);
bSign.prepareForSignature(document, recipients, JSON.stringify(params));
var signatureUrl = bSign.getSignatureView(document, recipient, task.nodeRef);
urlDeliverable.url = signatureUrl;
}
}
main();