For option 2, you probably need to capture the user’s comment and trigger the TI process from the frontend.
const instanceName = "tm1_instance";
const processName = "YourTIProcessName";
const parameters = {
pDimension1: "Value1",
pDimension2: "Value2",
pDimension3: "Value3",
pComment: "User entered comment",
pAction: "Spread value from Q1 to Q4"
};
// Prompt User for Comment
const userComment = prompt("Please enter your comment for this action:");
if (userComment) {
parameters.pComment = userComment;
}
// Execute the TI Process
$tm1Ui.processExecute(instanceName, processName, parameters).then((response) => {
if (response.success) {
console.log("TI Process executed successfully!");
} else {
console.error("Failed to execute TI process:", response.message);
}
});