• @Karanraj
  • PRO
  • 2254 Points
  • Member since 2015
  • Senior Technical Consultant
  • HCL Technologies


  • Chatter
    Feed
  • 65
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 0
    Questions
  • 394
    Replies
Hi
I am trying to SMS Gateway Integration. I am struck at a point. 
I am invoking the class with Javascript button. So when the button is clicked, the sms is sent. But i am an errors. Please help.

My javaScript button code
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}


var callout = "" + sforce.apex.execute("DisplaySMSQueueListViewRecords","SedingSMSManullay",
    {msg:"{!Customer__c.Vehicle__c}",phone:"{!Customer__c.Phone__c}"}); 
    
    alert("SMS Sent");

My Apex Class
 
Global class DisplaySMSQueueListViewRecords 
{
    //variables
     @future(Callout=true)
    //Sending SMS Manually
    Webservice static void SedingSMSManullay(String msg,String phone)
    {               
    
                     String mobileNumber=phone;
                      String SendSMSString = msg;     
                        Http h = new Http();
                        HttpRequest req = new HttpRequest();
                        req.setEndpoint('http://bhashsms.in/api/sendmsg.php?user=xxx&pass=123456&sender=xxx&phone='+mobileNumber+'&text='+SendSMSString+'&priority=sdnd&stype=normal');        								
                        req.setHeader('Accept', 'text/xml');
                        req.setHeader('Content-Type' , 'text/plain');
                        req.setMethod('GET');
 						HttpResponse res;
        				if(!Test.isRunningTest())
                        	res = h.send(req);
        				
                       // Responsebody =res.getBody();
                        System.debug('***********'+res);
     }      
 }

Error I am getting when i click the button or execute the class from dev console.
 
00:11:22:020 FATAL_ERROR System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = http://bhashsms.in/api/sendmsg.php?user=xxx&pass=xxx&sender=xxx&phone=900000003&text=Message&priority=sdnd&stype=normal
I tried adding the Endpoint URL in the Remote Site Setting as "http://bhashsms.com" but it is still throwing the same error. 

Please help
 
Hi, 

This is my first attempt at building a VF page, so the code may not be formatted properly. But, I have been able to get everything to layout the way I need it to and to pull the data needed. However, It looks awful. The page will be displayed in SF classic, but I want it to look like the lightning layout. I followed the instructions to install the zip file as a static resource, but I still can't get the sytle to change. Any help with this would be greatly appreciated.

Here is my VF page code:

<apex:page standardController="Account" sidebar="true" showHeader="true" showChat="false" standardStylesheets="false">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<apex:stylesheet value="{!URLFOR($Resource.Lightning_CSS, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />

<div class="slds">

<apex:panelGrid columns="2" width="100%" border="0" styleClass="tableStyle" columnClasses="colStyle1,colStyle2" rowClasses="rowstyle">
    <apex:detail relatedList="false" title="true" inlineEdit="true"/>
           <chatter:feed entityId="{!Account.ID}"/>
</apex:panelgrid>
   <apex:tabPanel switchType="client" selectedTab="tabdetails"
                  id="AccountTabPanel" tabClass="activeTab"
                  inactiveTabClass="inactiveTab">  
      <apex:tab label="Contacts" name="Contacts" id="tabContact">
         <apex:relatedList subject="{!account}" list="contacts"/>
      </apex:tab>
      <apex:tab label="Opportunities" name="Opportunities"
                id="tabOpp">
         <apex:relatedList subject="{!account}"
                           list="opportunities" />
      </apex:tab>
      <apex:tab label="Assets" name="Assets"
                id="tabAssets">
         <apex:relatedList subject="{!account}"
                           list="Assets" />
      </apex:tab>
      <apex:tab label="Cases" name="Cases"
                id="tabCases">
         <apex:relatedList subject="{!account}"
                           list="Cases" />
      </apex:tab>
      <apex:tab label="OpenActivities" name="Open Activities"
                id="tabopact">
 <apex:relatedList subject="{!account}"
                           list="OpenActivities" />
                           </apex:tab>
      <apex:tab label="Notes and Attachments"
                name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!account}"
                           list="CombinedAttachments" />
      </apex:tab>
   </apex:tabPanel>
   </div> 
   </html>            
