• Srilakshmi B S
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 6
    Questions
  • 7
    Replies
I am trying to search the records based on AccountTag through sosl as below:

String searchQuery = 'FIND \'' + searchStr + '\' IN NAME FIELDS RETURNING  AccountTag (ItemId), Resource_List__Tag(ItemId)';

List<List <sObject>> searchList = search.query(searchQuery);

But getting the below error on execution:

AccountTag does not support search.

How can I search AccountTag using sosl?

 
I have a sandbox in which BigMachines-Salesforce Commerce Integration Package (Version 4.14) is installed. Now we are able to connect to bigmachine and create quotes using this package.
Is there any other way to connect to BigMachines other than through the package? I did not find any api for this.
I am trying to create static resource in salesforce through java code. I am fetching the content of a file which is stored in my system and encoding it into base64 format and putting that content into the content of static resource. The code snippet is as below:
   File file = new File("D:/Personal/salesforce_sharing_cheatsheet.pdf");

    FileInputStream fin = new FileInputStream(file);

    byte fileContent[] = new byte[(int)file.length()];
    fin.read(fileContent);
    System.out.println("fileContent: " +fileContent);
    String fileContentString = new String(fileContent);
    System.out.println("fileContentString: " +fileContentString);

    byte[] encoded = Base64.encodeBase64(fileContent);
    String encodedFile = new String(encoded);
    System.out.println("encoded: " +encoded);
    System.out.println("encodedFile: " +encodedFile);
    System.out.println("encodedFile.getBytes(): " +encodedFile.getBytes());

    StaticResource sr = new StaticResource();
    sr.setFullName("test11");
    sr.setCacheControl(StaticResourceCacheControl.Private);
    sr.setContentType("text/field");
    sr.setContent(encodedFile.getBytes());

    SaveResult[] results = metadataConnection.createMetadata(new Metadata[] { sr });

    for (SaveResult r : results) {
        if (r.isSuccess()) {
            System.out.println("Created component: " + r.getFullName());
        } else {
            System.out
                    .println("Errors were encountered while creating "
                            + r.getFullName());
            for (Error e : r.getErrors()) {
                System.out.println("Error message: " + e.getMessage());
                System.out.println("Status code: " + e.getStatusCode());
            }
        }
    }

    fin.close();
The static resource is getting created in salesforce but the content is appearing as encoded data.
How can I get the original content in the created static resource. Please help me.
I have created an input form. The input form fields are Name, Status, Start time and End time which are the fields of Deliverable object. On click of Add button the values entered in the input text fields have to be displayed in the table. Here is the code i have written:

Controller:

public with sharing class TBN_ProjectDeliverable {

public List<Project__c> lstProjects = new List<Project__c>();
public List<Delivarable__c> lstDeliverables {get; set;}
public Delivarable__c objDelivarable = new Delivarable__c();
public String selectedProject {get; set;}
public String inputName {get; set;}
public String inputStatus {get; set;}
public String inputStartTime {get; set;}
public String inputEndTime {get; set;}
public boolean showInputForm {get; set;}
public boolean showTable {get; set;}
public Integer counter = 0;

public TBN_ProjectDeliverable(){

    lstProjects =   ([  SELECT Name
                        FROM Project__c
                        WHERE Status__c = 'Active'
                    ]);
    lstDeliverables = new List<Delivarable__c>();
}

public List<SelectOption> getActiveProjects(){

    List<SelectOption> lstSelectOptions = new List<SelectOption>();

    for(Project__c objProject: lstProjects) {

        lstSelectOptions.add(new SelectOption(objProject.Name , objProject.Name));
    }

    return lstSelectOptions;
}

public void btnGo() {

    showInputForm = true;
}

public Delivarable__c getDelivarable {

    get{

        System.debug('=====objDelivarable======'+objDelivarable);
        return objDelivarable;

    } set;
}

public pageReference addDataToTable() {

    showTable = true;
    System.debug('=====objDelivarable======'+objDelivarable);
    lstDeliverables.add(objDelivarable);
    System.debug('=====lstDeliverables======'+lstDeliverables);
    System.debug('=====lstDeliverables.Name======'+lstDeliverables[0].Name);

    return null;
}

public void btnEdit(){

}

public void btnSave() {

    Database.insert(objDelivarable);
}

public void btnCancel() {

}
}

Vf page:

