• Arjun Srivastava
  • NEWBIE
  • 25 Points
  • Member since 2012
  • Salesforce Consultant
  • Cloudmetics Inc.


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 9
    Questions
  • 10
    Replies

I have a picklist named as 'Status' on Lead object.
picklist Field status have values as : 'New','Cold','Process','Dead'.

Once user has selected status as 'Cold',he can't go back and select 'New' as a value instead he is allowed to select 'Process' or 'Dead' as a new value. I want to make this happen using validation rule. Please help.
I have written this:


AND(ISPICKVAL(PRIORVALUE(Status),"Process"),OR(CONTAINS(TEXT(Status),"New"),CONTAINS(TEXT(Status),"Cold")))


Is there any other good approach to do this?
Can i also get the values of picklist in a generic way without hardcoding the picklist values in a validation rule.

 

Thanks!

Hi Friends,

 

I have been stuck in one issue where I'm creating a mergefield in a apex controller's property and displaying it on the page.

 

Below is the code for reference:

 

public with sharing class emailtempcls {
public string temps {get;set;}
public emailtempcls()
{
    temps='{!$user.username}';
}
}

 

<apex:page Controller="emailtempcls">
{!temps}
{!$User.Username}
</apex:page>

Actual  Output:  {!$user.username}   xyz@gmail.com

Desired Output :  xyz@gmail.com  xyz@gmail.com

How can i convert temps value as the mergefield value on page?

 

Can anyone please help me in converting merge field value dynamically. Is it possible? Any Suggestions would be really appreciated.

 

 

Thanks!

 

 

I am using a standard page on which there is a button in which JavaScript code is written. It is calling a Controller (Class).

When I ever used click on the button,It gives me error:

A problem with the OnClickJavaScriptforthis button or link was encountered:
unterminated
string literal.

Javascript&colon;

try
{
  alert
('hi1');
}
catch(Err)
{
  alert
('Error  in creation'+Err);
}

After searching and done some hit and trial,used a simple alert code above.

I found that. whenever i used data where there is a new line space between them i.e. data in multiple times.This error encounters no matter if you are using that particular field in JavaScript code and class or not.

 

 

 

What i am trying to say is : i am not using that field anywhere in the JavaScript code. I am just simply using alert('hi');.

Nothing else you can also try just create a custom button on sfdc detail page ,call JavaScript on it and put data in any Long text area field with multiple line.You will get same error. Any work around for this?

Hi,

I have an ApiName and value pair in String form like given below. 

 

String fieldvalpair='Name=Aig Sun america,Lead_Status__c=Contacted,Lead_Source__c=Inhouse';

 

 

Prospect pros=new Prospect(id='a0YQ0000003YLph');

 


I want to update record pros,how can i do that?

 

thanks!

  Which of the following refers to the data model of Salesforce:
a. Force.com API
b. Force.com Metadata API
what is the ans?
 
 Which developer tool can be used to create a data model 
(2 answers)
  
A.Force.com IDE
B.Force.com Data Loader
C.Application Set -up Menu
D.API


Please answer anyone

 

 


A developer needs to support multiple currencies for a custom object in an application? Multi-currency has been enabled, what does the developer need to know to support the application?
(2 answers)

  

 

A.

Must input currency ISO Field

 

B.

Admin can add additional currencies once set up

 

C.

Roll up summary fields will calculate incorrectly if children have multiple currencies

 

D.

Track Currency changes automatically.

 

 

 

Hi please anyone answer this question , am preparig for 401 exam.

 

 

 

Hello,

 

I have an apex class in which i call a web service. I receive a response value from the webservice in which I need to extract a key value from. I've been looking at the XMLStreamReader documentation at http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_xml_XmlStream_reader.htm


My Rest Api Xml response is :

String response=

<xml version='1.0' encoding='UTF-8' ?>
<response><status>listing_ok</status>
<tree><folder id="0" name=""  >
<folders>
<folder id="297301978" name="Bicky Rista" ></folder>
<folder id="297301898" name="Jason"  ></folder>

