• yogesh_sharma
  • NEWBIE
  • 147 Points
  • Member since 2014

  • Chatter
    Feed
  • 5
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 3
    Questions
  • 36
    Replies
Hi All,
I need to show display the pageblocksection based on multiselect picklist chosen.
Say for the example, I have the custom multipicklist field in contact object, where the values are one, two, three.
Whenever i choose "One" Option corresponding page block must be showned.
 
<apex:page standardController="Contact" showHeader="false">
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:inputField value="{!contact.Choose_Number__c}">
                <apex:actionSupport event="onchange" reRender="prd" />
            </apex:inputField>
        </apex:pageBlockSection>
        <apex:pageBlockSection title="Product Test" id="prd" rendered="{!contact.Choose_Number__c == 'One'}">
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
</apex:page>

Whenever i choose or Move "One" option from Available to Chosen, Pageblocksection need to be display. 
 
How to get the opportunity product fields in visualforce email template?

I have created VF email template relatedTo Contract__C object

Relationship:
Opportunity object---Lookup--->Contract__C object

Now hot to get the opportunity products fields on VF email template?..
 
Hello All,

I  have one of the formula field called " Case status" .  "Case status is a formula field " will update green,red ,yellow icon  . Now  I have requirement like , based on "Case status"(Formula Field) and case "Type"(Picklist) field , i need to create another formula field . How can i achecive this ?

For example : If  Case status = "Green" Icon and Type ="Other" then case violation ="Low"
                         Case status ="Yellow" Icon and Type =""structural" then case Violation ="Medium"
                         Case status ="Red" Icon and  Type =" Electrical" then case violation ="High"

How can i achecive this ?

Regards,
Raja.
  • December 19, 2016
  • Like
  • 0
What I wanted to do is I storing a PDF into attachments object through apex

Here is the apex code -
Blob body = Blob.valueOf('Some Text');
Attachment attach = new Attachment();
attach.Body = body;
attach.Name = 'Sample.pdf'; 
attach.IsPrivate = false;
attach.ParentId = '00641000004n7fEAAQ';
insert attach;

Now when I navigate to the object on which I have linked this attachment, click on the file it doesn't get loaded. Following error is displayed

User-added image

There is something wrong while inserting the record.

Can somebody help me.

Note - I need pdf file to be attached to the object

 
I need help in creating a trigger which can automatically generate an invoice when an opportunity is created with the amount field filled.
  • August 06, 2015
  • Like
  • 0
Problem:

I was facing a Issue releted to notify "Case Owner" when case comment is created, even i checked checkbox in our enterprise setting Customize -> Cases -> Support Settings "Notify Case Owner of New Case Comments". Then also my case owner not got notifications.
Below are my code in which i was facing issue:
CaseComment objCaseComment = new CaseComment();
objCaseComment.CommentBody = strComment;
objCaseComment.ParentId = objectCase1.Id;
insert objCaseComment ;
In this code I was simply inserted case comment usnig Apex, but I did some Rnd and got a hint that when we create case comment using Apex(Page/Site) in this scenarion there is a checkbox in EmailHeader "triggerUserEmail" not set to true.

Solutions:

When we create case comment using Apex(Site/Page) we need to set "triggerUserEmail" true. in our existing code.
Even though auto-sent emails can be triggered by actions in the Salesforce user interface, the DMLOptions settings for emailHeader take effect only for DML operations carried out in Apex code.
I added some piece of code in my exisiting code below:
Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerUserEmail = true;
CaseComment objCaseComment = new CaseComment();
objCaseComment.CommentBody = strComment;
objCaseComment.ParentId = objectCase1.Id;
database.insert(objCaseComment, dlo);
Now I get notification when my case comment is created using Apex(Page/Site).
If "Case Owner" and "Case Comment" creator are different then only Case Owner will  get notification else Case Owner will not get notification.
Thanks!
 
Hi,
I want to customize Accept button on live agent chat screen
I want to open window confirmation pop-up on click of Accept button
plz help
ThanksHow can i override Standard Accept button in advance !!! 
How to Open SubChild Window through Child Window when My Child Window is Open using Java Script?
I'm trying to open child window and then turough child window i m trying to open subchild window,but when i m open subchild window my child window get closed and subchild window open
PlZ Help??
Problem:

