This is the message I am seeing while coding to create a workflow Card. I am following the documentation, but within the editor, that message appear for the card properties.
I do try to add the requested missing properties, still with no success.
Is the createCard( ) API is working?
Here is my code:
import {workflows} from 'wix-crm-backend';
import { dateToString } from 'backend/date.jsw';
const workFlowCancelReservid = "6d065cc7-c344-497c-847c-fa41a2c88f4f";
//const workFlowCancelReservid = "1961221a-1128-4c36-9b9c-d487ee80e527";
const phaseCancelReservid = "bea529f6-cccc-4bf0-ac1d-00ca0425877d";
export async function createCancelReservCard(contactId, facture, bookId){
let cardName = "Annulation facture# " + facture;
createCard(workFlowCancelReservid, phaseCancelReservid, contactId, cardName, bookId)
}
export async function createCard(workflowId, phaseId, contactId, cardName, bookId, position = undefined){
let TodaysDate = new Date();
TodaysDate.setDate(TodaysDate.getDate());
let idNumGen = new Number();
idNumGen = Math.random();
const cardWorkflow = {
// "id": idNumGen.toString(),
"name": cardName,
"contactId": contactId
// ,
// "source": "Invoices",
// "createdDate": TodaysDate,
// "updatedDate": TodaysDate,
// "phaseId": phaseId
};
console.log("Péparation pour créer une workflow card " + workflowId + "\n phase id= " + phaseId + "\ncard= " + cardWorkflow + " " + JSON.stringify(cardWorkflow))
let cardCancel = await workflows.createCard(
workflowId,
phaseId,
cardWorkflow,
position
);
The function workflow.createCard is always returning undefined.