<folder id="297301898" name="Box.net"  ></folder>
</folders>
</folder>
</tree>
</response>

 

I am doing this:

 

  XmlStreamReader  reader = new XmlStreamReader(response);

            // Read through the XML  
            //and extract the folderid
            while(reader.hasNext()) {
             // System.debug('Event Type:' + reader.getEventType());
            if (reader.getEventType() == XmlTag.START_ELEMENT &&  reader.getlocalname()=='folder') {
                  FolderID=reader.getAttributeValue(null,'id');
                  reader.next();
                  // System.debug('=================='+reader.getText());
                 // FolderID= reader.getText();
                  
              }
              reader.next();
            }

 

Above am getting the id of the Ist folder inside Parent Folder.

As you guys can see Parent Folder has 3 Subfolders.

I want to know to the id of the sub- folder on the basis of the foldername.How can i achieve this.?

 

Thanks.!

Hi,

I have 2 strings contating words separated by comma.
I want to compare the two strings.

Example:
String1={sfdc,developer,star,Apex};

String2={software Developer,Java,cloud,apex};

can anyone hepl me doing this.

 

Thanks 

I am getting this erro when trying to add the Wave Analytics Manager permiossion set to a user. The permission set contains the Create and Edit Wave Analytics Dashboards, so I am not sure wht the problem is? The profile is System Admin. User license is Salesforce.

"Can't assign permission set Wave Analytics Manager to user Elyse McCulla. The user license doesn't allow the permission: Create and Edit Wave Analytics Dashboards"    

Hi Friends,

 

I have been stuck in one issue where I'm creating a mergefield in a apex controller's property and displaying it on the page.

 

Below is the code for reference:

 

public with sharing class emailtempcls {
public string temps {get;set;}
public emailtempcls()
{
    temps='{!$user.username}';
}
}

 

<apex:page Controller="emailtempcls">
{!temps}
{!$User.Username}
</apex:page>

Actual  Output:  {!$user.username}   xyz@gmail.com

Desired Output :  xyz@gmail.com  xyz@gmail.com

How can i convert temps value as the mergefield value on page?

 

Can anyone please help me in converting merge field value dynamically. Is it possible? Any Suggestions would be really appreciated.

 

 

Thanks!

 

Hi,

 

I've created a simple VF email template based on the solution found in this forum. However, i found out that the labels are printed many times if there are a few contact roles associated with an opportunity. How do i modify my codes to print the labels of my primary contact role?

 

Appreciate some help. Thanks.

 

My VF codes as below:

 

<messaging:emailTemplate subject="Call Hot Lead" recipientType="User" relatedToType="Opportunity">
<messaging:plainTextEmailBody >

Account: {!Relatedto.Account.Name}
Opportunity Name: {!Relatedto.Name}
<apex:repeat value="{!RelatedTo.OpportunityContactRoles}" var="ContactRole">
Name: <apex:outputText value="{!ContactRole.Contact.Salutation}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext> <apex:outputText value="{!ContactRole.Contact.Name}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
Title: <apex:outputText value="{!ContactRole.Contact.Title}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
Workplace: <apex:outputText value="{!ContactRole.Contact.Workplace__c}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
Contact Status: <apex:outputText value="{!ContactRole.Contact.Contact_Status__c}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
Source: <apex:outputText value="{!ContactRole.Contact.Source__c}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
Direct Phone: <apex:outputText value="{!ContactRole.Contact.Direct_Phone__c}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
Ext: <apex:outputText value="{!ContactRole.Contact.Ext__c}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
Mobile: <apex:outputText value="{!ContactRole.Contact.MobilePhone}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
Email: <apex:outputText value="{!ContactRole.Contact.Email}" rendered="{!AND(ContactRole.isPrimary)}"></apex:outputtext>
</apex:repeat>