</apex:page>
I am prioritizing the account priorities as below. If i try to enter the same priority it shouldn't allow anyone to repeat the same, else give the alert msg. Can any one please suggest. Your help is appreciated. 
User-added image

Thanks 
Venkat
I am trying to update the Sample_QB_Error__c field with Hello
This code throws "an Invalid or unexpected token"  

Thanks
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/32.0/apex.js")} 
var record = new sforce.SObject("Opportunity"); 
record.Id = ‘{!Opportunity.Id}’; 
record.Sample_QB_Error__c ="Hello"; 
sforce.connection.update([record]); 
window.location.reload();

 
Hi, I need to create a button that will be used on an opportunity record to create a new related record. But i want this button to determine which record type to use based on if the logged in user is the opportunity owner. I don't have a clue how to write javascript to make this happen, can anyone help?

Here is what works in a regular button:
/a4J/e?
saveURL={!Opportunity.Id}
&retURL=%2F{!Opportunity.Id}
&RecordType=012W00000008qvd
&CF00NW0000000wUyk={!Opportunity.Name}
&ent=Partner

But, that is just for when Opportunity Owner Id does not equal User Id. I need to create a similar record, but change the record type if Opportunity Owner ID does equal Used Id. Ideally would like it to work from just one button.

Thanks!
  • August 03, 2016
  • Like
  • 0
I am working on a visualforce page that allows a user to uppdate an opportunity and opportunityLineItems and give them the option of attaching a file. The problem I am running into is that if you don't attach a file I get the error below. The user needs to be able to add or not add the attachment. Any suggestions?

This is the error:
System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [File Name, Body]: [File Name, Body]
Error is in expression '{!saveIt}' in component <apex:commandButton> in page orderonhand: Class.OrderOnHandClass.saveIt: line 30, column 1
Class.OrderOnHandClass.saveIt: line 30, column 1

This is the Visualforce Page:
<apex:page standardController="Opportunity" extensions="OrderOnHandClass">
    <apex:form >
        <apex:pageBlock >
        
            <apex:pageBlockSection title="Opportunity Details">
                <apex:inputCheckbox value="{!opportunity.Order_on_Hand__c}"/>
                <apex:inputField value="{!Opportunity.PO_Number__c}"/>
                <apex:inputField value="{!Opportunity.Order_Ship_To_Location__c}"/>
                
            </apex:pageBlockSection> 
            
            <apex:pageBlockSection title="Opportunity Product Details">
                <apex:pageBlockTable var="OLI" value="{!OLIs}" id="newProduct">
                    <apex:column value="{!OLI.ProductCode}"/>
                    <apex:column headerValue="Quantity">        
                        <apex:inputfield value="{!OLI.Quantity}"/>        
                    </apex:column>
                    <apex:column headerValue="Order Quantity if Different">        
                        <apex:inputfield value="{!OLI.Order_Quantity_if_Different__c}"/>        
                    </apex:column>
                    <apex:column headerValue="Approved Price">        
                        <apex:outputfield value="{!OLI.Approved_Price__c}"/>        
                    </apex:column>
                </apex:pageBlockTable>
            </apex:pageBlockSection> 
            
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!saveIt}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
           
            <apex:pageBlockSection title="Attachment" >
            Attach PO: <apex:inputfile value="{!a.body}" filename="{!a.name}"></apex:inputfile>
            </apex:pageBlockSection>

        </apex:pageBlock>
    </apex:form>
</apex:page>
This is the Class:
public class OrderOnHandClass {

    public ApexPages.StandardController sc;
    public Opportunity Opp {get;set;}
    public List<OpportunityLineItem> OLIlist2 {get ;set;}
    public Attachment a {get;set;}
      
