• BM 5
  • NEWBIE
  • 65 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 16
    Replies
Hi,

I was wondering if anyone could offer some advice whether the below trigger is sufficent or whether additonal checks or improvements are required.

trigger UpdatePurchaseOrderNumber on Opportunity (before update) {
    for(Opportunity opp:trigger.new){
        opp.Purchase_Order_No__c = opp.Sales_Order_Number__C;
    }
}

Basically, I need to simply copy the Sales_Order_Number field to the Purchase Order No field before any validations are performed on the Opportunity when the Save is pressed. The purchase order has a validation rule set on it that it cannot be null when the Opportunity is saved, so I cannot use a workflow.
Thanks
I am loosing it. I have created a second cases queue for our customer service people. It is called Customer Service. We also have an Engineering Queue I have been all over the system tryin to figure out why they are not auto assigning correctly. Record types of Customer SErvice should Auto-Assign to Customer Service, Engineering to Engineering. This is not what is happening, everything is going to engineering and I can't see to stop it. Email to case is set to go to Customer Service, Workflow rules are in place to auto assign. 

I am thinking it is in the record type, because they are all being created as Engineering, how do I stop this, Ones from email to case need to be created as Customer Service. HELP ME PLEASE
Hi,

Could any one please let me know what is the difference between the Salesforce Standard and Lightening on functionality, Edition, License, etc?

Thanks,
Satish.
Hello,
I am trying to create a custom button for the Lead Page Layout to mark a lead as "Unqualified". My code is below; I get no syntax errors but I get the following error message when I click it on a Lead record:

" A problem with the OnClick JavaScript for this button or link was encountered:
Unexpected token catch"


My Code:

{!REQUIRESCRIPT("/soap/ajax/23.0/connection.js")} 

{
var url = parent.location.href; 
var updateRecords = []; 
var update_Lead = new sforce.SObject("Lead"); 
update_Lead.Id ="{!Lead.Id}"; 
update_Lead.Status="Unqualified";
updateRecords.push(update_Lead); 

result = sforce.connection.update(updateRecords); 
parent.location.href = url; 
} catch (e) {
alert (e);
}
Can anybody spot a problem in following link?
<apex:commandLink action="{!showTimeEntries}" reRender="panel11" value="Show Time Entries" />

When I click on this link, it shows javascript error : actionUrl.indexOf is not a function or something like that.

If I remove rerender from link, it works fine.

I have used command link and rerender, but never faced this problem.

Just as an additional info, this link is inside a VF component.
Hey,

I am trying to find a way to create a SingleEmailMessage using a template, send the email out but also take the filled in body ( the template body but with all the merge fields filled in) convert that to a blob and use that to make an attachment on the related Contract object.

Any Advice?

 
Hi guys,

I am trying to create a validation rule that makes multiple fields mandatory based on various picklist values selected in a picklist field. The fields that I would like to make mandatory include multiple field types. I keep getting error messages using the below formula.

