HcmWorkers AIF C# Please Help!

Good Morning.

I have been searching everywhere and can not find any good examples or documentation on how to use this web service,

I urgently need help please.

Could you maybe post a code example of how it works and or point me to a good sample project or something please.

Also when I add the reference to c# it generates the reference code incorrectly e.g Namespace.TestApp.Service1 generates as Namespace.TestApp.Namespace.TestApp.Service1, This I can fix so its just a bonus question.

I don’t have any example on hand specific to HcmWorker, but if you have a specific question, I might be able to help.

Regarding your other question, the system works correctly - you should name the reference Service1, not Namespace.TestApp,.Service1, to the result you expect.

Thanks for your reply, I am not calling it that I name it AIFHcmService but in the generated code behind the service it makes it

Namespace.TestApp.Namespace.TestApp.AIFHcmService

Instead of

Namespace.TestApp.AIFHcmService

No Clue why it is doing this but I just rename the lot and it works. I just have absolutely no clue how to insert update and delete information using the HcmWorker Webservice that is why I was looking for a sample.

Thank you for your time.

If you’re talking about HcmWorkerImportService, it does not support deletion (according to Standard Document Services).

If you want a simple example of using a document services, look at Creating sales orders via AIF in AX2012.

Thank you this helped! I have one more question though. I am trying to do an update but I need an entity key can you point me in a direction that might help me better understand the entity key?

An entity key uniquely identifies a document. It may be composed from more than one field and it’s usually generated from the primary key of the root data source. HcmWorker is the same case - it’s primary key is SurrogateKey, i.e. RecId, therefore the entity key has a single field: RecId.

If you want to see the code, walk through the following example in the debugger:

HcmWorker worker = ...;
AifEntityKey entityKey = new AxdHcmWorkerImport().createEntityKey(worker);