    public OrderOnHandClass(ApexPages.StandardController sc) { 
        this.Opp = (Opportunity)sc.getRecord();
        OLIlist2 = [Select Name, ID,ProductCode, Quantity,Approved_Price__c, OpportunityId,Order_Quantity_if_Different__c FROM OpportunityLineItem WHERE OpportunityId =:Opp.Id];
        this.a = new Attachment();
       
        }
            
    public List<OpportunityLineItem> getOLIs() {
        return OLIlist2;
    }

    public PageReference saveIt() {
        
            opp.stageName = 'Order Received';
            update Opp;
             
            update OLIlist2;
       
       
        if(a.Id == Null){
            a.parentId = opp.Id;
        insert a;
        }else{
            Return Null;
            }
            
        String p = ApexPages.currentPage().getParameters().get('param');
            if(p == null){
                PageReference pageRef = new PageReference('https://cs41.salesforce.com/'+opp.Id);
                return pageRef;
            }
            else{
                return null;
            }     
    }
    }


 
Why do we need to create a specific developper edition org to use Wave ?

NB : I already have a developper edition org based on my usual adress email. I had to use another email adress to create a second profile in order to play with Wave according to https://developer.salesforce.com/trailhead/en/wave_analytics_basics/wave_start_surfing_the_wave
 
I've been working on the trailhead training for apex triggers

However I keep getting an error in the developer console: "AccountAccess Trigger: Field is not writeable: Account.SippingAddress. I've scoured the forum but I haven't found anything that has been the answer to my problem. Thanks in advance for your help!
trigger AccountAddressTrigger on Account (before insert, before update) {
    for(Account a : Trigger.New) {
        if(NULL != a.BillingPostalCode && a.Match_Billing_Address__c == true){
			a.ShippingAddress = a.BillingAddress;
        }
    }
}

 
I am getting the following error whe I attempt to execute a query.
 
Line: 4, Column: 14
Didn't understand relationship 'attachment' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
The query (being executed via the debug in developer console
PUBLIC STRING strTemplate_Initial;
strTemplate_Initial = 'TEST EMAIL';

PUBLIC LIST <ci_mailout__c> objMailout;

objMailout = [SELECT m.Id, m.contact__c, contact__r.Name, m.recipient_first_name__c, m.recipient_last_name__c, caps__r.AccountID__c, m.file_password__c, m.email_address__c, (SELECT ID, Name, ContentType, body FROM attachment) FROM ci_mailout__c m WHERE Sent__c = FALSE AND Mailout_name__c = :strTemplate_Initial ORDER BY Policy_count__C Desc LIMIT 100];

SYSTEM.debug('Size of Mailout: ' + objMailout.size());

The code I originally had was two seperate queries on for the mailout and one for attachements which worked, however, it starts to hit the limit for SOQL statements and so I was thinking I could join the two statements to reduce the calls.

Original SOQL (in isolation)
objMailout = [SELECT Id, contact__c, contact__r.Name, recipient_first_name__c, recipient_last_name__c, caps__r.AccountID__c, file_password__c, email_address__c FROM ci_mailout__c WHERE Sent__c = FALSE AND Mailout_name__c = :strTemplate_Initial ORDER BY Policy_count__C Desc LIMIT 50];

objAttachment = [SELECT ID, Name, ContentType, body FROM attachment WHERE ParentId = :thisMailOut.Id];

Thanks for your help ...



 
I have a button that route users to seperate URL links based on a checkbox selection. I would like to remove the hard coded URL and use relative instead. Thanks
 
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}


