Announcements
No record found.
Hi guys,
above i mentioned Changes "Worker type" i want to opposite.
like i will add to one check box Worker type above if its "Yes" i want to Employment. based on worker type opposite.
and that form there is no datasource how to achieve this. give me a example for that.
Thanks
Hi Riyas,
What do you mean by "i want to opposite" here? Where do you need the checkbox and what opposite action should it perform
Thanks for your replay sir,
in Worker 000012 Worker type "Employee" and i will open the "Change worker employment type"
below image in Worker type "Contractor" once i set Check box "Yes" i want to worker type "Employee".
and "Change worker employment type" form
1.if its Worker type "Employee" i want to ""Contractor", based on check box
2.if its Worker type "Contractor" i want to ""Employee" based on check box.
Not sure why you would want to do that. If the worker selected is an employee and you want to change the employment type, you would change it to a contractor.
In any case, assuming you have already created a form extension and added the checkbox, you can use the onModified event and create a new event handler. You can try something like this in the event handler and check if that works for you.
FormCheckBoxControl changeEmploymentCtrl = sender as FormCheckBoxControl; FormComboBoxControl employmentType = sender.formRun().design().controlName("EmploymentType"); HcmEmploymentType currentSelection, nextSelection; currentSelection = employmentType.selection(); nextSelection = (currentSelection == HcmEmploymentType::Contractor) ? HcmEmploymentType::Employee : HcmEmploymentType::Contractor; employmentType.selection(nextSelection);
You can achieve it without a customization. From the worker go via the action menu to Version > Employment history. Edit the end date on the current employment and add a new employment with a new start date. Here you can select another worker type.
Thanks for your answer Mr.Gunjan Bhattacharyya sir,
FormCheckBoxControl changeEmploymentCtrl = sender as FormCheckBoxControl; FormComboBoxControl employmentType = sender.formRun().design().controlName("EmploymentType"); HcmEmploymentType currentSelection, nextSelection; currentSelection = employmentType.selection(); if(changeEmploymentCtrl.value() == NoYes::Yes) { nextSelection = (currentSelection == HcmEmploymentType::Contractor) ? HcmEmploymentType::Employee : HcmEmploymentType::Contractor; } else { employmentType.selection(nextSelection); }
above your code not checked in the "changeEmploymentCtrl" and i tried its not working
Ex: 000001 Worker type : contractor.
change Employment type showing :Employee.
what did am i missing?
Thanks for your replay Mr.André Arnaud de Calavon sir,
i tried your value its not accepted and can't edit new employment with a new start date and am getting error.
You did not set the value in case of marking the checkbox. Try this -
FormCheckBoxControl changeEmploymentCtrl = sender as FormCheckBoxControl; FormComboBoxControl employmentType = sender.formRun().design().controlName("EmploymentType"); HcmEmploymentType currentSelection, nextSelection; currentSelection = employmentType.selection(); if(changeEmploymentCtrl.value() == NoYes::Yes) { nextSelection = (currentSelection == HcmEmploymentType::Contractor) ? HcmEmploymentType::Employee : HcmEmploymentType::Contractor; employmentType.selection(nextSelection); } else { employmentType.selection(nextSelection); }
What should happen when you uncheck the checkbox? Should it go back to the original value?
sir you are correct once i did uncheck its not go original value in this case rewrite anything ?
Please try the original code I provided. Since there are only two values in the enum, it will switch back and forth on checking and unchecking the box.
Thanks for your time sir.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 771
André Arnaud de Cal... 629 Super User 2026 Season 1
Subra 496