<apex:page Controller="TBN_ProjectDeliverable" sidebar="false" tabStyle="Project__c">
<apex:form >
    <apex:pageBlock title="Project Deliverable" id="thePageBlock">
        <apex:pageBlockSection >
            <apex:selectList label="Active Projects:" value="{!selectedProject}" size="1">
                <apex:selectOptions value="{!ActiveProjects}"/>
            </apex:selectList>
            <apex:commandButton action="{!btnGo}" value="Go"/>
        </apex:pageBlockSection>

        <apex:pageBlockSection title="Create deliverable record" rendered="{!showInputForm}">
            <apex:inputfield value="{!getDelivarable.Name}"/>
            <apex:inputfield value="{!getDelivarable.Status__c}"/>
            <apex:inputfield value="{!getDelivarable.Start_Time__c}"/>
            <apex:inputfield value="{!getDelivarable.End_time__c}"/>
            <apex:commandButton action="{!addDataToTable}" value="Add" rerender="thePageBlockTable, thePageBlock"/>
        </apex:pageBlockSection>

        <apex:pageBlockSection title="Table of deliverable records" rendered="{!showTable}" columns="1" id="thePageBlockTable">
            <apex:pageBlockTable value="{!lstDeliverables}" var="objLstDeliverables" >
                <apex:column headervalue="Name">
                    <apex:outputText value="{!objLstDeliverables.Name}"/>
                </apex:column>
                <apex:column headervalue="Status">
                    <apex:outputText value="{!objLstDeliverables.Status__c}"/>
                </apex:column>
                <apex:column headervalue="Start Time">
                    <apex:outputText value="{!objLstDeliverables.Start_Time__c}"/>
                </apex:column>
                <apex:column headervalue="End Time">
                    <apex:outputText value="{!objLstDeliverables.End_time__c}"/>
                </apex:column>
                <apex:column headervalue="Edit">
                    <apex:commandLink value="Edit" action="{!}"/>
                </apex:column>
            </apex:pageBlockTable>
            <apex:commandButton action="{!btnSave}" value="Save" />
            <apex:commandButton action="{!btnCancel}" value="Cancel"/> 
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>       
</apex:page>

I am getting the input form data in the table. But on re-entering the form data with new values, the previous data is getting overriden in the table. Please help to to solve this problem.
I am able to create a file in Google drive with the below code:

Http http = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setEndpoint('https://www.googleapis.com/upload/drive/v2/files?uploadType=media');
req.setHeader('content-type', 'text/plain');
req.setHeader('Authorization','Bearer '+accessToken);
String messageBody = 'Hi, This message is from Salesforce';
req.setBody(messageBody); 
req.setTimeout(60*1000);
HttpResponse resp = http.send(req);

But now i want to create a file inside a folder in Google drive. I am using end point as:

req.setEndpoint('https://www.googleapis.com/upload/drive/v2/files/0B602YDdndVQ6b3RnR2NYQXo5TXM/children?uploadType=media');
where 0B602YDdndVQ6b3RnR2NYQXo5TXM is the folder id.

Can someone please tell me what other changes i have to do in the above code in order to create the file inside a folder?
https://developers.google.com/drive/web/manage-downloads

In the above link it is given that we have to make a GET request to the downloadUrl (which we get in the response when we upload the file) in order to get the file contents.

The downloadUrl which I got after uploading file to google drive is :
"downloadUrl": "https://doc-10-cc-docs.googleusercontent.com/docs/securesc/2butu3k0aok5svkleqovepe3uqqvauqr/9o0jdpikd3jl5krf0vgcacuhfl8gro0v/1408694400000/05688347114777583261/05688347114777583261/0B602YDdndVQ6LUxZRC0wX1ZtWWs?h=16653014193614665626&e=download&gd=true"

Now i am making GET request like this:

        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setMethod('GET');
        req.setEndpoint(downloadURL);
        req.setHeader('content-type', 'text/plain');
        req.setHeader('Authorization','Bearer '+accessToken);
        req.setTimeout(60*1000);
        HttpResponse resp = http.send(req);

My problem is that, each time i upload the file i will get different downloadUrl such that it is difficult to change the remote site settings every time.
Any way to dynamically change the remote site setting? Please help me.
I have a sandbox in which BigMachines-Salesforce Commerce Integration Package (Version 4.14) is installed. Now we are able to connect to bigmachine and create quotes using this package.
Is there any other way to connect to BigMachines other than through the package? I did not find any api for this.
I have created an input form. The input form fields are Name, Status, Start time and End time which are the fields of Deliverable object. On click of Add button the values entered in the input text fields have to be displayed in the table. Here is the code i have written:

Controller:

public with sharing class TBN_ProjectDeliverable {

public List<Project__c> lstProjects = new List<Project__c>();
public List<Delivarable__c> lstDeliverables {get; set;}
public Delivarable__c objDelivarable = new Delivarable__c();
public String selectedProject {get; set;}
public String inputName {get; set;}
public String inputStatus {get; set;}
public String inputStartTime {get; set;}
public String inputEndTime {get; set;}
public boolean showInputForm {get; set;}
public boolean showTable {get; set;}
public Integer counter = 0;

public TBN_ProjectDeliverable(){

    lstProjects =   ([  SELECT Name
                        FROM Project__c
                        WHERE Status__c = 'Active'
                    ]);
    lstDeliverables = new List<Delivarable__c>();
}

public List<SelectOption> getActiveProjects(){

    List<SelectOption> lstSelectOptions = new List<SelectOption>();

    for(Project__c objProject: lstProjects) {

        lstSelectOptions.add(new SelectOption(objProject.Name , objProject.Name));
    }

    return lstSelectOptions;
}

public void btnGo() {

    showInputForm = true;
}

public Delivarable__c getDelivarable {

    get{

        System.debug('=====objDelivarable======'+objDelivarable);
        return objDelivarable;

    } set;
}

public pageReference addDataToTable() {

    showTable = true;
    System.debug('=====objDelivarable======'+objDelivarable);
    lstDeliverables.add(objDelivarable);
    System.debug('=====lstDeliverables======'+lstDeliverables);
    System.debug('=====lstDeliverables.Name======'+lstDeliverables[0].Name);

    return null;
}

public void btnEdit(){

}

public void btnSave() {

    Database.insert(objDelivarable);
}

public void btnCancel() {

}
}

Vf page:

<apex:page Controller="TBN_ProjectDeliverable" sidebar="false" tabStyle="Project__c">
<apex:form >
    <apex:pageBlock title="Project Deliverable" id="thePageBlock">
        <apex:pageBlockSection >
            <apex:selectList label="Active Projects:" value="{!selectedProject}" size="1">
                <apex:selectOptions value="{!ActiveProjects}"/>
            </apex:selectList>
            <apex:commandButton action="{!btnGo}" value="Go"/>
        </apex:pageBlockSection>

        <apex:pageBlockSection title="Create deliverable record" rendered="{!showInputForm}">
            <apex:inputfield value="{!getDelivarable.Name}"/>
            <apex:inputfield value="{!getDelivarable.Status__c}"/>
            <apex:inputfield value="{!getDelivarable.Start_Time__c}"/>
            <apex:inputfield value="{!getDelivarable.End_time__c}"/>
            <apex:commandButton action="{!addDataToTable}" value="Add" rerender="thePageBlockTable, thePageBlock"/>
        </apex:pageBlockSection>

        <apex:pageBlockSection title="Table of deliverable records" rendered="{!showTable}" columns="1" id="thePageBlockTable">
            <apex:pageBlockTable value="{!lstDeliverables}" var="objLstDeliverables" >
                <apex:column headervalue="Name">
                    <apex:outputText value="{!objLstDeliverables.Name}"/>
                </apex:column>
                <apex:column headervalue="Status">
                    <apex:outputText value="{!objLstDeliverables.Status__c}"/>
                </apex:column>
                <apex:column headervalue="Start Time">
                    <apex:outputText value="{!objLstDeliverables.Start_Time__c}"/>
                </apex:column>
                <apex:column headervalue="End Time">
                    <apex:outputText value="{!objLstDeliverables.End_time__c}"/>
                </apex:column>
                <apex:column headervalue="Edit">
                    <apex:commandLink value="Edit" action="{!}"/>
                </apex:column>
            </apex:pageBlockTable>
            <apex:commandButton action="{!btnSave}" value="Save" />
            <apex:commandButton action="{!btnCancel}" value="Cancel"/> 
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>       
</apex:page>

I am getting the input form data in the table. But on re-entering the form data with new values, the previous data is getting overriden in the table. Please help to to solve this problem.
https://developers.google.com/drive/web/manage-downloads

