• Søren Nødskov Hansen
  • NEWBIE
  • 25 Points
  • Member since 2015
  • Partner
  • Something Cloud

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
Hi fellow developers

I'm currently building an integration between an external website (Sitecore) and Salesforce using Identity Management (External Identity User).

I've created a REST Service in Apex which the Sitecore developer calls. The Apex REST Service creates an Account, Contact and User based on the details sent by the Sitecore backend. The Apex REST Service also calls setPassword for the User once it's been created.

We're seeing issues where often we cannot log in using the SOAP API (Partner WSDL) with the User Credentials just created by the Apex REST Service. It almost seems like the setPassword is ignored or simply doesn't take effect (sometimes it works sometimes it doesn't).

I've tried moving the setPassword call into an asynchronous call using the Future keyword. That seemed to work for a while but now when the Sitecore backend calls login with the External Identity's Credentials we run in to a race condition where the Future-method hasn't returned yet when trying to log in.

We then tried moving the setPassword out of the Apex REST Service and instead having Sitecore call setPassword once the External Identity User had been created. Again, there seems to be a timing issue with this approach and it only works on and off.

Finally, we added a wait-command to the Sitecore code so that we're now waiting X seconds between "create user", "set password" and "log in". However, this is of course unacceptable - we cannot have waiting or sleeping threads in our code.

Has anyone else had these issues and is there a way around it? What's the solution - there has to be one... I hope....

Kind regards,
Søren Nødskov Hansen
Hi all

A colleague of mine has installed the AppExchange App from Salesforce Labs called Universal Timeline (https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3000000B54hhEAB).

Now, it works and fine in our client's Salesforce Org. but when loggin in to the client's Community, my colleague gets the following pop-up with an error message:

Error Message (pop-up)

I have been through the security setting for each and every Visaulforce Page, Visualforce Component and Apex Class associated with the package but so far no luck. My debug logs indicated something about the FileNotFound Page so I've also changed that Visualforce Page to be available in Communities and added the Community User Profile to the security settings for that VF Page.

I've also added the Community hostname as a Remote Site to see if that was the issue. Sadly, no luck.

Does anyone use this AppExchange App together with Communities? If so, did it require any additional configuring?

Thanks,
Søren Nødskov
Hi

I have a visualforce page with an extension controller which shows and works as expected on the account detail page layout.

However, I'd like to also show my VF page on the page layout that is shown when the user clicks the "New" button. I.e. on the create/insert page layout.

How can this be done?

Thanks in advance.

/Søren Nødskov
Hi all

I have an after update Trigger which runs off AgentWork. If the WorkItemId of the AgentWork record is a Case and field AcceptDateTime changes, then the Trigger updates a field on the related Case.

Now, all of that works like a charm. However, writing a Unit Test Class for this has proven slightly tricky and I'm hoping someone in here can help me with that.

I keep getting this error: "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, The agent's status is not associated with the channel for this work.: [ServiceChannelId]"

The User inserting the AgentWork record in the Unit Test Class has a Profile which is coupled with our ServiceChannel and the AgentWork record I'm trying to insert has ServiceChannelId, WorkItemId (Id of Parent Case) and UserId (of User with correct Profile) set.

What am I missing?

Thanks in advance.

Søren Nødskov Hansen
Something Cloud
Hi

I have a visualforce page with an extension controller which shows and works as expected on the account detail page layout.

However, I'd like to also show my VF page on the page layout that is shown when the user clicks the "New" button. I.e. on the create/insert page layout.

How can this be done?

Thanks in advance.

/Søren Nødskov
Hi all

I have an after update Trigger which runs off AgentWork. If the WorkItemId of the AgentWork record is a Case and field AcceptDateTime changes, then the Trigger updates a field on the related Case.

Now, all of that works like a charm. However, writing a Unit Test Class for this has proven slightly tricky and I'm hoping someone in here can help me with that.

I keep getting this error: "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, The agent's status is not associated with the channel for this work.: [ServiceChannelId]"

The User inserting the AgentWork record in the Unit Test Class has a Profile which is coupled with our ServiceChannel and the AgentWork record I'm trying to insert has ServiceChannelId, WorkItemId (Id of Parent Case) and UserId (of User with correct Profile) set.

What am I missing?

Thanks in advance.

Søren Nødskov Hansen
Something Cloud