I was facing a Issue releted to notify "Case Owner" when case comment is created, even i checked checkbox in our enterprise setting Customize -> Cases -> Support Settings "Notify Case Owner of New Case Comments". Then also my case owner not got notifications.
Below are my code in which i was facing issue:
CaseComment objCaseComment = new CaseComment();
objCaseComment.CommentBody = strComment;
objCaseComment.ParentId = objectCase1.Id;
insert objCaseComment ;
In this code I was simply inserted case comment usnig Apex, but I did some Rnd and got a hint that when we create case comment using Apex(Page/Site) in this scenarion there is a checkbox in EmailHeader "triggerUserEmail" not set to true.

Solutions:

When we create case comment using Apex(Site/Page) we need to set "triggerUserEmail" true. in our existing code.
Even though auto-sent emails can be triggered by actions in the Salesforce user interface, the DMLOptions settings for emailHeader take effect only for DML operations carried out in Apex code.
I added some piece of code in my exisiting code below:
Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerUserEmail = true;
CaseComment objCaseComment = new CaseComment();
objCaseComment.CommentBody = strComment;
objCaseComment.ParentId = objectCase1.Id;
database.insert(objCaseComment, dlo);
Now I get notification when my case comment is created using Apex(Page/Site).
If "Case Owner" and "Case Comment" creator are different then only Case Owner will  get notification else Case Owner will not get notification.
Thanks!
 
Hi all! 
I am creating a custom field that will be auto filled based on a formula from another fields pick list value.  I seem to be having issues with my formula and would love to get some help if possible. 

New field name is Est. Downloads Per Episode  wihich will be give he number or a blank value depening ont he pick list value. 

If Flight_Type_Basis__c  is "Episode" or "Episode Maual"  the new field will fill in the number from the field Avg_Downloads_per_Episode__c
but if the pick list value from Flight_Type_Basis__c is "Impression" or "Impression Manual"  the result for the field will be Blank. 

Any help would be greatly appreciated... I have been working on this most of the day. 
Is there a list of all standard BigObjects somewhere? Or is there a way to tell through the REST API whether an object is a BigObject?
Hi All,

    Is it possible to build a SOQL query to retrieve/show the count of closed and open opportunities under each accounts? I would to execute this code in the query editor in developer console.

Help and Thanks. 
Scenario: Users need to be able to insert n-number of child records to the selected Parent record where n-number is determined by the integer difference of a Ceiling on two Date fields in the record.

Challenge: How can I retrieve an integer value by subtracting the record's 2 date values in Javascript? I am not even sure the value being returned is a date value (is it a string value)?

Specific code string: 
var weekCount = Math.ceil( (crtvtracker.Creative_End_Date__c - crtvtracker.Creative_Start_Date__c) );

Code block:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")}

//Retrieve and store the selected accounts
var CrtvTrackerIds = {!GETRECORDIDS( $ObjectType.Creative_ID__c )};

//Do a deeper query selecting required Parent fields
var CrtvTrackers = sforce.connection.retrieve("Id,Name,Creative_Start_Date__c,Creative_End_Date__c","Creative_ID__c",CrtvTrackerIds);

//Creating an array to store insertedCrtvScheds
var insertedCrtvScheds = [];

//... skipping some code checking here

CrtvTrackers.forEach(function(crtvtracker){        

        alert(crtvtracker.Creative_End_Date__c);
        
        var CreativeEndDay = crtvtracker.Creative_End_Date__c.day();
        
        alert(crtvtracker.Creative_End_Date__c.day());

        var weekCount = Math.ceil( (crtvtracker.Creative_End_Date__c - crtvtracker.Creative_Start_Date__c) );
        alert(weekCount);

        var schedToInsert = new sforce.SObject("Creative_Schedule__c");
        alert( crtvtracker.Creative_Start_Date__c.daysBetween(crtvtracker.Creative_End_Date__c) );

        for (weeknum = 0; weeknum < 0 ; weeknum++ ) {
        schedToInsert.Creative_ID__c = crtvtracker.Id;             
        schedToInsert.Traffic_Status_updated__c = "On";
        schedToInsert.Creative_Start_Date_updater__c = crtvtracker.Creative_Start_Date__c + (weeknum * 7);
        
        insertedCrtvScheds.push(schedToInsert);
        }
        //alert(crtvtracker.Creative_Start_Date__c);

        //Pass in the 'Creative Start Date' of the Creative ID    
        //schedToInsert.Creative_Start_Date_updater__c = crtvtracker.Creative_Start_Date__c;
        
        
    });

How can I converte my Creative End Date and Creative Start Date fields to be date fields to achieve the mathematical operation I need?

 
if have check box called isEpicstory and filed called epic story
if user isspeic story (check box ) is true then epic story field should be empty ( user should not entery value need to restrict )


