• gautam_singh
  • SMARTIE
  • 1190 Points
  • Member since 2012

  • Chatter
    Feed
  • 33
    Best Answers
  • 0
    Likes Received
  • 10
    Likes Given
  • 5
    Questions
  • 196
    Replies


Below I have a trigger with a custom object called Unit__c. The custom object has a Ship_Date__c field. On my other custom object Warranty__c. I have two date fields Warranty_Active_Date__c  and Warranty_End_Date__c.  I need my trigger to look at the ship date on the unit object and find records that have a ship date >= Warranty_Active_Date__c and a ship date <=  Warranty_End_Date__c. For some reason I can't find why my trigger is not working. Any help would be appreciated. 
 
//Ceated by Bob Poliquin 2/16/2016 works with ship dates
trigger Trigger_UpdateWarranties on Unit__c (before insert, before update ) {


// Step 1: Create a set of all products of Units to query
  Set<Date> allwrntyad = new Set<Date>();
  Set<Date> allwrntyed = new Set<Date>();
  Set<String> products = new Set<String>();
  
for (Unit__c newUnit : Trigger.new) {
   if (newUnit.Ship_Date__c != null){
      allwrntyad.add(newUnit.Ship_Date__c);
      allwrntyed.add(newUnit.Ship_Date__c); 
      products.add(newUnit.Product__c);
      
      
    }  
  }

  // Step 2: Query for all the Units in Step 1
  List<Warranty__c> potentialproducts = [SELECT Id, Name, Warranty_Active_Date__c, Product__c,Warranty_End_Date__c FROM Warranty__c
                                 WHERE Product__c = :products AND Warranty_Active_Date__c >= :allwrntyad AND Warranty_End_Date__c <= :allwrntyed ];

  
   // Step 3: Make a Map that lets you search for units by product
  Map<String, Warranty__c> wrntyMap = new Map<String, Warranty__c>();
  for (Warranty__c w : potentialproducts) {
     wrntyMap.put(w.Product__c, w);
  }
 // Step 4: Get the matching Warranty in the Map by product!
  for (Unit__c newUnit : Trigger.new) {
     if (newUnit .Warranty_Type__c == null) {
      Warranty__c product = wrntyMap.get(newUnit.Product__c);
      
     if (wrntyMap.containsKey(newUnit.Product__c )) {
       newUnit.Warranty_Type__c = product.Id;
      }
    }
  }
    
 
    }

 
  • March 24, 2016
  • Like
  • 0
Hello All,
-:Apex Class:-

public class Innerclass4List 
{
    public class fourlists
    {
        public List<Integer> firstlist ;
        public List<Account> secondlist ;
        public List<Opportunity> thirdlist ;
        public List<String> fourthlist ;
    }
    public List<Account> selected (List<fourlists> FL)
    {
        return FL[0].secondlist;
    }  
}

-:Test Class:-

@isTest
public class testInnerclass4List 
{
    static testMethod void testmethodfourlist()
    {
        List<Innerclass4List.fourlists> testresultlist = new List<Innerclass4List.fourlists>();
           Innerclass4List.fourlists ICF = new Innerclass4List.fourlists();

            Account acct = new Account();
                
                   acct.Name = 'Ashok';
                acct.AnnualRevenue = 10000;
                acct.Phone = '0731467890';
        
                ICF.secondlist.add(acct);

                testresultlist.add(ICF);
       Innerclass4List ICL = new Innerclass4List();
       List<Account> secondlist = ICL.FL(testresultlist);
       system.assert(secondlist.size()>0);          
    }
}

Where I went wrong; I can't figure it out. I need your help. Please Let me know if you are getting error.

Thank you all in advance 
Hi All,

For example, i have a requirement to display all fields of the object. Assume that Object has 100 fields.
Can i fill all 100 fields in a single query? how we can display. please give me appropriate solution(Query).

Thank you all.
Hi,

I have created the checkbox field Physician.I want to put the validation rule that if current value of this field is not equal to prior value then user with role "VP Finance" can  update this field.

i tried to design the below rule but it's incomplete.how can i check "current value of this field is not equal to prior value" in the below rule.

AND(
ISCHANGED(Dormant_Physician__c),
$UserRole.Name <> "VP Finance")

can anyone please help?

Rajashri

What are the relationships between all standard objects in Salesforce?

Hi trying to make a validation rule with those criterias:

 

-If Estimated value = null

and Status picklist value =faxed

and date fax sent is greater than 11/1/2013

 

here's what i wrote so far, but i seem to have an error somewhere as when i try to save a lead with the first 2 criterias but date fax sent older than 11/1/2013 i still get validated and cannot save lead.

 

 