AND(
OR(
ISPICKVAL(Picklist_c , "Value 1"),
ISPICKVAL(Picklist_c , "Value 2"),

ISBLANK (Custom_Field_c 1)
ISBLANK (Date_Field_c 1)
ISBLANK (TEXT (Custom_Picklist_c 1)
ISBLANK (Custom_Field_c 2)
​ISBLANK (Date_Field_c 2)
ISBLANK (TEXT (Custom_Picklist_c 2)

 
Hi All,

I am trying to assign dynamically rowcause reason to my custom objects but erroring out like below:

//Smaple Map Format
recordIdsMap.put(objetapiname, Record);




 for (String obj: recordIdsMap.keySet()) { //This will fetch names of objects defined in custom setting
    //if(i<10){
            if (obj.contains('__c')) {
            
                String objName = obj.split('__')[0];
                system.debug('---' + obj);
                access = 'AccessLevel';
                pId = 'ParentId';
                ShareObject = objName + '__Share';
                ShareObject2 = objName + '__Share';
                system.debug('PJJJJ' + ShareObject);
           }else {
                ShareObject = obj + 'Share';
                access = obj + 'AccessLevel';
                pId = obj + 'Id';
                system.debug('PJJJJ2' + ShareObject);
    }
    
    
  
   
            Schema.SObjectType sobjType = gd.get(ShareObject2);
            
         //Here are i am trying to get my Rowcausereason in string 
           //string RowcauseReason = Schema.sobjType.rowCause.ApexSharing__c;

            string RowcauseReason = Schema.ShareObject.rowCause.ApexSharing__c;

But its showing compile time error as below : 

Variable does not exist: Schema.sobjType.rowCause.ApexSharing__c at line 264 column 37    
Hi,

I was wondering if anyone could offer some advice whether the below trigger is sufficent or whether additonal checks or improvements are required.

trigger UpdatePurchaseOrderNumber on Opportunity (before update) {
    for(Opportunity opp:trigger.new){
        opp.Purchase_Order_No__c = opp.Sales_Order_Number__C;
    }
}

Basically, I need to simply copy the Sales_Order_Number field to the Purchase Order No field before any validations are performed on the Opportunity when the Save is pressed. The purchase order has a validation rule set on it that it cannot be null when the Opportunity is saved, so I cannot use a workflow.
Thanks
 Hi,

I am using custom settings (Cloneaccounts__c ) to inlcude field API name  so they shoud not be cloned. there are few fields where api name is more than 40 characters and i am not able to save them. I created a field "Fieldname" on custom settings (Cloneaccounts__c ) so i can save fields api name in it. But how do i modify this controller to read the value of CloneAccounts__c field "Fieldname"
public with sharing class CloneaccController {

    public account objaccount {get;set;}        
    public string accountID;                        
   
    private account objNewaccount;
    private string queryString = '';
    public string strPrevCurrency {get;set;}
    Map<String, Schema.SObjectField> mapaccountFields;
    set<String> setexfields = new set<String>();

    public CloneaccController(ApexPages.StandardController controller) 
    {
                      
        accountID = ApexPages.currentPage().getParameters().get('id');
        
        
        if(accountID != null)
        { 
                mapaccountFields = Schema.SObjectType.account.fields.getMap() ;
                 List<Cloneaccounts__c > lstexfields = Cloneaccounts__c.getall().values();
                 
            for( Cloneaccounts__c exfield: lstexfields){
                setexfields.add(exfield.Name.toLoweraccount());
            }
          
            for(String s: mapaccountFields.keyset()){
                if(!setexfields.contains(s)){
                    if(queryString == ''){
                        queryString += s;
                    }else{
                        queryString += ',' + s;
                    }
                }
            }
                
                
       objnewaccount = Database.Query('Select ' + queryString + ' From account where id= \'' + String.escapeSingleQuotes(accountID) + '\'');   
                  
       objaccount = objNewaccount.clone(false,true,false,false);
             
        } 
 
         }
        
         public PageReference save()
    {
         insert objaccount;
        return new PageReference('/'+objaccount.id);
        
    }  
           
    }

Please help
I am loosing it. I have created a second cases queue for our customer service people. It is called Customer Service. We also have an Engineering Queue I have been all over the system tryin to figure out why they are not auto assigning correctly. Record types of Customer SErvice should Auto-Assign to Customer Service, Engineering to Engineering. This is not what is happening, everything is going to engineering and I can't see to stop it. Email to case is set to go to Customer Service, Workflow rules are in place to auto assign. 

I am thinking it is in the record type, because they are all being created as Engineering, how do I stop this, Ones from email to case need to be created as Customer Service. HELP ME PLEASE
Hi,
i am creating a visualforce page and on this page i need to concatenate fields and also make them required.
So far i was able to do both things, but i havent been able to acomplish both at the same time. i am using myfunction concatenate and validateform. how can i asociate both on the onsubmit button?

this is the code i have for both functions.



<form action="https://cs19.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8" method="POST" onsubmit="myFunction()" >

 <script>
function validateForm()
{

var a=document.forms["webtocase"]["name"].value;
if (a==null || a=="")
{
alert("Nombre de usuario no puede dejarse en blanco"); return false; }

</script>


<script>
function myFunction()
{
var str5 = "New Hire"; var str3 = "Nombre: " + document.getElementById("name").value + '\r\n';
var str1 = document.getElementById("email").value + '\r\n';
var str2 = document.getElementById("phone").value + '\r\n';
var str4 = document.getElementById("subject").value;
var res = str5.concat(str3, str1, str2, str4);
document.getElementById("description").innerHTML=res;
}
</script>


Description:<textarea id="description" name="description" rows="15" type="text" wrap="soft" ></textarea><br/>
<input type="hidden" id="external" name="external" value="1" /><br/>

<input type="submit" name="submit" onsubmit="myFunction()"/>

</form>




 
How many of you have a picklist as a merge field in an HTML email template? I have a very basic html email template where I'm using our company letterhead, and here's the line where I'm using a picklist.  The value on the record is not showing on the email templates that are going out via approval process.  After a few days, Salesforce is trying to tell me picklist fields aren't supported, but it worked one time where I used the "Send Test and Verify Merge Fields" button within the email template.  I'm meeting with support today, but wanted to check with the community to see if anyone else is using picklist fields in email templates.

Reason: {!Object_Name__c.Picklist_Field__c}
To pass this challenge, create a new list view which only shows contacts belonging to you that have been created or modified in the last week.The list view must be named 'My Recent Contacts'.
The list view should only be visible to you.
The list view must show contacts belonging to you that have been created or modified in the last week.Check Challenge

below is the error showing for this challenge
Challenge Not yet complete... here's what's wrong: 
The 'My Recent Contacts' list view was not found.
Hi all,

I was wondering if its possible for a trigger to automatically create an opportunity product when an opportunity is closed won.

I have an Object related to the opportunity that has fields called Product_Name__c and Total_Price__c.

I would like the trigger to populate these fields into the corresponding fields on the Opportunity Products object.

Thanks
Hi,

How can I create a rule that automatically updates my lead current stage according with a predefined date?

Imagine that at the moment my current lead stage is "No Answer (1)" and the Next stage change is in 2 days.

How can I do this validation rule?

Thank you
Hi Guys i am facing this below error while clicking on page reference link which i have created.

Error is :  A problem with the OnClick JavaScript for this button or link was encountered: missing ) after argument list

I wrote this code on pagereference link :  parent.location.replace("https://ap2.salesforce.com/apex/pageReference?id={!Account.Id}";

is this correct..if wrong plz suggest me