Detail: {!Relatedto.Description}
 
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

 

I am using a standard page on which there is a button in which JavaScript code is written. It is calling a Controller (Class).

When I ever used click on the button,It gives me error:

A problem with the OnClickJavaScriptforthis button or link was encountered:
unterminated
string literal.

Javascript&colon;

try
{
  alert
('hi1');
}
catch(Err)
{
  alert
('Error  in creation'+Err);
}

After searching and done some hit and trial,used a simple alert code above.

I found that. whenever i used data where there is a new line space between them i.e. data in multiple times.This error encounters no matter if you are using that particular field in JavaScript code and class or not.

 

 

 

What i am trying to say is : i am not using that field anywhere in the JavaScript code. I am just simply using alert('hi');.

Nothing else you can also try just create a custom button on sfdc detail page ,call JavaScript on it and put data in any Long text area field with multiple line.You will get same error. Any work around for this?

  Which of the following refers to the data model of Salesforce:
a. Force.com API
b. Force.com Metadata API
what is the ans?
 

We have code that does the following:

 

  • Queries CronTrigger to see if there’s an entry for a job with an Id we previously saved in a custom setting.
  • If there is such an entry, calls System.abortJob() to kill that job. If necessary, calls System.abortJob() twice.
  • Schedules the job to run.
  • Saves the Id of the newly-scheduled job in that custom setting

 

Very intermittently, when we save the Id of the newly-scheduled job in the custom setting, we get a Mixed DML error:  First exception on row 0 with id a0E3000000Gj95IEAR; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): OurPkg__Settings__c, original object: CronJobDetail: []

 

The Id (a0E3000000Gj95IEAR) refers to the record for the custom setting.

 

We’re not (of course) touching CronJobDetail directly, and don’t know why we’d get a Mixed DML error for what should be a relatively innocent piece of code, or why the error happens only intermittently. To be clear, we are not doing any direct DML operations on any setup objects -- the closest we come to that is scheduling and aborting jobs.

 

Any thoughts on why we're getting this error, especially only intermittently, and on what we can do to get around it?

 

Thanks.

Hello,

 

I have an apex class in which i call a web service. I receive a response value from the webservice in which I need to extract a key value from. I've been looking at the XMLStreamReader documentation at http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_xml_XmlStream_reader.htm


My Rest Api Xml response is :

String response=

<xml version='1.0' encoding='UTF-8' ?>
<response><status>listing_ok</status>
<tree><folder id="0" name=""  >
<folders>
<folder id="297301978" name="Bicky Rista" ></folder>
<folder id="297301898" name="Jason"  ></folder>

<folder id="297301898" name="Box.net"  ></folder>
</folders>
</folder>
</tree>
</response>

 

I am doing this:

 

  XmlStreamReader  reader = new XmlStreamReader(response);

            // Read through the XML  
            //and extract the folderid
            while(reader.hasNext()) {
             // System.debug('Event Type:' + reader.getEventType());
            if (reader.getEventType() == XmlTag.START_ELEMENT &&  reader.getlocalname()=='folder') {
                  FolderID=reader.getAttributeValue(null,'id');
                  reader.next();
                  // System.debug('=================='+reader.getText());
                 // FolderID= reader.getText();
                  
              }
              reader.next();
            }

 

Above am getting the id of the Ist folder inside Parent Folder.

As you guys can see Parent Folder has 3 Subfolders.

I want to know to the id of the sub- folder on the basis of the foldername.How can i achieve this.?

 

Thanks.!

I am getting this erro when trying to add the Wave Analytics Manager permiossion set to a user. The permission set contains the Create and Edit Wave Analytics Dashboards, so I am not sure wht the problem is? The profile is System Admin. User license is Salesforce.

"Can't assign permission set Wave Analytics Manager to user Elyse McCulla. The user license doesn't allow the permission: Create and Edit Wave Analytics Dashboards"