formula:

AND(
NOT($Profile.Name = "System Administrator"),
ISNULL( Estimated_Value__c ),
ISPICKVAL( Status, "Faxed"),
Date_Fax_Sent__c > date(11,1,2013 ))

 

 

If someone could help me out I would appreciate

 

 

thx in advance

  • November 25, 2013
  • Like
  • 0

Hello!  I have two WF that trigger the same Email Alert notifying our support team when a new Critical case is created during the weekend and after hours.   I now have a 3rd requirement and don't want to increase the noise be introducing a 3rd WF email alert.  I'm trying to combine these into a single formula WF:

 

First WF:  Rule Criteria = (Case: Hour CreatedEQUALS0,1,2,3,4,5,17,18,19,20,21,22,23,24) AND (Case: PriorityEQUALSCritical)

2nd WF:  Rule Criteria = (Case: Case Creation DayEQUALSSaturday,Sunday) AND (Case: PriorityEQUALSCritical)

3rd WF (new):  This new WF will need fire off when a Critical case is created during a Company Holiday:

 

Here is the formula that I worked up, but it keeps telling me I'm missing a ")" somewhere:

 

IF(AND(ISPICKVAL(Priority,"Critical"),
OR (Hour_Created__c,"0",
Hour_Created__c,"1",
Hour_Created__c,"2",
Hour_Created__c,"3",
Hour_Created__c,"4",
Hour_Created__c,"5",
Hour_Created__c,"17",
Hour_Created__c,"18",
Hour_Created__c,"19",
Hour_Created__c,"20",
Hour_Created__c,"21",
Hour_Created__c,"22",
Hour_Created__c,"23",
Hour_Created__c,"24"))),True,

 

IF(AND(ISPICKVAL(Priority,"Critical"),
OR (Case_Creation_Day__c,"Saturday",
Case_Creation_Day__c,"Sunday"))), True,

 

IF(AND(ISPICKVAL(Priority,"Critical"),
OR (CreatedDate ,"2013,09,2",
CreatedDate ,"2013,11,28",
CreatedDate ,"2013,11,29",
CreatedDate ,"2013,12,24",
CreatedDate ,"2013,12,25",
CreatedDate ,"2014,01,01"))),True,False))

 

Hi, I have to ask before I go too far down the wrong road here but:

 

Can Salesforce.com Apex create pdf's natively?

 

If not any suggestions on what I would need to easily create a PDF that could be used like a Proforma or Invoice?

 

Also, when I create the PDF needed any suggestions as to how best attach it to an email template?

 

Thank you,

Steve Laycock

Hello, I am new to the Salesforce programming world and I'm trying to create an apex trigger before insert. My object is a trip__c and It has a lookup to an account. I want to validate that before insertion is done, that the account name doesn't have the word "region" in it. Also, I would like if you could provide me with a guidance as to where I can learn the Salesforce apex language to create triggers, classes, pages, etc... Thank you.

The bellow component is giving returning blank(but its printing the value "Hellow all") when used in a visualforce page ..
but when used in a plain html in my local machine is returning the map.
Please advice

<apex:component > Hello all <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map-canvas { height: 100% } </style> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map-canvas { height: 100% } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=KeyXXXX&sensor=false"> </script> <script type="text/javascript"> function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="map-canvas"/> </body> </apex:component>


I want to make a slideshow of images by embedding javascript in visualforce.

I wrote the following code. It shows the same image even after clicking next button. Can anyone tell me how to fix it? thanks

 

<apex:page showChat="false" sidebar="false" standardController="account">
<apex:pageBlock >
<apex:form >
<center>
<apex:image id="img" value="{!$Resource.one}" width="600" height="400"/>
<br>
</br>

<apex:commandButton value="Next" styleClass="groovybutton" onclick="next();return false;"/>

</center>
</apex:form>
<script>
function next()
{

var img = document.getElementById('img');
img.value= "{!$Resource.two}";

}
</script>
</apex:pageBlock>
</apex:page>

Hi All,

 

 pls explain bellow statement how to build this ?

 

