1

I'm currently trying to share files on groups where i'm an internal user. My communityId is null

I'm using both of these methods:

postFeedElement(communityId, feedElement)

postCommentToFeedElement(communityId, feedElementId, comment, feedElementFileUpload)

In order to share texts and files on groups. However whenever I login as an internal user and my communityId is null I keep getting this error when I try to post a feed

invalid contentDocumentId[id]

Whenever I try to post a file on a comment I get

You can't share a file from a different community.

As if I were sending a different communityId when I know it's null.

Am I doing something wrong? Whenever I'm in some other community with an Id, this works fine.

Update: I know where the problem lies but i don't know if i can control it. The problem occurs when i login as an internal user inside a community. When this happens the

forcetk.Client()

which i'm using right now to create the record by using the "createBlob" method. I'm setting up the

"networkId"

value to null but when it finishes uploading i can see that the networkId value is the same as the communityId even though im not in a community. Any advice on this bug on the forcetk library would be much appreciated

1

Both CollaborationGroup and ContentVersion object has column networkId. In org having communities enabled, these columns networkId = null for internal CollaborationGroup and ContentVersion records Please check CollaborationGroup.networkId and ContentVersion.networkId record used.

| improve this answer | |
  • I understand what's happening now. What's happening is that even though im setting my networkId to be null, since my instanceURL is from a community, salesforce is clearly setting the networkId to the communityId of the instanceURL. That's why networkId is saved with a value even though neither me or the forcetk library sets a value for the networkId. – JPG Feb 18 at 20:34

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.