if ({!CustomObject__c.checkbox__c}== false)
{
var URL1 = "https://c.cs11.visual.force.com/apex/ObjectCustom?id=" + '{!CustomObject_A__c.Id}';
window.open(URL1);

}
else
{
var URL2 = "https://c.cs11.visual.force.com/apex/ObjectCustom?id=" + '{!CustomObject_B__c.Id}';
window.open(URL2);
}

 
I am a  beginner : Not able to solve Trailhead challange for-Developer Beginner :Visualforce Basics-Displaying Records, Fields, and Tables-Create a Visualforce page which displays a variety of output fields
Create a page which displays a subset of Opportunity fields using apex:outputField components. Bind the Name, Amount, Close Date and Account Name fields to the apex:outputField components.
The page must be named 'OppView'.
It must reference the Opportunity standard controller.
It must have an apex:outputField component bound to the Opportunity Name.
It must have an apex:outputField component bound to the Opportunity Amount.
It must have an apex:outputField component bound to the Opportunity Close Date.
It must have an apex:outputField component bound to the Account Name of the Opportunity.

What I had tried is craeted OppView Page with below code:
<apex:page standardController="Opportunity" tabStyle="Opportunity">
    <apex:pageBlock >
        <apex:pageBlockSection title="Opportunity Information">
           Opportunity Name <apex:outputField value="{!opportunity.name}"/>
           Opportunity Amount <apex:outputField value="{!opportunity.amount}"/>
           Opportunity Close Date. <apex:outputField value="{!opportunity.closeDate}"/>
           Opportunity Account Name   <apex:outputField value="{!opportunity.accountId}"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

 while checking challange got below error
Challenge Not yet complete... here's what's wrong:
The page does not include a apex:outputField component bound to the opportunity account name.

Please suggest
 
Is Aura, a javascript framework? What is Aura framework built of?
Hello,

I have created a "Event" on the custom object, it is not possible to delete it as the field "Assigned To" is some other user.
If i change the "Assigned To" to the current user, the deletion is sucessful.

Is this normal or any changes can be made ?
But the current user is the one who created the event ..

thanks for suggetion
 
  • June 03, 2016
  • Like
  • 0

Hello, I would know in my code how can I get the name of the user who edited the post. I can get ID from the User that modified the post, but I want to get the name.

<!-- Remote Objects definition to set accessible sObjects and fields -->
    <apex:remoteObjects >
        <apex:remoteObjectModel name="Post__c" jsShorthand="Post" fields="Name,Id,LastModifiedDate, LastModifiedById">
            <apex:remoteObjectField name="Body__c" jsShorthand="Body"/>
            <apex:remoteObjectField name="Tags__c" jsShorthand="Tags"/>
        </apex:remoteObjectModel>
    </apex:remoteObjects>

<div id="rows"> </div>

<script>
           // Create a new Remote Object
            var pt = new SObjectModel.Post();

            // Use the Remote Object to query for 3 post records
            pt.retrieve({ limit: 3 }, function(err, records){
                if(err) alert(err.message);
                else {
                             var rows = document.getElementById("rows");
                             var ptLastModifiedById  = record.get("LastModifiedById");
                             //div data
                             var postData = document.createElement('div');
                             postData.className = "postData";
                             postData.innerHTML += ptLastModifiedDate + " by " + ptLastModifiedById;
                             div.appendChild(postData);

                             rows.appendChild(div);
                       });
                  }
            });
</script>

I'm trying to use Chatter in my Dev Org for the Trailhead tutorial and the only options are for creating new actions, like "new account", "new trip", "new lead", etc.
The regular posting window for post, file, link, poll is not available.
Did I do something wrong when I enabled this, or click a wrong box somewhere else?
 
I needed to be able to customize the fields visible on the Contact Role Opportunity related list to add the Contact Mobile Phone. I searched Answers and the famous Deepak came up with a brillant work-around solution using VisualForce (see link to the original thread below).

https://success.salesforce.com/answers?id=90630000000hp0AAAQ

I used the VF code he provided and modified it to pull in the Contact Mobile Phone into the Contact Roles related list on the Opportunity. It works perfectly except for a couple of things:
  • When I click to add a New Contact Role in the new VF page on the Opportunity, it pulls it in within the full SF tab and sidebar window (see screen shot below).
  • There is no link to the Contact record in the VF Contact Role related list (see screen shot below).