location.replace('_ui/core/email/author/EmailAuthor?p2_lkid={!Commercial_Agreement__c.My_Cutom_To_EmailField__c}&rtype=003&p3_lkid={!Commercial_Agreement__c.Id}
&rtype=003&p24={!Commercial_Agreement__c.My_Custom_AdditionalToEmail__c}&retURL=/{!Commercial_Agreement__c.Id}&template_id=00XA0000000Dv41')

 

and what are the p2_lkid, rtype,  p3_lkid and where we can see this variables and wher these values will send (where it will check)?

Hi Folks ,

can any one help me 

 

What is the difference in this syntax below :

 

list<Student__c> newstud = trigger.new;
for(Student__c st: trigger.new)
if(trigger.new[].fee__c>500)

 

Thanks in Advance 

 

  • August 23, 2013
  • Like
  • 0

hi 

 

I found the solution by searching. For this error

It should delete the schedule.

But I can not delete a schedule.

I wonder if there is another way.

 

thank.

 

 

Hi, 

 

  I have system adminstrator profile and application expert role. I get to see old report builder format. where as the same setteing holding another user is able to view new report builder. 

 

  Please suggest me how to enable new report builder. 

 

Thanks

Sudhir

 

Hi , 

Can anyone help me cover this picece of code. I am trying such that whenever someone installs my managed package a schdeule runs which calls a method to execute.

My Code is below : 

global without sharing class PostInstallClass implements InstallHandler {

    //public system.Version cotext{get;set;}
    global void onInstall(InstallContext context) {
        
          if(context.previousVersion() == null) {
        //cotext = System.requestVersion();
        ScheduleCodeUpdate objhclass = new ScheduleCodeUpdate();
        system.schedule('ScheduleclassEveryhour', CRON_STRING , objhclass); 
        }
    } // execute 
}// class PostInstallClass

 

and my Test Class is : 

@istest
public without sharing class TestPostInstallClass {
    
    public static void TestPostInstallClass() {
        
        PostInstallClass postinstall = new PostInstallClass();
        Test.testInstall(postinstall, null);
       // Test.testInstall(postinstall, postinstall.cotext  , false);
        
    }
}

 
Code Samples to cover Schedule Code of Managed Package are highly appreciated.

Thank You. 



A job application object has a child review object to store candidate review. The review needs to be tracked between a score of 1 to 5.
The score has to be a choice between 1 and 5 displayed as a radio button. How will a developer cater to this requirement? Choose the Right answer

1. Create 5 fields for scores (1 to 5) of type radio-button and use it in review page layout.
2. Create a dependent pick list that feeds the radio button type field.
3. Create a formula field
4. Create visual force page with radio buttons for review object

 

Explain it?

 

 

 

Universal Containers tracks interview scores in Review object. Review score is tracked in numerical format and are restricted to 1-5 and displayed as Radio buttons. How developer must meet this requirement?

 

a) Create VF component to display interview score as a set of radio button
b) Create a formula field that displays interview score as radio buttons
c) Create interview score as picklist and display them as radio buttons on page layout
d) Create interview score field with data type of radio button

 

Explain it?

Is it possible in Salesforce.com to Stop the Roll Up of Role Hierarchy for Standard Objects ?
A. Yes
B. No


Person accounts count against both account and contact storage because the API considers each person account to consist of one account as well as one contact.
A. True
B. False

Ids can not be identified from which of the following standard ways :
A. From Formula Fields
B. From the Salesforce.com URL when a record is displayed in
C. Through the web services API i.e. Data Loader
D. From reports

The Status field cannot be updated by approval processes ?
A. True
B. False


Fields marked Always Displayed on page layouts are automatically included on the mini page layout and cannot be removed unless they are removed from the page layout.
A. True
B. False

Mini page layouts inherit record type and profile associations, related lists, fields, and field access settings from their associated page layout.
A. True
B. False

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

Where do you change the Hover detail? Choose the Right answer a) Mini View b) Page Layout c) Profile d) Mini Page Layout

I have a custom community and we are using site.forgotpassword(username) method to send a reset link for the user. This works with some user who reqest for a reset using Forgot Password Link BUT it does not works with other users within the same domain.

There seems to be an issue with this method OR something I might be missing. Is there anyone else who is facing this issue ? Any Suggestions ? 
 
I need to remove the Standard Record Type Field from Library Page Layout. I had record types earlier which I have deactivated and even deleted but still the Master Record Type is present on the page layout of Content/Library when we try to contribute a file.

Methods I have tried :

I have deleted the Record Types. Still the field is available.
I have deactivated the record type. Still I was able to find that field.
I even tried to remove the record type access to the profile. Still the field was there.



General Record Type Field
HI,

We are working on Salesforce Communities using the standard Napili Template. We have Feed-Item and Feed-Comment Object where we can insert data extracted from legacy system. 

Feed-Item and Feed-Comment will make the Questions and Answers over Community. As we are ending up contract with the legacy system, we do not want any reference to the Questions/Answers from the legacy System.

The Questions and Answers data received from legacy System contains Images Links which are to be attached/embed with the Feed Comments(Answers) and Feed-Items(Questions) . These Images are stored on the legacy system server and can be accessed in the browser using the URL. 