In the above link it is given that we have to make a GET request to the downloadUrl (which we get in the response when we upload the file) in order to get the file contents.

The downloadUrl which I got after uploading file to google drive is :
"downloadUrl": "https://doc-10-cc-docs.googleusercontent.com/docs/securesc/2butu3k0aok5svkleqovepe3uqqvauqr/9o0jdpikd3jl5krf0vgcacuhfl8gro0v/1408694400000/05688347114777583261/05688347114777583261/0B602YDdndVQ6LUxZRC0wX1ZtWWs?h=16653014193614665626&e=download&gd=true"

Now i am making GET request like this:

        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setMethod('GET');
        req.setEndpoint(downloadURL);
        req.setHeader('content-type', 'text/plain');
        req.setHeader('Authorization','Bearer '+accessToken);
        req.setTimeout(60*1000);
        HttpResponse resp = http.send(req);

My problem is that, each time i upload the file i will get different downloadUrl such that it is difficult to change the remote site settings every time.
Any way to dynamically change the remote site setting? Please help me.

How the formula will look like if you want to calculate the date/time difference b/w created date ?


Today() – datevalue(created date)

Now() – created date

DateValue(created date) – today()

Created date – Now()

Dynamic dashboard have schedule refresh?

a)true

b)false

how?


Custom objects in sites have which kind of permission ?
A. Read Only
B. Read, Create, Edit and Delete
C. Read and Create
D. Read, Create and Edit

explain?

Encrypted fields are editable regardless of whether the user has the “View Encrypted Data” permission.
A. True
B. False

explain?


A corresponding list view is also automatically created, When a queue is created in Salesforce.com.
A. True
B. False

explain?

Which of the following is not a correct statement ?
A. Tags can be enabled by enabling Tags permission for the Organization
B. Tags can be enabled by enabling Tags permission for the Profiles
C. Tags can be added on the Records
D. Tags can be accessed from the Sidebar component

What happens to the Secondary Relationship when the Primary Relationship is deleted in the Junction Object ?


A. Nothing Happens
B. Secondary Relationship becomes Primary Automatically
C. Secondary Relationship is made Primary manually
D. You can’t delete the primary relationship


Which of the following is not true regarding Custom Summary Formula fields ?
A. One can have 5 Custom Summary Formulas on a report
B. When fields are deleted, they are also deleted from the summary formulas that reference them
C. The summary types Sum, Largest Value, Smallest Value, and Average are not available for use with the Record Count Field
D. Summary formula can reference another summary formula


Default values can be set on the Dependent Picklist Fields ?
A. True
B. False

First, I want to appoligize.  I don't think this issue belongs here but I could not find the proper community for it.  Searching salesforce.com and the web turns up nothing.

 

Under users Profiles there is an options to check or uncheck Password Never Expires.  When I go under the System Administrator's profile to edit the profile that checkbox is disabled.

 

Does anyone know how to enable it?

 

I do not want to use the Password Policy and set everyone's password to not expire.  I only want to set it for the System Administrator.

 

This issues exists in both the Enterprise and Developer additions.

 

Please don't reply with random suggestions.  I wish only to hear from those who have seen this problem and have successfuly resolved it.

 

When using lightning datatable and displaying a date field, its showing a day less than the value in the backend object.

Controller:
component.set('v.Columns',[
                {label:'Transport. mode', fieldName:'Mode_of_Transportation__c', type:'text', editable: false,initialWidth:180},
                {label:'Ground Company', fieldName:'Ground_Transportation_Company__c', type:'text', editable: false,initialWidth:210},
                {label:'Inv./Chg. date', fieldName:'Charge_Invoice_Date__c', initialWidth:150, type:'date', editable: false , typeAttributes:{month:'2-digit',day:'2-digit',year:'numeric'}}
            ]

Datatable:

            <lightning:datatable aura:id="OppExpGTDataTable"
                                 data="{! v.Opp_Expenses_GTXYZ }" 
                                 columns="{! v.Columns }" 
                                 keyField="Id"
                                 onsave ="{!c.onSave}"
                                 hideCheckboxColumn="true"
                                 onrowaction="{! c.handleRowAction }"/>

Using a custom pop up, we are creating records into database capturing date values. Its getting stored in database properly, when displaying in UI, its showing a day less. In out of the box fields, its showing correctly again. How to format the field in lightning datatable/controller? Appreciate your help..