Add New Contact Role Opens in the full SF tab and sidebar window Shot
User-added image

VF Contact Role has no link to the Contact record​
User-added image


Does anyone know if is there a way to modify the VF code Deepak provided to resolve these two issues? 

Any help or advice will be most appreciated!

Thanks!
 
Usr is User data type. I tried:

usr.TimeZoneSidKey     = '(GMT-06:00) Mountain Daylight Time (America/Denver)';

but I get the next error after trying to insert:

15:19:03:036 FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Time Zone: bad value for restricted picklist field: (GMT-06:00) Mountain Daylight Time (America/Denver): [TimeZoneSidKey]

but '(GMT-06:00) Mountain Daylight Time (America/Denver)' is one of the picklist values for TimeZoneSidKey.

Any help, please?
Thanks
Jose
All documentation and articles I have found create a new test user to be used with the RunAs method in a Test Class. How would I run as an existing user, such as an "Integration User" we have? I don't want to create a new user in the Test Class.
Hi Everyone,

I have 3 validation rules that looks a qty of a field and the available qty on the account record and it restricts creation if the login in qty is > than the available qty.

The issue is that I have 3 separate validation rules that looks at the same Login Qty field is the and when they are all activated that conflict with each other. Can you assist in creating a single formula that acts for the 3?

Formula 1: 
AND( Login_Qty__c > Account__r.Total_Of_User_Login_s_Available__c) 
&& 
NOT( No_Charge_Login__c = TRUE)

Formula 2:
AND(Login_Qty__c > Account__r.Total_Of_Systems_Login_s_Availab__c ) 
&& 
NOT( No_Charge_Login__c = TRUE)

Formula 3:
AND(Login_Qty__c > Account__r.Total_Of_Login_s_Available__c) 
&& 
NOT( No_Charge_Login__c = TRUE)

Thanks!
Hi,
We are trying to automate the exporting of a report to xls file rather than manually doing it through the UI. 

I am currently using the Ant Migration Tool to export the metadata for a particular report (i.e. "ExampleReport") and save the metadata in file "ExampleReport.report" file. The ".report" file is basically an xml format and contains the columns and filter for the report. 

How can i use this ExampleReport.report file to extract the data resulting from the report and save it as an xls file? Would i be able to use the Ant migration tool or would i have to use something like java to do this?

ExampleReport.report file
<?xml version="1.0" encoding="UTF-8"?>
<Report xmlns=".../metadata">
         <columns>
                   <field>Account_Name</field>
         <columns>

         <filter>
                <booleanFilter> 1 OR 2 </booleanFilter>
                <criteriaItems>
                          <columns> Opportunity.Name</columns>
                                  <operator>contains</operator>
                         <value>some_value</value>
              <criteriaItems>
                          <columns> Account.Name</columns>
                                  <operator>contains</operator>
                         <value>some_value</value>
             </criteriaItems>
         </filter>

         /* there are some other items, but for the sake of the length, i am omitting for now */
</report>

 
  • April 27, 2016
  • Like
  • 0
Hi Guys,
While completing "Sales Path & Workspaces" module I get this message, I have created 2 new orgs both dont have a Namespace.
Any Ideas how I can solve this? All help welcome!
error message

Thanks
Hi
I am trying to SMS Gateway Integration. I am struck at a point. 
I am invoking the class with Javascript button. So when the button is clicked, the sms is sent. But i am an errors. Please help.

My javaScript button code
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}


var callout = "" + sforce.apex.execute("DisplaySMSQueueListViewRecords","SedingSMSManullay",
    {msg:"{!Customer__c.Vehicle__c}",phone:"{!Customer__c.Phone__c}"}); 
    
    alert("SMS Sent");

My Apex Class
 