We know that in order to link content/attachments to Feed_Comments and Feed_Items we need to insert data into Content Version(Files). 

For Inserting Data into Content Version we need to fill PathOnClient and VersionData field. The Path should be a local directory. But in our case it is in the form of a URL which references to the server of external legacy system. 

When we try to insert using the URL referring to external legacy server, we are able to insert a Content but that actually stores a reference and not the actual image/document. 

We need to know How can we Insert records in Content-Version via URL/Path of NON-Local Server. 
I have a Community where I need to map discussions with topics created. I have an .csv mapping of topics to feed-Items created which I need to insert.  While inserting data into Topic Assignment Object via Work-Bench (Topic Assignment is not available in Data Loader). I am getting the following error: UNKNOWN ERROR: Too many object types to load: 314

 
Hi, 

In Campaign Object, I have 1 Field - Email template. In a Batch, I am processing a list of campaignMembers(from different Campaigns)
to send them an email with specified template. I am using  Messaging.MassEmailMessage and hence froth no Loop for Emails.

Problem:

    Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
    mail.setTargetObjectIds(LeadIds);
    mail.setTemplateId('00X30000001fOKk');
    Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
    
    Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
    mail.setTargetObjectIds(ContactIds);
    mail.setTemplateId('00X30000001fOKk');
    Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
    
This is currently taking Hard-Coded value.What I need is it for every campaignMembers record it should check the campaign's Email Template Field & sends the email using that specified Email Template. Loop does not works ! :-( 
        

Any help/approach would be highly appreciated.

Thanks
Gautam


Below I have a trigger with a custom object called Unit__c. The custom object has a Ship_Date__c field. On my other custom object Warranty__c. I have two date fields Warranty_Active_Date__c  and Warranty_End_Date__c.  I need my trigger to look at the ship date on the unit object and find records that have a ship date >= Warranty_Active_Date__c and a ship date <=  Warranty_End_Date__c. For some reason I can't find why my trigger is not working. Any help would be appreciated. 
 
//Ceated by Bob Poliquin 2/16/2016 works with ship dates
trigger Trigger_UpdateWarranties on Unit__c (before insert, before update ) {


// Step 1: Create a set of all products of Units to query
  Set<Date> allwrntyad = new Set<Date>();
  Set<Date> allwrntyed = new Set<Date>();
  Set<String> products = new Set<String>();
  
for (Unit__c newUnit : Trigger.new) {
   if (newUnit.Ship_Date__c != null){
      allwrntyad.add(newUnit.Ship_Date__c);
      allwrntyed.add(newUnit.Ship_Date__c); 
      products.add(newUnit.Product__c);
      
      
    }  
  }

  // Step 2: Query for all the Units in Step 1
  List<Warranty__c> potentialproducts = [SELECT Id, Name, Warranty_Active_Date__c, Product__c,Warranty_End_Date__c FROM Warranty__c
                                 WHERE Product__c = :products AND Warranty_Active_Date__c >= :allwrntyad AND Warranty_End_Date__c <= :allwrntyed ];

  
   // Step 3: Make a Map that lets you search for units by product
  Map<String, Warranty__c> wrntyMap = new Map<String, Warranty__c>();
  for (Warranty__c w : potentialproducts) {
     wrntyMap.put(w.Product__c, w);
  }
 // Step 4: Get the matching Warranty in the Map by product!
  for (Unit__c newUnit : Trigger.new) {
     if (newUnit .Warranty_Type__c == null) {
      Warranty__c product = wrntyMap.get(newUnit.Product__c);
      
     if (wrntyMap.containsKey(newUnit.Product__c )) {
       newUnit.Warranty_Type__c = product.Id;
      }
    }
  }
    
 
    }

 
  • March 24, 2016
  • Like
  • 0
I can't complete the Salesforce connect trailhead, the command to run heroku locally, DATABASE_URL=`heroku config:get DATABASE_URL` PGSSLMODE=require npm start, throws a syntax error:"The term 'DATABASE_URL' is not recognized as the name of a cmdlet,function, script file, or operable program. 
If I assign a profile to a user, with field level security specified for a concrete field, and I assign a permission set to the same user, with a different permission level specified for that field, which one takes precedence? the most restrictive? Thanks
Hello All,
-:Apex Class:-

public class Innerclass4List 
{
    public class fourlists
    {
        public List<Integer> firstlist ;
        public List<Account> secondlist ;
        public List<Opportunity> thirdlist ;
        public List<String> fourthlist ;
    }
    public List<Account> selected (List<fourlists> FL)
    {
        return FL[0].secondlist;
    }  
}