Regards
Shaker
I would like to pre-populate the account name for this record type with something so the user doesn’t have to be bothered with entering something there because it’s a required field. 
my requirement is this:
first i need to create two record types for a standard object lets suppose for account
then using custom setting i linked the record type and visual force page 
then using the apex code i have to display the correct visual force page according to the record type.
can anyone suggest the code for this
Hi All,
I need to show display the pageblocksection based on multiselect picklist chosen.
Say for the example, I have the custom multipicklist field in contact object, where the values are one, two, three.
Whenever i choose "One" Option corresponding page block must be showned.
 
<apex:page standardController="Contact" showHeader="false">
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:inputField value="{!contact.Choose_Number__c}">
                <apex:actionSupport event="onchange" reRender="prd" />
            </apex:inputField>
        </apex:pageBlockSection>
        <apex:pageBlockSection title="Product Test" id="prd" rendered="{!contact.Choose_Number__c == 'One'}">
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
</apex:page>

Whenever i choose or Move "One" option from Available to Chosen, Pageblocksection need to be display. 
 
An account has many opportunity,there is a PickList field on opportunnity  called status(value-approved,rejected,hold).

 Scenario -
  whenever one opportunity status get updated to APPROVED other should be rejected.
  
   Here My Code-
    Apex Class:-
      public class AccountOpty {
  
  List<Account> acctToUpdate = new List<Account>();
  List<Opportunity> opps = new List<Opportunity>(); 
  Set<Id> associatedAccId = new Set<Id>() ;
    public static void findOpty(list<Opportunity> oppList){
        for(opportunity opp:oppList){
        associatedAccId.add(opp.AccountId) ;
        }
       //opps=[select id,AccountId From Opportunity ];
    }//End OF findOpty ethod

}//End Of Class

My Trigger:-
trigger AccountOptyAfterTrigger on Opportunity (after Update) {
    AccountOpty.findOpty(trigger.new);

         }
after executing my apex class am getting the below Error

Error: Compile Error: Variable does not exist: AccountId at line 8 column 29
Hi,

I want to customize the Emailing UI as shown in he snapshot below:

Email Customization

I am trying to add a Print button to the above UI to Print the template. How can i achieve this? Is there any other way to do this?
Please suggest.
Hi,
I have to change the datatype of "Releted To" field of "Task" object.
i.e. What id of task. This is lookup field. and i want only 3 objects i.e. Account, Contact, Opportunity.
Hi all,
I want to create a custom detail page for my custom object. Can anyone help me in adding related list to my detail custom vfpage.

Thanks in advance,
regrads,
mac.
Hi All,

I am getting the below error in my community. I don't know how to handle this exception. 

The error message is: Duplicate Username.<br>The username already exists in this or another Salesforce organization. Usernames must be unique across all Salesforce organizations. To resolve, use a different username (it doesn't need to match the user's email address).

Let me know how to handle this exception

Thanks,
Vijay
 
How to get the opportunity product fields in visualforce email template?

I have created VF email template relatedTo Contract__C object

Relationship:
Opportunity object---Lookup--->Contract__C object

Now hot to get the opportunity products fields on VF email template?..
 
Hello All,

I  have one of the formula field called " Case status" .  "Case status is a formula field " will update green,red ,yellow icon  . Now  I have requirement like , based on "Case status"(Formula Field) and case "Type"(Picklist) field , i need to create another formula field . How can i achecive this ?

For example : If  Case status = "Green" Icon and Type ="Other" then case violation ="Low"
                         Case status ="Yellow" Icon and Type =""structural" then case Violation ="Medium"
                         Case status ="Red" Icon and  Type =" Electrical" then case violation ="High"

How can i achecive this ?

Regards,
Raja.
  • December 19, 2016
  • Like
  • 0
Hi Guys,
  1. Until the Spring 15 release, Maps and Sets are Unordered Collections. So the returned order will be random.
  2. But beginning from Summer 15 release onwards, Maps and Set order is predictable. The order will be same that what you put from the beginning to end.
Example:
Map<String, String> orderedMap = new Map<String, String>();
orderedMap.put('Good', 'This is so good');
orderedMap.put('Bad', 'This is so bad');
System.debug(orderedMap);

If you run the above code snippet in Developer console you will get the returned order as below,

Until Spring 15 Release:

{Bad=This is so bad, Good=This is so good}

From Summer 15 Release:

{Good=This is so good, Bad=This is so bad}

This changes is not the API level, this is Schema level change. If anyone relying on the Map or Set order in your codes, change it as soon. 

Thanks.