• VictorFelisbino
  • NEWBIE
  • 30 Points
  • Member since 2013
  • Seagate Technology

  • Chatter
    Feed
  • 1
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 20
    Replies
For example i got a field called origin if it is coming from facebook i want to save FB and if it come from the web save the value WEB, how can i do that im pretty new ?

Thanks
Seagate is seeking a Developer II with experience in Java and understands new web technologies to provide technical leadership in developing service applications and analyzing business requirements as they pertain to intranet and external systems. This position will be located in our Oklahoma City, OK data center and will report to the Sr. Supervisor of Customer Service.

For more information:
https://seagate.taleo.net/careersection/jobdetail.ftl?job=149762&lang=en
This used to work just fine until the begining of November. 
We get the referer url to determine in what language display our support forms, but that suddenly stopped working. Now the referer url is returning the value for the current page and not the page that was reference from.

Is anyone experiencing this issue? Did Salesforce changed something on how the referer url works?
When implementing communities and using the standard out of the box chatteranswers:searchask it is not supported in IE11. User-added image

To make this work in IE 11, we have to manually go in IE 11 settings, Compatibility View settings and add the website to the list.

Hello,

We are currently in the process of implementing a approval process for KB articles. Everything is stored in a temporary SObject (CSO_CRM__c), so it can go through the approval process and have all needed modifications before becoming an article.

I have created a trigger that runs after update and if the temporary article has been approved by all approvers (Closed status), I want to create the KB article.

I still need to implement all of my datacategoryselections but, in this code snip im getting this following error:

 

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger CSO_CRM_After caused an unexpected exception, contact your administrator: CSO_CRM_After: execution of AfterUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Knowledge Article Version]: [Knowledge Article Version]: Trigger.CSO_CRM_After: line 51, column 1". 

 

How do I create the Knowledge Article Version?

 

or is there a better way to do all this?

 

trigger CSO_CRM_After on CSO_CRM__c (after update) {
List<CSO_CRM__c> crmTranslation = new List<CSO_CRM__c>();
List<FAQ__Kav> articleList = new List<FAQ__Kav>();
List<FAQ__DataCategorySelection> dataCategoryList = new List<FAQ__DataCategorySelection>();
for(CSO_CRM__c crm : trigger.new){
if(crm.Status__c == 'Closed'){
//Insert Article
FAQ__Kav article = new FAQ__Kav();
article.answer__c = crm.answer__c;
article.Chat_Answer__c = crm.Chat_URL__c;
article.keywords__c = crm.Keywords__c;
article.model_number_update__c = crm.model_update__c == true ? 'Yes' : 'No';
article.summary = crm.summary__c;
article.title = crm.title__c;
article.UrlName = crm.title__c;
articleList.add(article);

//Insert all Internal Documents
String tempIntDoc = crm.Internal_Classification__c;
tempIntDoc = tempIntDoc.removeStart('[');
tempIntDoc = tempIntDoc.removeEnd(']');
List<String> docs = tempIntDoc.split(',');
for(String doc : docs){
FAQ__DataCategorySelection dCat = new FAQ__DataCategorySelection();
dCat.ParentId = article.id;
dCat.DataCategoryGroupName = 'Internal_Documents';
dCat.DataCategoryName = doc;
dataCategoryList.add(dCat);
}
if(crm.type__c != 'Translation'){
String tempLanguages = crm.Languages__c;
tempLanguages = tempLanguages.removeStart('[');
tempLanguages = tempLanguages.removeEnd(']');
List<String> languages = tempLanguages.split(',');
for(String lang : languages){
CSO_CRM__c tran = crm.clone(false,false,false,false);
tran.Type__c = 'Translation';
tran.Language__c = lang;
tran.Status__c = 'New';
tran.Master_ID__c = crm.Id;
crmTranslation.add(tran);
}
}
}

}
insert crmTranslation;
insert articleList;
insert dataCategoryList;
}

 

This used to work just fine until the begining of November. 
We get the referer url to determine in what language display our support forms, but that suddenly stopped working. Now the referer url is returning the value for the current page and not the page that was reference from.