-:Test Class:-

@isTest
public class testInnerclass4List 
{
    static testMethod void testmethodfourlist()
    {
        List<Innerclass4List.fourlists> testresultlist = new List<Innerclass4List.fourlists>();
           Innerclass4List.fourlists ICF = new Innerclass4List.fourlists();

            Account acct = new Account();
                
                   acct.Name = 'Ashok';
                acct.AnnualRevenue = 10000;
                acct.Phone = '0731467890';
        
                ICF.secondlist.add(acct);

                testresultlist.add(ICF);
       Innerclass4List ICL = new Innerclass4List();
       List<Account> secondlist = ICL.FL(testresultlist);
       system.assert(secondlist.size()>0);          
    }
}

Where I went wrong; I can't figure it out. I need your help. Please Let me know if you are getting error.

Thank you all in advance 
how can i create a list view dynamically via trigger for any standard objects .
Hi All,

For example, i have a requirement to display all fields of the object. Assume that Object has 100 fields.
Can i fill all 100 fields in a single query? how we can display. please give me appropriate solution(Query).

Thank you all.
how to insert records using csv file in batch apex in salesforce
Hi,

I'm trying to delete a knowledge article version record using apex, in details what I try to do is:
        string t = (string that holds the Id of the article)
        KnowledgeArticleVersion articleToRemove = [SELECT Id FROM KnowledgeArticleVersion WHERE Id = :t];
        delete articleToRemove ;


When I try to save the class I recieve the following error message:
DML operation DELETE not allowed on KnowledgeArticleVersion

Same error messagge if I use the article type insted of KnowledgeArticleVersion (FAQ__kav articleToRemove = [SELECT Id FROM FAQ__kav WHERE Id = :t])
Any suggestion? I found this in the documentation 
  • To create, update, or delete a Knowledge article version, use the call on ArticleType_kav, where ArticleType is the name of the article’s type. For example, to delete use ArticleType_kav.delete(). (see http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_knowledgearticleversion.htm)
but I don't know how to use it.
Thank you for your help.
Hi ,
Help out with this problem

public class Acc1
{
 Account acc=new Account();
    public void accmethod()
    {
       
        acc.Name='deva';
     }
}
  • November 28, 2014
  • Like
  • 1
Hi,

I have created the checkbox field Physician.I want to put the validation rule that if current value of this field is not equal to prior value then user with role "VP Finance" can  update this field.

i tried to design the below rule but it's incomplete.how can i check "current value of this field is not equal to prior value" in the below rule.

AND(
ISCHANGED(Dormant_Physician__c),
$UserRole.Name <> "VP Finance")

can anyone please help?

Rajashri
Hi,

I want to bypass trigger for Community Users.
How to do this?
  • October 13, 2014
  • Like
  • 0
Hi,


I am trying to write a script as a apex class which should check the following req for which i need help on it


1) I am having a custom object called as "Employee HR Hierarchy" where i have the datas populated for all the    fields to it

