You need to sign in to do that
Don't have an account?
muni u 5
How to create a SKILL through coding?
Hi All,
I have faced an issue while creating a SKILL coding.Can any help me that how to create a SKILL through coding?
Below is the issue I have faced.
Cany some one help me ASAP.
Regards,
Muni.
I have faced an issue while creating a SKILL coding.Can any help me that how to create a SKILL through coding?
Below is the issue I have faced.
Cany some one help me ASAP.
Regards,
Muni.
Below is the code wchich I have tried to insert in the Anonymous window/Developer console.
Skill objSkill=new Skill();
objSkill.DeveloperName='A1';
objSkill.MasterLabel='A1';
insert objSkill;
below is the Error :
Sorry for this issue you are facing.
May I suggest you please double check if the user has create permission on skill object? If the user doesn't have the create permission on the skill object please give a try by giving the respective permission which might resolve the issue.
Still, if the problem persists let us know.
Happy to help further.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
You cannot "Insert" Skill records with Apex.
I believe it is to do with how Skills were created under Salesforce - under Classic they were created via the Setup menu, not via the usual list view / new record type button. Under lightning, something similar in that you have the FSL managed package and then it happens under that package.
Regards
Andrew
Firstly thanks for the response.I have created a permission set.In permisssion set under objects ,there is no "SKILL "object .I have no Idea how to give edit,create permission on that object.can u please check and tell me.
Regards,
Muni
Thanks for the response. I agree with u.In my apex class I have created a serviceResourceSkill with SKILLId.In test class I need to do code coverage for that apex.But In the test class I am unable to Insert a Skill.Then how can I do my code coverage.Any Idea?
Regards,
Muni
Sorry for the delay, but in new job now.
I created 2 x skills in the my org and ensured their name contained "TEST". I then created the test class so I could then query them by name for the details such as Id and AutoGenerate
We also had "filters" on the Skill lookup fields which limited which Skills the end user would see so that they would not mistakenly use the TEST skills.
Regards
Andrew
Can you please share the code if possible.
I don't think that we will write Queries in Test classes.And again we shouldn't give Static Id's that cause test class fail during deployment.
If possible please forward the code.
Regards,
Muni
Here is a sample of the query I used. In this case, I was using it for a Skill Requirement record.
Regards
Andrew