Is anyone experiencing this issue? Did Salesforce changed something on how the referer url works?
I have created a custom object within Salesforce called "Service Requests". Within the "Service Requests" object I have created a custom field called "Store Number". "Store Number" is a lookup relationship field that is related to another custom object called "Stores". When a service request is made we always include the store number so that we can tell which store needs service done. For instance, Service Request 0006 is for store number 2368. Now, if we use our mouse to hover over the store number, 2368, then we will see a hover detail window telling us that the store is located in East Stroudsburg, PA. My question is, can I somehow relate the location of the store to the service request that is being made for that store? I want to be able to see the city and state that the service request is in. So, I should be able to tell that Service Request 0006 is a service request for East Stroudsburg, PA based off the fact that the service request is for store number 2368 (which is located in East Stroudsburg, PA). Am I being clear?

Let me break it down further:
Basically my client wants to be able to go into the "Service Requests" tab and, under the list views, he wants to see not only the "Request Number" (0006) and "Store Number" (2368) but also the city and state of the store (which would be related to the Store Number). I have already created a "City" and "State" field within the "Service Requests" object that is a picklist field allowing you to choose some predefined cities and states. But my client doesn't want to have manually choose a city and state each time he makes a service request. He is already having to manually look up the store number for each request, so he shouldn't have to pick from cities and states either. He wants it to where, once the store number is chosen, the city and state of that store will automatically populate within the "City" and "State" fields. Is this possible? Can I somehow create a field to field relationship to make this work? Will this require writing some Apex? I hope I am making sense. Thank you very much for taking the time to help me!
Hi there

Got a bug today and was debugging it to death, but still at no avail.  Hope someone can help.  This is regarding <apex:actionStatus>.

I made my example really short.  So here is the controller:
public class ActionStatusController
{
    public String testVariable {get; set;}
    public pagereference donothing()
    {
        return null;
    }
}

And here is the VF page that uses the controller
<apex:page controller="ActionStatusController">
<apex:pageBlock id="pb">
<apex:form >
    <apex:selectList value="{!testVariable }" size="1">
        <apex:selectOption itemValue="" itemLabel="" />
        <apex:selectOption itemValue="a" itemLabel="a" />
        <apex:selectOption itemValue="b" itemLabel="b" />
        <apex:selectOption itemValue="c" itemLabel="c" />
        <apex:actionSupport event="onchange" reRender="testVariableDiv"/>
    </apex:selectList>
    <apex:commandButton action="{!doNothing}" value="Click" status="showStatus" rerender="pb"/>
</apex:form>
<apex:outputPanel id="testVariableDiv">
    <apex:outputText value="selected value is {!testVariable }" />
</apex:outputPanel><br/>
<apex:actionStatus id="showStatus">
<apex:facet name="start">
the value is "{!testVariable }"
</apex:facet>
</apex:actionStatus>
</apex:pageBlock>
</apex:page>

When the page loads, you see the picklist and then the statement that says "selected value is".

Once you pick, say, "c", then the statement becomes "selected value is c", which is expected.

However, when you then press the button, which in the facet/start is supposed to display the same value, it says "the value is ".

Now, if I press it again, then it displays "the value is c".  

It seems like the actionStatus is lagging by one step.  What must I change in order for the display to say "the value is c" as soon as I press the "Click" button?


Thanks
King


 
Dear All,

I have a custom field 'Action'. It is a Long Text Area type of field. When i try to bring this field on to the visualforce page then it does not retain formatting like line spacing, line breaks etc.. Below mentioned is the code, please let me know how formatting can be retained on visualforce page as well.

 '</br>*****<h1>POS</h1>*****' +
    '</br></br>' +
    '<tr align="left"><b>POS Number: </b></tr>' + POS.Name + '</br></br>' +
    '<tr align="left"><b>Created By: </b></tr>' + POS.CreatedBy.name + '</br></br>'+
    '<tr align="left"><b>Is this the most recent POS? </b></tr>' + POS.Most_Recent_Record__c + '</br></br>'+
     '<tr align="left"><b>Status: </b></tr>' + POS.Status__c + '</br></br>'+
    '<tr align="left"><b>Action: </b></tr>' + '<div style="word-wrap:break-word; width:450px;"/>' + POS.Action__c + '</br>';
    containerList.add(cc);