2) My req is i am having 2 fields like First name and supervisor name (manager's name) present n the employee HR Hierachy

I want to check wheather the supervisor name  present in the record is the manager for the first name present in the custom object record and this applies only  for "ACCOUNT EXECUTIVE" Profile records alone

Help me how to achieve it with the SOQL Query code please

Thanks in Advance
How to send email to different Address like email TO,email CC,Email BCC which is provided by user in custom text field.can it possible with the help of apex
I have two fields "X" and "y" both are text fields.And i want these two fields to be concatenated in a required  text field called "name" in an object.Please help me..... 
  • September 09, 2014
  • Like
  • 1
how to write soql query to get the records from account object which are not modified since one year?
  • September 03, 2014
  • Like
  • 1
Hi All,

We have a requirement to display popup window on the edit page(before click on save button) on opportunity Standard page based on selection of particular picklist value.

Can anyone aware on this requirement.Please sugest me how to overcome from this scenario.

Many Thanks in Advance,

Regards,
Surekha
Hi Team,
I am a beginner in salesforce.I have created a profile in salesforce.com.And I logged in  through java client application with that user name,password and security token. And I created sales force  users from my java application. How can they login without access sales force.Means they don't know about the
security token.They have only the user name and password. The sales force authentication  is only possible through my client application. My question is Is there any way to login without security token?
Hi there,

I have a task need to select a opportunities using standatd list  view page under "Action " check box.
when i check a check box select those opportunities and do some business logic and diaply message.
my question how can i know what are the opportunities are selected using Action check box  is it possible ? since that is standard page opportunity list view page .

  • September 02, 2014
  • Like
  • 1
Hi,
while make a webservice call out I am getting below error: 

Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'

Can someone help on this. How rto resolve it?
Thanks,

I have two fields "X" and "y" both are text fields.And i want these two fields to be concatenated in a required  text field called "name" in an object.Please help me..... 
  • September 09, 2014
  • Like
  • 1
how to write soql query to get the records from account object which are not modified since one year?
  • September 03, 2014
  • Like
  • 1
Hi All,

We have a requirement to display popup window on the edit page(before click on save button) on opportunity Standard page based on selection of particular picklist value.

Can anyone aware on this requirement.Please sugest me how to overcome from this scenario.

Many Thanks in Advance,

Regards,
Surekha
Hi Team,
I am a beginner in salesforce.I have created a profile in salesforce.com.And I logged in  through java client application with that user name,password and security token. And I created sales force  users from my java application. How can they login without access sales force.Means they don't know about the
security token.They have only the user name and password. The sales force authentication  is only possible through my client application. My question is Is there any way to login without security token?
i have 2 objects namely objA,objB.
i have created lookup relationship on objB to objA. objA have some values like abc,xyz(two record names).

here i want to write a validation rule on objA.

While creating objB records when i select abc record from objA i want to make one field mandatory in objB.when i select another record that is xyz record i dont want to validate that field.


i hope im clear with my question.

Regards
Lakshman
Hi there,

I have a task need to select a opportunities using standatd list  view page under "Action " check box.
when i check a check box select those opportunities and do some business logic and diaply message.
my question how can i know what are the opportunities are selected using Action check box  is it possible ? since that is standard page opportunity list view page .

  • September 02, 2014
  • Like
  • 1
Hi i was getting problem with pdf that in visual force page that my "description " field is out of bouce that means i want to break the string i can not able to do that..
when i enter more words in the description field then the half table is only coming in pdf file so can any one find my problem please..

her i am giving my controller and visual foce codes:

controller :

public class QuotePDFAustria{
   
    Public Quote qut{get;set;}
    Public List<QuoteLineItem> QuLiIt{get;set;}
    Public Date dat{get;set;}
   
    Public QuotePDFAustria(ApexPages.StandardController controller){
       
       
        qut = [SELECT id,name,Payment_Terms__c,Notes__c,Customer__r.name,Customer__r.City__c,Customer__r.State__c,Customer__r.Postal_Code__c,Customer__r.Country__c,GrandTotal,Quote_Address_To__r.name,Quote_Address_To__r.Salutation,Quote_Address_To__r.LastName,Quote_Address_To__r.email,Quote_Address_To__r.Phone,Opportunity.Primary_Inside_Sales__r.name,Primary_Inside_Sales__r.name,Primary_Inside_Sales_Email__c,Quote_Date__c,opportunity.Primary_Outside_Sales__r.name,opportunity.Primary_Outside_Sales__r.Phone,opportunity.Primary_Outside_Sales__r.Email,opportunity.Primary_Outside_Sales__r.fax,opportunity.Primary_Outside_Sales__r.Title,Inside_Sales_Fax__c,Inside_Sales_Phone__c,Inside_Sales_Title__c FROM Quote WHERE id =: ApexPages.CurrentPage().getParameters().get('id')];
        QuLiIt = [SELECT id,LineNumber,Quantity,Item_Number__c,Asset__r.Model__c,Part_Description__c,UnitPrice,Asset__r.SerialNumber FROM QuoteLineItem WHERE QuoteId =: qut.id];
       
        if(qut.Quote_Date__c != null)
        dat = qut.Quote_Date__c + 30;
    }
}


VisualForce :

<apex:page standardController="Quote" extensions="QuotePDFAustria" renderAs="pdf">
   <head> 
        
    <style type="text/css">       
        @PageBreak{
            page-break:always;
            page-break-inside:avoid;
        }      
        @media print{
            table {page-break-inside:auto }
            tr    { page-break-inside:avoid; page-break-after:auto }
        }         
        @page {   
            margin-top: 20%;  margin-bottom: 110px; 
            margin-left:50px; margin-right:50px;
            @top-center {                  
                content: element(header);              
            }
            @bottom-left {
                content: element(footer);
                height: 500px;
            }          
        }
        div.footer {  
            position: running(footer);
        }                                  
        div.header { 
            margin:0 50px 0 0;                        
            position: running(header);          
        }
         table.gridtable {
         font-family: verdana,arial,sans-serif;
         font-size:15px;
         color:#000;
         border-width: 1px;
         border-color: #000;
         border-collapse: collapse;
        }
        table.gridtable th {
         border-width: 1px;
         padding: 8px;
         border-style: solid;
         border-color: #000;      
        }
        table.gridtable td {
         border-width: 1px;
         padding: 8px;
         border-style: solid;
         border-color: #000;
        }                                          
       
    </style>
</head>  
   
    <div class="header" align="center" >       
        <div><apex:image height="110px" width="230pk" value="{!$Resource.CC_IMI}"/></div>
    </div>
   
    <apex:form >
        <!-- This Section is for PAGE 1-->
        <table class="gridtable" width="100%">
            <tr>
                <td colspan="2" width="50%" style="vertical-align:Top;padding-top:5px;padding-left:20px;">
                    <u><apex:outputText value="Customer :"/></u>
                    <p><b>{!qut.Customer__r.name}</b><br/>
                        {!qut.Customer__r.City__c}<br/>
                        {!qut.Customer__r.State__c}&nbsp;{!qut.Customer__r.Postal_Code__c}<br/>
                        <b>{!qut.Customer__r.Country__c}</b>
                    </p>
                </td>
                <td colspan="2" width="50%" style="vertical-align:Top;padding-top:5px;padding-left:20px;">
                    <u><apex:outputText value="Supplier :"/></u>
                    <p><b>CCI Valve Technology GmbH</b><br/>
                        Lemböckgasse 63/1<br/>
                        AT-1230 Vienna<br/>
                        <b>Austria</b>
                    </p>
                </td>
               
            </tr>
            <tr align="center">
                <td  style="padding-top:10px;padding-bottom:10px"><apex:outputText value="To :"/></td>
                <td  style="padding-top:10px;padding-bottom:10px">{!qut.Quote_Address_To__r.name}</td>
                <td  style="padding-top:10px;padding-bottom:10px"><apex:outputText value="From :"/></td>
                <td  style="padding-top:10px;padding-bottom:10px">{!qut.Opportunity.Primary_Inside_Sales__r.name}</td>
            </tr>
            <tr align="center">
                <td  style="padding-top:10px;padding-bottom:10px"><apex:outputText value="Email :"/></td>
                <td  style="padding-top:10px;padding-bottom:10px">{!qut.Quote_Address_To__r.email}</td>
                <td  style="padding-top:10px;padding-bottom:10px"><apex:outputText value="Pages :"/></td>
                <td  style="padding-top:10px;padding-bottom:10px"></td>
            </tr>
            <tr align="center">
                <td  style="padding-top:10px;padding-bottom:10px"><apex:outputText value="Phone :"/></td>
                <td  style="padding-top:10px;padding-bottom:10px">{!qut.Quote_Address_To__r.phone}</td>
                <td  style="padding-top:10px;padding-bottom:10px"><apex:outputText value="Date :"/></td>
                <td  style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{0,date,dd'/'MM'/'yyyy}"><apex:param value="{!qut.Quote_Date__c}"/></apex:outputText></td>
            </tr>
            <tr align="center">
                <td width="12%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="Add Data :"/></td>
                <td width="38%" style="padding-top:10px;padding-bottom:10px"></td>
                <td width="12%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="Cc :"/></td>
                <td width="38%" style="padding-top:10px;padding-bottom:10px">{!qut.opportunity.Primary_Outside_Sales__r.name}</td>
            </tr>
        </table><br/>
        <table width="100%" class="gridtable">
            <tr align="center" style="background-color:#C0C0C0;">
                <th width="50%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="QUOTATION No.:"/></th>
                <th width="50%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{!qut.name}"/></th>
            </tr>
        </table><br/><br/>
       
        Dear {!qut.Quote_Address_To__r.Salutation}&nbsp;{!qut.Quote_Address_To__r.LastName},<br/><br/>
        We thank you for your inquiry and offer in accordance with the previous order ............... with the negotiated
        purchase and warranty conditions as follows.<br/><br/><br/>
       
        When ordering, we ask you to refer to the old order and confirm the validity if this purchasing and
        warranty conditions.<br/><br/>
       
       
        <table width="100%" class="gridtable">
            <tr align="center" style="background-color:#C0C0C0;page-break:after:auto;page-break-inside:avoid;">
                <td width="5%" style="padding-top:10px;padding-bottom:10px">Pos.</td>
                <td width="5%" style="padding-top:10px;padding-bottom:10px">Q</td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px">Article No.</td>
                <td width="40%" style="padding-top:10px;padding-bottom:10px">Description</td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px">USD/pc</td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px">USD/Pos</td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px">SL No.</td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px">Valve Type</td>
            </tr>
            <apex:repeat value="{!QuLiIt}" var="qli">
            <tr style="page-break:after:auto;page-break-inside:avoid;">
                <td width="5%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{!qli.Item_Number__c}"/></td>
                <td width="5%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{!qli.Quantity}"/></td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{!qli.LineNumber}"/></td>
                <td width="40%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{!qli.Part_Description__c}"/></td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{!qli.UnitPrice}"/></td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{0,Number,###,###,###.00}"><apex:param value="{!qli.UnitPrice * qli.Quantity}"/></apex:outputText></td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{!qli.Asset__r.SerialNumber}"/></td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px"><apex:outputText value="{!qli.Asset__r.Model__c}"/></td>
            </tr>
            </apex:repeat>
            <tr style="background-color:#C0C0C0;page-break:after:auto;page-break-inside:avoid;">
                <td width="5%"></td>
                <td width="5%"></td>
                <td width="10%"></td>
                <td width="40%" style="text-align:right;padding-top:10px;padding-bottom:10px"><b>TOTAL</b></td>
                <td width="10%" style="padding-top:10px;padding-bottom:10px">USD/pos.</td>
                <td width="10%"><apex:outputText value="{0,Number,###,###,###.00}"><apex:param value="{!qut.GrandTotal}"/></apex:outputText></td>
                <td width="10%"></td>
                <td width="10%"></td>
            </tr>
        </table>
       
       
        <br/><br/><br/>
        We look forward to your early acceptance.<br/><br/>
        Yours sincerely,<br/><br/>
        <b>CCI Valve Technology GmbH<br/><br/><br/><br/><br/>
        {!qut.Opportunity.Primary_Inside_Sales__r.name}</b>
       
               
    </apex:form>
</apex:page>

Hi,

I have a piece of code written in visual force page after saving the page tried to view the changes at the browser site using the preview button whenever I tried to click it it is showing the below exception.Please help me to resolve the probelm and to come out of it.




User-added image
Regards,
Seshagiri
Am trying to get to know about the InlineEditSupport from the Saleforce documents and used the code provided there with some modifications.

This is my Visualforce page:

<apex:page standardController="Contact" extensions="inlineController">
    <apex:form >
        <apex:pageBlock id="pb">
            <apex:pageBlockButtons >               
                <apex:commandButton id="saveButton" value="Save" reRender="pb" style="display:none;"/>
                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" style="display:none;"/>
                <apex:commandButton value="Refresh" reRender="pb" action="{!refresh}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:outputField value="{!contact.lastname}" rendered="{!boolRender}">
                    <apex:inlineEditSupport showOnEdit="saveButton, cancelButton"
                        event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
                </apex:outputField>
                <apex:outputField value="{!contact.accountId}"/>
                <apex:outputField value="{!contact.phone}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

This is my Controller i added to check a functionality:

public with sharing class inlineController {
    public boolean boolRender {get; set;}
   
    public inlineController(ApexPages.StandardController controller) {
        boolRender = true;
    }
    public void refresh(){
        if(boolRender == false)
            boolRender = true;
        else
            boolRender = false;
    }
}

I used style="display:none;" in both save and cancel buttons because i want them to be invisible at start. Once i double click on the Contact Lastname these two buttons will show up.

Now comes the tricky part in which am facing issues. I used rendered="{!boolRendered}" in the Contact Lastname Outputfield, so that it will be rendered based on the condition which i set in Controller.

In constructor i set it to true and everything works fine. If is set it to false, initially the field will not be shown, on click of refresh it will be shown, but if i double click on the Contact Lastname field the two buttons not showing up.

Cause:
I think the cause for this behaviour is that the field in which inlineEditSupport is binded is not rendred initially and then the binding between the buttons are lost.

Work Around: 
I can remove style="display:none;" from both buttons, but it will always be visible which is not like standard salesforce inlilne edit.

Can anyone explain me why this is happening and can provide me any work around?

Register now for Apex Code Talk - a live virtual Q&A on April 24 at 8:00am PDT/3:00pm GMT with Sandeep Bhanot & Quinton Wall for your tech questions.

 

CodeTalk helps you get answers to your Force.com technical questions "on the air" in an unscripted and entertaining format. Each live CodeTalk episode is a thirty-minute Q&A session dedicated to a specific Force.com topic. You can submit your questions using a chat window or Twitter (hashtag #codetalklive) and our team of technical experts will do their best to answer them. Along the way, each episode highlights and dissects interesting and thought-provoking questions.

In this episode, join Sandeep, Quinton, and special guest Taggart Matthiesen - Product Management Director, Platform - as they take your queries on all things Apex.

 

Register now: http://bit.ly/codetalk-db