This comes from an earlier question here

I am creating a flow using visual workflow. The flow will be fired from a button. The button will be on the Activities Related List on Account Records. It will replace the stock Log a Call button.

The flow is interview style and creates a new Task (call) when finished.

However I kept getting an odd error when creating the new Task record. I am getting a failure and an error that the Owner Id and the Account Id are Null.

I am passing these values through the URL parameters.

To troubleshoot I pared this down to the simplest test. I have a variable named varAccountId passed through the URL. I have verified that is being passed with a valid value. I have a second variable varAccount.

I perform a quick lookup and set varAccount to be an sObject of Account where Id = varAccountId. Then I created a "result" screen that displays the values of varAccountId and varAccount.Id.

Oddly the result screen displays both values, they are both correct, but I still get an error that varAccountId is NULL !

Even stranger is that no amount of Googling seems to turn up anyone with a similar problem. Normally any error is Salesforce can be searched for and many posts etc. found, but here nothing.

To test further I tried this in my personal developers org, where it works! So this is really perplexing. I am a full System Admin in both orgs, and checking permissions shows nothing unusual. So I am at a total loss.

  • So, it shows null in one org and works just as you expect it to in another? – Mark Pond Oct 12 '16 at 23:15

Scott - I think (kinda guessing here) the issue is you're creating the button on the activity object and not the Account object. Since the starting point is the activity sObject there is no reference to the account. However you say this works in your dev org... hum..

What if you created the button on the account and remove the related list "New activity" button. I've done the same with an embeded Visualflow which I automated some of the items from taking an inbound and outbound calls. You can see a demo here, no audio.

if you want a second pair of eyes I'd be happy to jump on a google hangout, fifedog15 at gmail.com.

  • Thank you for the answer. I have taken the account ID that is passed and done a SOQL query, it is indeed the correct ID for the account I am on. – ScottH7a9 Oct 14 '16 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.