Date Entered in Salesforce.com
User-added image
Formatting on Visualforce page is all broken

User-added image


Thanks.
1)We can able to build visual force charting but we need the visual force charting for responsive like different screen size for different devices with same code.
Hi ,

I have the following controller and Vf page that adds one attachment

controller:

public with sharing class OpportunityAttachmentController{
  
    public Opportunity_Attachment__c objOppAtt {get; set;}
 
    public OpportunityAttachmentController(ApexPages.StandardController controller) {
        attach = new Attachment();
        objOppAtt = (Opportunity_Attachment__c)controller.getRecord();
     
    }

    public Attachment attach {get;set;}
    public Attachment attach1 {get;set;}
 
    //When user clicks upload button on Visualforce Page, perform upload/insert

    public ApexPages.Pagereference save(){
        if(attach.body==null){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please select a file to upload'));
            return null;
        }
        insert objOppAtt;
     
      
        attach.ParentId = objOppAtt.id;
        insert attach;
      
       
        objOppAtt.URL__c = URL.getSalesforceBaseUrl().toExternalForm()+'/servlet/servlet.FileDownload?file='+attach.id;
        objOppAtt.name = attach.Name;
        update objOppAtt;
      
        return new PageReference('/'+objOppAtt.Opportunity__c); 
    }
  
  
  
  
  
}


VF page:
<apex:page standardController="Opportunity_Attachment__c" extensions="OpportunityAttachmentController">
    <apex:sectionHeader title="New Opportunity Attachment" subtitle="Opportunity Attachment Edit"/>
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlockSection columns="1">
              
                <apex:outputField value="{!Opportunity_Attachment__c.Opportunity__c}"/>
                <apex:pageBlockSectionItem >Upload Contract<apex:inputFile required="true" value="{!attach.body}" filename="{!attach.name}" /></apex:pageBlockSectionItem>
              
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton value="Upload" action="{!save}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>


I want to add one more attachment  so i modify the vf as follows:
<apex:page standardController="Opportunity_Attachment__c" extensions="OpportunityAttachmentController">
    <apex:sectionHeader title="New Opportunity Attachment" subtitle="Opportunity Attachment Edit"/>
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlockSection columns="1">
             
                <apex:outputField value="{!Opportunity_Attachment__c.Opportunity__c}"/>
                <apex:pageBlockSectionItem >Upload Contract<apex:inputFile required="true" value="{!attach.body}" filename="{!attach.name}" />
            <apex:pageBlockSectionItem >Upload Attributes<apex:inputFile required="true" value="{!attach.body}" filename="{!attach.name}" />


</apex:pageBlockSectionItem>
             
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton value="Upload" action="{!save}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>


do i have to write a seperate controller,or i can modify the same?If modify the same ,how?

Please help.
Hi,

I just have a brief overview of Apex, but I'm wondering if someone can help me here.

I have two custom objects:
Parent Object: Requests
Related Child Object: Requestor

On the parent object, I have a picklist field: Request Status (None, In Progress, Complete)
On the child object, I have a checkbox: Request Complete

I need a workflow to trigger when Request Complete = True. However, I don't want to manually edit the checkbox. I need an Apex trigger that will edit the child object when the parent object is edited, and I need that to trigger my workflow on the child object. I need an Apex Trigger that will do the following:

When Request Status = Complete
Then Resource Complete = True

Is this possible? If so, could someone help show what such a code would look like?
I have this piece of code that does roll up summary on relatd object for Opportunity called deal__c, however i get this error and i'm not sure why.
here is my code   Trigger.Deals: line 59, column 1, is there any way to overcome it by writing beter querry? or do ihave to create batch class? or put it @ future?