Global class DisplaySMSQueueListViewRecords 
{
    //variables
     @future(Callout=true)
    //Sending SMS Manually
    Webservice static void SedingSMSManullay(String msg,String phone)
    {               
    
                     String mobileNumber=phone;
                      String SendSMSString = msg;     
                        Http h = new Http();
                        HttpRequest req = new HttpRequest();
                        req.setEndpoint('http://bhashsms.in/api/sendmsg.php?user=xxx&pass=123456&sender=xxx&phone='+mobileNumber+'&text='+SendSMSString+'&priority=sdnd&stype=normal');        								
                        req.setHeader('Accept', 'text/xml');
                        req.setHeader('Content-Type' , 'text/plain');
                        req.setMethod('GET');
 						HttpResponse res;
        				if(!Test.isRunningTest())
                        	res = h.send(req);
        				
                       // Responsebody =res.getBody();
                        System.debug('***********'+res);
     }      
 }

Error I am getting when i click the button or execute the class from dev console.
 
00:11:22:020 FATAL_ERROR System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = http://bhashsms.in/api/sendmsg.php?user=xxx&pass=xxx&sender=xxx&phone=900000003&text=Message&priority=sdnd&stype=normal
I tried adding the Endpoint URL in the Remote Site Setting as "http://bhashsms.com" but it is still throwing the same error. 

Please help
 
Below is the code sample I'm trying to put in a controller extension class. However, I'm getting "variable does not exist: opp.id" error at line 13. The actual code makes a http callout to an external service. I'm trying to write code to make a javascript remoting call on click of a button from a VF page. Could you please help
 
public class TestPageEx {
    private final Opportunity opp;
    // The extension constructor initializes the private member
    // variable acct by using the getRecord method from the standard
    // controller.
    public TestPageEx(ApexPages.StandardController stdController) {
        this.opp = (Opportunity)stdController.getRecord();
    }
    
    @RemoteAction
    public static String aaExample(String s)
    {
        Attachment att=   [Select Id,ParentId, Name,body,ContentType From Attachment where ParentId = :opp.Id limit 1];

}

}

Thanks.
Batch job failing in PROD with error REQUEST_RUNNING_TOO_LONG .. field which I am using in SOQL is not indexed .. that could be issue? 
Hello,
 
I am creating custom address fields on the opportunity object with the same fields as the standard address fields with country and state picklist values.  I am looking to see if I can build a custom visual force popup window for the inline editing like the standard address features.  Is this possibile and if so how would I go about doing this?
 
Thanks,
 
Aaron
 
I am creating a inbound email handler class to create a task when an email is recieved.  I would like any attachment to be added to the task as well but cannot seem to get that part to work.  The class will create a task correclty it just won't create the attachment.  My code is below.

global class partnerTaskEmailClass implements Messaging.InboundEmailHandler {
    
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.Inboundenvelope envelope){                
        
        Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();        
        Contact Contact;

        if([select count() from Contact where Email = :email.fromAddress ] == 0)
        {
            Contact = [Select ID, Account_Id__c from Contact where email = 'tcaldwell@fourwindsinteractive.com' AND Account_Id__c = '0018000001BeR5A' limit 1];
        }
        else {
            Contact = [Select ID, Account_Id__c from Contact where email = :email.fromAddress ];
        }
        
            task t = new task();
            t.WhoId = Contact.Id;
            t.whatId = Contact.Account_Id__c;
            t.Subject = email.subject;
            t.description = email.PlainTextBody;
            t.Partner_Email_Address__c  = email.fromAddress;
            t.Type = 'Partner Request';
            t.ActivityDate = Date.today().addDays(1);
            t.RecordTypeId = '0121b000000CkAG';
            t.OwnerId = '00580000004V5YW';
            t.Priority = 'Normal';
        
            insert t;
            
        
            if(email.textAttachments != null)
            {
                Task newtask = [Select Id from Task where Subject = : email.subject order by CreatedDate Desc Limit 1];
                for (Messaging.Inboundemail.TextAttachment tAttachment : email.textAttachments) {
                  Attachment attachment = new Attachment();
                  attachment.Name = tAttachment.fileName;
                  attachment.Body = Blob.valueOf(tAttachment.body);
                  attachment.ParentId = newtask.Id;
                  insert attachment;
                }
            }


Return Result;
           
}

}
I am trying to correct an issue with a package I am using called Custom Related Lists. The error I am receiving is shown below.

