Creating Job in Dynamics 365 F&S
Today, we’re going to look at one of the most frequently used processes in the application – Creating Job in Dynamics 365. A job is a collection of tasks and responsibilities that are required from a person who performs a job. Areas of responsibility, job tasks, job functions, skills, education information, and certificates that are required for a job.
How to Create Job Manually: Dynamics 365 F&S Functional Walkthrough
Step 1
Go to Human resources > Jobs > Jobs.
Step 2
After that, click on the ‘+New’ tab at the top left corner. This will direct you to ‘Create Job.
It will open a detailed form where we can enter basic information. Add the relevant information in Job Description, Job Classification, Compensation, and Skills sections. You can also add information in the Test section, Education section, etc.
Step 3
Click on the “Save” button and then Copy from > Copy from Template.
Step 4
After clicking on the “Copy from Template” button, the dialog form will be open where you can add further details to the Job. Following are the details, you can see in the image below:
In the Job template field, click the drop-down button to open the lookup. In the list, find and select the desired record. Click the Note option and after completing all detailed click OK.
Now, we will move on to the technical part of creating a job.
The Data Model Behind the Job: Dynamics 365 F&S Technical Walkthrough
We focused on the basic functional process and now we are going to move on to the technical part of creating a job.
Entity Relationship Diagram:
These are some of the important tables involved in creating a job in Dynamics 365. You can see the primary tables and the cardinality constraints.
Below you will see a Runnable Class (job) to create a job
[sourcecode language=”c-sharp”] class CreateJob{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
HcmJob hcmJob;
HcmJobDetail hcmJobDetail;
HcmCompensationLevel hcmCompensationLevel;
HcmJobType hcmJobType;
HcmJobFunction hcmjobFunction;
HcmTitle hcmTitle;
HcmSurveyCompany hcmSurveyCompany;
HcmJobId hcmJobId;
utcdatetime minDateTime = DateTimeUtil::minValue();
utcdatetime maxDateTime = DateTimeUtil::maxValue();
hcmJobId = "ERP Dev Manager8";
hcmTitle = HcmTitle::findByTitle(‘IT Manager’);
hcmjobFunction = HcmjobFunction::findByJobFunction(‘0100’);
hcmJobType = HcmJobType::findByJobType(‘Managers’);
hcmCompensationLevel = HcmCompensationLevel::findByCompensationLevel(‘G03’);
hcmSurveyCompany = HcmSurveyCompany::findBySurveyCompany(‘Industry1’);
//validate the Job Id if it exists or not
hcmJob = HcmJob::findByJob(hcmJobId);
if(!HcmJob::exist(hcmJob.recId))
{
//Header details of Job
ttsbegin;
hcmJob.clear();
hcmJob.initValue();
hcmJob.JobId = hcmJobId;
hcmJob.MaximumPositions = 1;
hcmJob.insert();
//Line details of Job
hcmJobDetail.initValue();
hcmJobDetail.Description = "ERP Dev Manager8";
hcmJobDetail.Note = "Responsible for ERP development management.";
hcmJobDetail.Job = hcmJob.RecId;
hcmJobDetail.JobFunction = hcmjobFunction.RecId;
hcmJobDetail.JobType = hcmJobType.RecId;
hcmJobDetail.CompensationLevel = hcmCompensationLevel.RecId;
hcmJobDetail.Title = hcmTitle.RecId;
hcmJobDetail.DefaultFullTimeEquivalency = 1;
hcmJobDetail.ValidFrom = minDateTime;
hcmJobDetail.ValidTo = maxDateTime;
hcmJobDetail.insert();
ttscommit;
}
{
error(strfmt("The specified record %1 already exist", hcmJob.JobId));
}
}
}
[/sourcecode]
Although there are many tables included in this process, we’re going to focus on two major tables. The two major tables we will focus on are ‘HcmJob and ‘HcmJobDetail.’ Let’s go ahead and start with HcmJob.
HcmJob:
HcmJob table contains a record for the job that are used with main, HRM, and payroll tables. This table stores the header information of the Job. This table is useful for HR and Payroll modules in Microsoft Dynamics 365. Let’s have a look at some types of data Job contains:
- This table helps to maintain the positions for a job.
Below, we have listed down other significant fields of the HcmJob along with their respective descriptions.
Field | Data Type | Description |
Job Id | string | This field contains the job id number |
Maximum Position | int | This field contains the number of the position that job can have |
Now let’s take a look at HcmJobDetail.
HcmJobDetail:
The HcmJobDetail table provides date effective information that is related to a specific job. This table also contains the job’s functions and levels.
. Let’s have a look at some characteristics of the HcmJobDetail table:
- This table contains the employment factors where numbers represent a part-time job or a full-time job.
- This table also contains the function that can be assigned to jobs and used to set up and implement eligibility rules for compensation plans.
Next, we will show you a few of the important fields of this table along with the description.
Field | Data Type | Description |
Compensation Level | string | This field contains the compensation level for the job |
Job Type | Enum | This field contains the job type |
Job Function | string | This field contains a function for the job |
Description | string | Description of the job |
Title | string | Title for the job |
Survey Company | string | The company responsible for the survey |
Default FullTime Equivalency | real | This field contains the employment factor |
Overview:
In this post, we:
- covered creating a job in Microsoft Dynamics 365 F&S
- reviewed the technical side of creating a job
- discussed two major tables: HcmJob and HcmJobDetail
- discussed ways in which to use both tables.
We sincerely hope that you enjoyed part 13 of our exciting series on the Dynamics 365 data model. We aim to provide quality service at all times. And as always, if you need to reach me, you know how to get in touch by reaching out to me here. — Brandon Ahmad, founder of InstructorBrandon and Dynatuners