set<id> DealIds = new set<id>(); //roll up summary
    if((trigger.isInsert || trigger.isUpdate) && Trigger.isAfter){
        for(Opportunity o : trigger.new){
            DealIds.add(o.Deal__c);
        }
    }

    if(trigger.isDelete){
        for(Opportunity o : trigger.old){
            DealIds.add(o.Deal__c);
        }
    }

            map<id, Decimal> DealAmountMap = new map<id, Decimal>();
            List<AggregateResult> oList =[select Deal__c,sum(Amount) from Opportunity where Deal__c IN :DealIds group by Deal__c];
            for(AggregateResult q : oList){
                DealAmountMap.put((Id)q.get('Deal__c'),(Double)q.get('expr0'));
            }
   
            map<id, Decimal> DealQuantityMap = new map<id, Decimal>();
            List<AggregateResult> oList1 =[select Deal__c,sum(TotalOpportunityQuantity) from Opportunity where Deal__c IN :DealIds group by Deal__c];
            for(AggregateResult q1 : oList1){
                DealQuantityMap.put((Id)q1.get('Deal__c'),(Double)q1.get('expr0'));
            }

                    list<Deal__c> dealsToUpdate = new list<Deal__c>();
                    List<Deal__c> Deals=[Select Id, TotalAmount__c from Deal__c where Id IN :DealIds];
                    for(Deal__c d : Deals){
                        Double PaymentSum = DealAmountMap.get(d.Id);
                        Double Quantity = DealQuantityMap.get(d.id);
                        d.TotalAmount__c = PaymentSum;
                        d.TotalOpportunityQuantity__c= Quantity;
                        dealsToUpdate.add(d);
                    }
    update dealsToUpdate;
For example i got a field called origin if it is coming from facebook i want to save FB and if it come from the web save the value WEB, how can i do that im pretty new ?

Thanks
HI,

      I am connecting to Quote custom object by using standard controller may i know how can i get inline editing 


   <apex:pageBlock title="Quote Information" mode="edit">
       <apex:pageBlockButtons >
              <apex:commandButton value="Save" action="{!save}"/>
              <apex:commandButton value="Cancel" action="{!cancel}"/>
       </apex:pageBlockButtons>
  <apex:pageBlockSection title="Information" columns="2">
   <apex:inputField value="{!Quote__c.Name}"/>
   <apex:inputField value="{!Quote__c.Opportunity__c}"/>
   <apex:inputField value="{!Quote__c.Contact__c}"/>
   <apex:inputField value="{!Quote__c.Email__c}"/>
   <apex:inputField value="{!Quote__c.Expiration_Date__c}"/>
  </apex:pageBlockSection>
Hi All,

My requirment is suppose i have contact,account,lead,oppertunity  object in vf i have one text box and one scarch button if am giveing any text and clicking on search button it shoud search that text on contact,account,lead,oppertunity objects and display data. i know how to do it on ome object like Lead how to implement on multiple objects using apex and vf page .

below is my code for single object search functionality :


vf page
------------------------------------------------------------------------------------
<apex:page controller="Leadpage2">
   <apex:form >
   <apex:pageMessage severity="error" strength="2"  summary="Error:" detail="{!errorMessage}"  rendered="{!errorMessage != null}"/>
   <table>
   <tr>
   <td>Lead: </td>
   <td><apex:inputtext value="{!name}" required="true"/></td>
   <td></td>
   <td><apex:commandButton action="{!search}" value="Go"/>
   </td>
   </tr>
   </table>
   <apex:pageBlock rendered="{!name != null}" >
   <apex:pageBlockSection title="Lead Details" rendered="{!errorMessage == null}">
   <apex:pageBlockTable value="{!records}" var="rec">
   <apex:column value="{!rec.Name}" headerValue="Name"/>
   <apex:column value="{!rec.Email}" headerValue="Email"/>
   <apex:column value="{!rec.Company}" headerValue="Company"/>
   </apex:pageBlockTable>
   </apex:pageBlockSection>
   </apex:pageBlock>
   </apex:form>
