Hello everyone, som i'm trying to create a new record in Planned answer Session after i submit my workflow i used these code but it doesn't work
public void completed(WorkflowElementEventArgs _workflowElementEventArgs) { // TODO: Write code to execute once the workflow is completed. RecId documentRecId = _workflowElementEventArgs.parmWorkflowContext().parmRecId(); NouvelleMesureTable::updateWorkflowStatus(documentRecId, GD_WFDocumentStatus::Valide); FormControl sender; FormRun formRun; Args args = new Args(); KMVirtualNetworkAnswerTable kMVirtualNetworkAnswerTable; NouvelleMesureTable nouvelleMesureTable; FormDataSource nouvelleMesureTable_ds = sender.formRun().dataSource(formDataSourceStr(NouvelleMesureDisciplinaire,NouvelleMesureTable))as FormDataSource; ttsbegin; kMVirtualNetworkAnswerTable.ExecutedBy=nouvelleMesureTable.Person; kMVirtualNetworkAnswerTable.EvaluationOf=nouvelleMesureTable.Person; kMVirtualNetworkAnswerTable.kmCollectionId=nouvelleMesureTable.Questionnaire; ttscommit; args.name(formStr(NouvelleMesureDisciplinaire)); formRun = classFactory.formRunClass(args); formRun.init(); formRun.run(); }
thank you.
Hi wassim77,
Great you have it resolved now!
So you are providing answers to a questionnaire which is already defined on NouvelleMesureTable. Meanwhile, what I got was, assigning questionnaire which employee would and provide answers to from ESS.
Bravo :)
So i fixed it, the Answertable was the way to go.
i wasn't getting the number seq that was fault
thank you for your help
NouvelleMesureTable nouvelleMesureTable; KMVirtualNetworkAnswerTable kMVirtualNetworkAnswerTable; nouvelleMesureTable = NouvelleMesureTable::findRecId(document.RecId); kMVirtualNetworkAnswerTable.EvaluationOf = nouvelleMesureTable.Person; kMVirtualNetworkAnswerTable.ExecutedBy = nouvelleMesureTable.Person; kMVirtualNetworkAnswerTable.kmCollectionId = nouvelleMesureTable.Questionnaire; kMVirtualNetworkAnswerTable.status = KMCollectionAnswerStatus::Planned; kMVirtualNetworkAnswerTable.kmVirtualNetworkAnswerTableId = NumberSeq::newGetNum(KMKnowledgeCollectorParameters::numRefCollectionAnswerId()).num(); kMVirtualNetworkAnswerTable.insert();
Hello,
Can you tell me how you are getting the worker NouvelleMesureTable?
Are you using the recId or the personnelNumber? And how are you able to detect the worker in the document. And lastly, show us the complete code and where you are inserting records in the tables above.
yes i understand so i used the the tables, the person didn't get the questionnaire so i went to check the records in the tables what was missing and i found that HRMVirtualNetworkGroupRelation was not inserting person and hrmVirtualNetworkGroupId
this is my code
NouvelleMesureTable nouvelleMesureTable; HRMVirtualNetworkGroup hRMVirtualNetworkGroup; HRMVirtualNetworkGroupRelation hRMVirtualNetworkGroupRelation; KMCollectionRights kMCollectionRights; hRMVirtualNetworkGroupRelation.hrmVirtualNetworkGroupId = nouvelleMesureTable.hrmVirtualNetworkGroupId; hRMVirtualNetworkGroupRelation.Person = nouvelleMesureTable.Person; hRMVirtualNetworkGroupRelation.insert(); kMCollectionRights.kmCollectionId = nouvelleMesureTable.Questionnaire ; kMCollectionRights.hrmVirtualNetworkGroupId = nouvelleMesureTable.hrmVirtualNetworkGroupId; kMCollectionRights.insert();
So focusing on kMVirtualNetworkAnswerTable is a wrong move.
kMVirtualNetworkAnswerTable will be populated only after the employee had attended to the questionnaire. So for now, please ignore kMVirtualNetworkAnswerTable.
I have highlited the tables you should focus on already above. Please, review and if you have difficulties, ask, then we will take it one after the other.
it's to assign questionnaire to employee on ESS
Hi wassim77,
Please, what is your requirement ?
to assign questionnaire to employees on ESS.
OR
to assign answers to questionnaire ?
okey so i fixed it it was the "ignore EDT relation" set to yes.
i get a drop down box where i can select the but it's the same thing i can't get the records into KMVirtualNetworkAnswerTable
by the way thank so much for you're help komi
Did you add relations ?
Does the table have a record ?
So i added hrmVirtualNetworkGroupId to my table but i'm getting an empty field
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156