• Surya Chandra Rao Gandreddi
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 3
    Replies
I had to delete a field, say Type__c from a custom object and use RecordType ... I've deleted the field Type__c and now I'm trying to upgrade the recordTypes via PostInstallScript. But when I'm trying to query for Type__c I get the below error.

    No such column 'Type__c' on entity 'Custom Object'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

Any suggestions, thanks.
I'm trying to load fonts (dynamically) from the static resource,
addFont: function(name, link) {
        var css = '@font-face { font-family: ' + name + '; src: url("' + link + '");';
        console.log('addFont css: ', css);

        var head = document.head || document.getElementsByTagName('head')[0];
        var style = document.createElement('style');

        style.type = 'text/css';
        if (style.styleSheet){
            style.styleSheet.cssText = css;
        } else {
            style.appendChild(document.createTextNode(css));
        }

        head.appendChild(style);
    }

The fonts are not loading, but if I hard code the same in the component they work fine. Am I missing something?
Fonts are loaded (from an AuraEnabled controller Method) on onInit which calls addFont.
I've two thing for Communities & No-Communities.
1 - To post a Feed to a User in Communities - https://help.salesforce.com/apex/HTViewSolution?id=000187667&language=en_US This works fine for Community User & Non-Community User.
FeedItem post = new FeedItem(ParentId = UserInfo.getUserId(), CreatedById = thanks.GiverId, Body = thanks.Message, RelatedRecordId = thanks.Id, Type = 'RypplePost');

        String networkId = Network.getNetworkId();
        if(networkId != null) {
            post.NetworkScope = networkId;
        }

        insert post;

This works fine in Communities, but breaks when Communities are not enabled. If I comment out 'post.NetworkScope = networkId;' - the package installs fine, if not I get the Installation Error as below:
2 - Images in Community How to include images from static resources in lightning components used in communities?
String networkId = Network.getNetworkId();

if(networkId != null) {
 List<Network> networks = [ Select UrlPathPrefix from Network where Id = :networkId ];
 if(networks.size() > 0) {
   return '/' + networks[0].UrlPathPrefix;
 }
}
return '';


I'm appending that UrlPathPrefix to the Images on communities when UrlPathPrefix != ''. I think Select UrlPathPrefix from Network where Id = :networkId is causing the below error.
Missing Organization Feature: Networks null
Missing Organization Feature: NetworksEnabledOnce null

Thanks.
We have a component which was working fine, until Yesterday - we are using Associative arrays. So I created a simple component and replicated the issue.
Component
<aura:component controller="LightningAdminController">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

    <aura:attribute name="data" type="Object"/>

    <div>Value: {!v.data.obj.key}</div>
    <div>UserId: {!v.data.user.Id}</div>

</aura:component>

Controller
({
  doInit: function(component, event, helper) {
    var data = {
      'obj': {
        'key': 'Valuess'
      }
    };
    component.set('v.data', data);
    console.log('data: ', data);
    helper.getLearner(component);

  }
})


Helper
({
  getLearner: function(component) {
    var self = this;
    var action = component.get("c.UserDetails");
    action.setCallback(this, function(response) {
      var state = response.getState();
      if (component.isValid() && state === "SUCCESS") {
        var data = component.get("v.data");
        data.user = response.getReturnValue();

        component.set("v.data", data);

        console.log('UserID: ', component.get("v.data").user.Id);
      }
    });
    $A.enqueueAction(action);
  },
})


I can see the UserID in the console log, but the component doesn't show the user ID, it stays blank. Any suggestions.
Thanks.


Edit: If I add the key - user (with value UserID) to the data in controller it works fine, I mean the v.data.user.Id shows 'UserID' and then it is replaced with the one from the Action call.
Controller
({   doInit: function(component, event, helper) {
    var data = {
      'obj': {
        'key': 'Valuess'
      },
      'user': {
        Id: 'UserID'
      }
    };
    component.set('v.data', data);
    console.log('data: ', data);
    helper.getLearner(component);

  } })

 
Hi,

I'm trying to use forcetk to create a ChatterFile on an object as below:

forcetkClient.createBlob(
    'FeedItem', {
        'ParentId': 'xxxxxxxx', // Custom Object Id
        'ContentFileName': file.name,
        'Type': 'ContentPost',
    }, file.name, 'ContentData', file,
    function(response) {
        console.log(response);
    },
    function(request, status, response) {
        console.log("Error: " + status);
    }
);

But then I get the below error:
[{"message":"Unable to create/update fields: ContentType. Please check the security settings of this field and verify that it is read/write for your profile or permission set.","errorCode":"INVALID_FIELD_FOR_INSERT_UPDATE","fields":["ContentType"]}]

Any suggestions on what I'm missing or doing wrong.

Thanks
​public static String upload(String folderId, String documentId, String fileName, String base64BlobValue) {
        if(documentId == '' || documentId == null) {
            Document document = new Document(Name=fileName, FolderId=folderId, Body=EncodingUtil.Base64Decode(base64BlobValue), IsPublic=true);
            insert document;

            return document.Id;

        } else {

            Document document = [select Id, Body from Document where Id = :documentId];
            update new Document(Id = documentId, Body = EncodingUtil.Base64Decode(EncodingUtil.Base64Encode(document.Body) + base64BlobValue));

            return documentId;
        }
    }
Hi,
I'm trying to upload files (image/audio/video) to FeedItem in chunks, the above example shows how I'm doing the same while writing to a document. But If try to do the same with FeedItem it says "FeedItem.ContentData is not writeable" so I've tried the following code:
FeedItem imageFeedItem = [select Id, ContentData, RelatedRecordId from FeedItem where Id = :imageFeedItemId];

            ContentVersion content = new ContentVersion();
            content.versionData = EncodingUtil.Base64Decode(EncodingUtil.Base64Encode(imageFeedItem.ContentData) + base64BlobValue);
            content.pathOnClient = fileName;

            content.ContentDocumentId = [Select ContentDocumentId from ContentVersion where id=:imageFeedItem.RelatedRecordId].ContentDocumentId;

            insert content;

But this creates ContentVersions of incomplete chunks. Any pointers on how can I achieve this more neat.

Thank you.
I had to delete a field, say Type__c from a custom object and use RecordType ... I've deleted the field Type__c and now I'm trying to upgrade the recordTypes via PostInstallScript. But when I'm trying to query for Type__c I get the below error.

    No such column 'Type__c' on entity 'Custom Object'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

Any suggestions, thanks.
I'm trying to load fonts (dynamically) from the static resource,
addFont: function(name, link) {
        var css = '@font-face { font-family: ' + name + '; src: url("' + link + '");';
        console.log('addFont css: ', css);

        var head = document.head || document.getElementsByTagName('head')[0];
        var style = document.createElement('style');

        style.type = 'text/css';
        if (style.styleSheet){
            style.styleSheet.cssText = css;
        } else {
            style.appendChild(document.createTextNode(css));
        }

        head.appendChild(style);
    }

The fonts are not loading, but if I hard code the same in the component they work fine. Am I missing something?
Fonts are loaded (from an AuraEnabled controller Method) on onInit which calls addFont.
Hi,

I am trying to install Salesforce Communities Management (for Communities with Chatter) from the AppExchange, and am receiving the following error:
---------------------------

1. Unexpected Error
The package installation failed. Please provide the following information to the publisher:

Organization Name: xx 
ID: xx 
Package: Salesforce Communities Management (for Communities with Chatter)
Version: 7.0
Error Message: The post install script failed.

---------------------------

Thanks,