</apex:page>
----------------------------------------------------------------------------------------------------------
apex page
---------------------------------------------------------------------------------------
public class Leadpage2 {
public String name{ get ; set;}
List<Lead> records;
List<Lead> templi;
public String msg {get; set; }
public transient String errorMessage { get; set; }
String s { get; set; } 
    public List<Lead> getrecords(){
      return records;
      }
      public Leadpage2(){
       records = new List<Lead>();
    }
    public PageReference search() {
      s = '%' + name + '%';
       if(name.length()==0){
          errorMessage = 'Please enter a Lead Name';
         }
      records  =[select Name,Email,Company from Lead  where name like:s OR Email like:s OR Company like:s ];
       if(records !=null && records.size() ==0){
           errorMessage = 'LEAD NOT fOUND !';
         }
     return null;
   }
}

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

any ideas appreciated........

Thanks,

Hareesh Goud N
  • April 08, 2014
  • Like
  • 0
Hi, How to write below validation rule:
If TYPE is 'PROSPECT' and SLA Serial Number is '1234' then SLA is required.
Hello,

I am currently trying to change the "Send" button that is displayed in a Live Agent Chat with a customer.
I found information in the documentation (http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_liveAgent_clientChatSendButton.htm), but I do not know where I can access the VF code to customize the chat window. Can anyone help me out? 


  • April 07, 2014
  • Like
  • 0
When implementing communities and using the standard out of the box chatteranswers:searchask it is not supported in IE11. User-added image

To make this work in IE 11, we have to manually go in IE 11 settings, Compatibility View settings and add the website to the list.

I am having trouble getting my customized live agent window to show up properly.  I have created a visual force page based on the suggestions in the live agent developer guide.  I added it to a site and made it visible.  I am able to load the page by going directly to it just fine.  However, when I go and configure my chat button to use the custom page it just uses the stock look and feel and does not use my custom page.

 

The really strange thing is that I am able to get the custom page to show up if I "break" things a bit.  When adding the chat button to my page if I don't call the liveagent.init method on page but wait to call it until right before calling liveagent.startChat the first time I call startChat the popup window will fail to load because it attempts to access just a relative URL and not use the base liveagent url.  However, if I call startChat a second time it will pop a live chat window using my customized page.  Again, if I wait until init is complete startChat works perfectly and launches the chat as expected but not using a customized page.  The custom page is currently hosted in a sandbox, not sure if that makes a difference.

 

Nothing special with the javascript to launch the page:

 

liveagent.init('https://d.<instance_id>.salesforceliveagent.com/chat', '<deployment_id>', '<organization_id>');

window.liveagent.startChat('<chat_button_id>');

 

Here is my custom page:

 

<apex:page showHeader="false">
<!-- Add custom CSS here -->
<style type="text/css">
    body { background-color: #333333; padding: 7px;}
    #liveAgentChatLog {background-color: white; width: 100%}
    #liveAgentChatInput {width: 80%; margin-top: 10px;}
    .liveAgentState #waitingMessage { display: none; }
    .liveAgentSendButton {
        color: #FFFFFF;
        box-shadow: none;
        text-shadow: none;
        border: none;
        border-radius: 8px;
        -webkit-border-radius: 8px;
        -moz-border-radius: 8px;
        -ms-border-radius: 8px;
        background: #41b7e3;
        display: inline-block;
        padding: 5px 20px 3px 20px;
        text-align: center;
        text-transform: uppercase;
    }
</style>
<!-- The root element for the chat window. This element gets a CSS class dynamically applied
to indicate the state of the chat window. Available states are:
"liveAgentStateWaiting" - indicates that the chat has not yet been answered.
"liveAgentState" - indicates that the chat is engaged
"liveAgentStateStatusMessage" - indicates that a status message is being displayed to the
user.
"liveAgentStateEnded" - indicates that the chat has ended. -->
<liveAgent:clientchat >
  <liveAgent:clientChatMessages />
  <div id="waitingMessage" class="modal">
    <!-- You can customize this waiting message HTML -->
    <em>You are now being connected to an agent.</em>
  </div>
  <liveAgent:clientChatLog />
  <div id="chatInput" class="pod">
    <liveagent:clientChatInput />
    <liveAgent:clientChatSendButton label="Send"/>
  </div>
</liveAgent:clientchat>
<!-- You can customize the window title with the js below -->
<script type="text/javascript">
window.title = "My Custom Live Chat Window";
</script>
</apex:page>