Script-thrown exception
Error is in expression ‘{!generateCode}’ in component in page crl_newcrl: Class.ToolingAPI.submitRestCall: line 476, column 1
Class.ToolingAPI.submitRestCallAndDeserialize: line 418, column 1
Class.ToolingAPI.createSObject: line 79, column 1
Class.CRL_CodeGenerationLib.GenerateClass: line 9, column 1
Class.CRL_NewCRLCtrl.generateCode: line 220, column 1
Caused by
Class.ToolingAPI.submitRestCall: line 473, column 1
Class.ToolingAPI.submitRestCallAndDeserialize: line 418, column 1
Class.ToolingAPI.createSObject: line 79, column 1
Class.CRL_CodeGenerationLib.GenerateClass: line 9, column 1
Class.CRL_NewCRLCtrl.generateCode: line 220, column 1

Someone posted what seems to be a simple solution but I have no experience using Developer Console. Here is what the solution is.

I was able to get this to work by adding a new remote site in sandbox. For others that run into this error, jump into your developer console and identify the endpoint URL that needs to be added as a new remote site and your custom related lists will generate perfectly.

I have no clue how to do what they are describing above. Any help would be appreciated.
Hello!

I would like when someone selects to change the owner of an Opportunity for the Send Email Notification checkbox to be TRUE by default.

Any thoughts on code to do this?

I saw it at an old job but I didn't grab a copy.

Ryan
How can I provide Read Only access for this IsActive field (Checkbox field in user object) for a user with a custom profile (user with - Salesforce Platform License)?

This field is visible for a user with System Administrator Profile (license - Salesforce).

But this field is not visile for the user with a custom Read Only profile (license - Salesforce Platform).

(Is this becuase for the license of the users?  
Is there a restriction for visiblity of IsActive Field in User Object)

Kindly let me know your comments.

Regards,
PJ
Hello Team,

We are planning to upgrade the API version to latest one(38) .

We need assistance on the procedure.

Thank you

Prabhat
I am trying to deploy my Apex Classes and Trigger to Production. I have confirmed these code coverages in Mavensmate and Developer Console.

Class Code Coverage

Trigger Coverage

When I deploy. I get this error. I also see this error when I try and deploy from Eclipse.

Deploy Results

I am starting to scramlbe here since I need these in Production by Monday. Thanks for any help you may be able to provide.
 
Navigating Setup Unit
https://youtu.be/uM9Nli7xpEM
Can this be seen in a different way or marked not private?
Thank you.
How to connect our "Contact Us" icon on our website to populate my SF database under a "new lead" and to automatically generate an e-mail to be sent to the customer
Hi, 

This is my first attempt at building a VF page, so the code may not be formatted properly. But, I have been able to get everything to layout the way I need it to and to pull the data needed. However, It looks awful. The page will be displayed in SF classic, but I want it to look like the lightning layout. I followed the instructions to install the zip file as a static resource, but I still can't get the sytle to change. Any help with this would be greatly appreciated.

Here is my VF page code:

<apex:page standardController="Account" sidebar="true" showHeader="true" showChat="false" standardStylesheets="false">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<apex:stylesheet value="{!URLFOR($Resource.Lightning_CSS, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />

<div class="slds">

<apex:panelGrid columns="2" width="100%" border="0" styleClass="tableStyle" columnClasses="colStyle1,colStyle2" rowClasses="rowstyle">
    <apex:detail relatedList="false" title="true" inlineEdit="true"/>
           <chatter:feed entityId="{!Account.ID}"/>
</apex:panelgrid>
   <apex:tabPanel switchType="client" selectedTab="tabdetails"
                  id="AccountTabPanel" tabClass="activeTab"
                  inactiveTabClass="inactiveTab">  
      <apex:tab label="Contacts" name="Contacts" id="tabContact">
         <apex:relatedList subject="{!account}" list="contacts"/>
      </apex:tab>
      <apex:tab label="Opportunities" name="Opportunities"
                id="tabOpp">
         <apex:relatedList subject="{!account}"
                           list="opportunities" />
      </apex:tab>
      <apex:tab label="Assets" name="Assets"
                id="tabAssets">
         <apex:relatedList subject="{!account}"
                           list="Assets" />
      </apex:tab>
      <apex:tab label="Cases" name="Cases"
                id="tabCases">
         <apex:relatedList subject="{!account}"
                           list="Cases" />
      </apex:tab>
      <apex:tab label="OpenActivities" name="Open Activities"
                id="tabopact">
 <apex:relatedList subject="{!account}"
                           list="OpenActivities" />
                           </apex:tab>
      <apex:tab label="Notes and Attachments"
                name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!account}"
                           list="CombinedAttachments" />
      </apex:tab>
   </apex:tabPanel>
   </div> 
   </html>            
</apex:page>
I am prioritizing the account priorities as below. If i try to enter the same priority it shouldn't allow anyone to repeat the same, else give the alert msg. Can any one please suggest. Your help is appreciated. 
User-added image

Thanks 
Venkat
Hi!
On a lead record, we have a required field > Industry.  The problem is, people can add tasks to the lead and save them without being forced to enter the Industry on the Lead information.  How can I force them to add content to a lead before they can add a task or save an activity ie a call.
Thanks in advance.
Hi experts,
Very basic question and find difficult to understand. And please let me know, when to use what?

What is the difference between these 2 coding structures:
1.  public String name {
         get { return name;}
        set { name = value;}

2. public String name{get;set;}
International company looking for experienced Admin or Developer for multiple projects. Must have experience with Visual Force pages, the ability to build custom applications and experience with Community. 

Projects include
-Custom buttons
-Custom Objects
   - Time Tracking
   - Task Management/Checklists
   - Automated Proposals/Invoicing
-Client facing Community
   - Task Management/Checklists
   - Account Hierarchy 
 
 
Hi All,
Here is my small code snippet. I have implemented the modal popup using CSS  and action:function. I want to do this toggle effect without using controller. So that i can implement everything in the VF page itself. Help! :)
 
<apex:page controller="dumm" >
 <apex:form id="form" >
   <apex:image id="theImage" onmouseover="showPopup()" onmouseout="hidePopup()"  value= "{!$Resource.EC2Console_RebootImage}" width="30" height="30"/>
    <apex:actionFunction action="{!showPopUp}" name="showPopup" reRender="form" />
    <apex:actionFunction action="{!closePopup}" name="hidePopup" reRender="theIframe" />
    <apex:outputPanel id="tstpopup">
        <apex:outputPanel styleClass="popupBackground"   layout="block" rendered="{!displayPopUp}"/>
            <apex:outputPanel styleClass="custPopup"  rendered="{!displayPopUp}">
               <apex:commandButton value="Close" action="{!closePopup}" rerender="tstpopup"/>
                <apex:iframe src="https://www.salesforce.com"  scrolling="true" height="300"></apex:iframe></apex:outputPanel>
   </apex:outputPanel>
</apex:form>
<style type="text/css">
        .custPopup{
            background-color: white;
            border-width: 2px;
            border-style: solid;
            z-index: 9999;
            left: 50%;
            padding:10px;
            position: absolute;
            width: 700px;
            margin-left: -250px;
            top:100px;
        }
        .popupBackground{
            background-color:black;
            opacity: 0.20;
            filter: alpha(opacity = 20);
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            z-index: 9998;
        }

    </style>
</apex:page>

public with sharing class dumm {

    public dumm(ApexPages.StandardController controller) {

    }


public boolean displayPopup {get; set;} 
    public dumm(){
        displayPopup = false;
    }
    
    public void closePopup() {        
        displayPopup = false;    
    }     
    public void showPopup() {        
        displayPopup = true;    
    }
    
  
}