• Dev-Fox
  • NEWBIE
  • 125 Points
  • Member since 2010

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 7
    Questions
  • 30
    Replies
I have an OnClick JScript as below for a Custom Button, where I need to make the checkbox Escalated_Call__c to true. 

What is wrong with the below code- No error, but do not make checkbox true.

{!REQUIRESCRIPT("/soap/ajax/41.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")}

var objCase = new sforce.SObject('Case');

objCase.Escalation_Reason_Details__c ='{!JSENCODE(Case.Escalation_Reason_Details__c)}';

if(objCase.Escalation_Reason_Details__c == '')
{
alert ('Please fill Escalation_Reason_Details__c');
}
else
{

objCase.Escalated_Call__c=true;

}
var result = sforce.connection.update([objCase]);
location.reload(true);
Hello, I need help writing a test class. Here is my class (I am using it as a controller for an aura component).

public class getListViews {
@AuraEnabled
public static List<ListView> getListViews() {
    List<ListView> listviews =
        [SELECT Id, Name FROM ListView WHERE SobjectType = 'Discharge__c' and Name ='All New Discharges'];
    // Perform isAccessible() check here
    if (Schema.sObjectType.Discharge__c.isAccessible()){
    return listviews;
    }
    return listviews;
}

}

Can someone please assist in writing test class.

Hi,

Im using nested loop for fetching case comments depending on the languages(its a list), To achieve this I have implemented nested Loop.
1st loop fetches all the languages from the custom object and 
2nd loop fetches case comments depending on the language.
While im using this  "Too many SOQL queries" is firing please suggest me solution.

 

Hi, I am trying to combine two picklist values from two different objects for selection on my vf page.

let's say, I have an object opportunity with Stage picklist

there is another object as "Order Intake" which is the child of opportunity; it has a picklist which says if the oif days are due by options:
10 days
20 days
30 days

I am creating a picklist for vf page as 'Select category' where I want options as Stage values + Order Intake values;
when I select the options it should display respective Order Intake or opportunity.

Please assist

Hi all,

 

          i am stuck in a position with Informatica app. I am using Informatica for capturing records from local system to the salesforce, like the same i need to generate a csv file to local system when ever a record is captured from Web to Lead. What should i do, i got an idea to create a java application but i am not sure... can any one suggest me what is the best method. Is there any tool to act like above.......

 

WarmRegards,

Chiru

 

Hi all,

 

I have a query on campaign and Account, here i have to assaign Lead relatedlist campaigns to a particular account

based on some conditions. But i can't see any field to assaign the accountid to the campaign record. I am writing a trigger for this, but i couldn't find the solution. Please some one help me to find the field to assaign account id to the campaign record.

 

Thanks & Regards,

Developer

 

Hi all,

  i have created the salesforce site, i had a problem with this Site, that it doesn't maintaing the security for the site.So we trying to create the session for the site. Can any one suggest about this issue. Do we need to create any sessions manually? or by the coded sessions through apex coding?

 

Thanks in Advance,

Chiru

Hi all,

   I am working on salesforce sites right now. All the pages and controllers part has been completed except the login and

logout functionalities. Actually i have never worked on this kind of issue and i don't know how to do this. Can any one help

me to complete this task.

 

Thanks,

 

neelam...

 

 

Hi all,

i am working on a custom object and i am not able to get name uniquely.can any one help me to get all names unique.

 

Thanks,

chiru.

 

Here is my page:

<apex:page controller="Todownload">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!Allattachments}" var="allatt">
                <apex:column value="{!allatt.DealName}"/>
                <apex:column value="{!allatt.Name}"/>
               <apex:column > <apex:outputLink value="/servlet/servlet.FileDownload?file={!allatt.Id}">{!allatt.Name}</apex:outputLink></apex:column>                
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

And the controller:

public with sharing class Todownload {
    List<Attachment> atlist;
    List<Deal__c> Dealfields;
    List<WrapperClass> wcList=new List<WrapperClass>();
     Set<String> dealidset=new Set<String>();
    public List<WrapperClass> getAllattachments() {
    Dealfields = [select  name, RecordTypeId, Address__c,City__c,State__c,ShortDescription__c,PPM_Funding_Date__c,Fundraising_Goal__c,DealType__c,id from deal__c where ShowInInvestorAdvisorPortals__c=true];
        
         if(Dealfields!=null && Dealfields.size()>0){            
             for(deal__c deal:Dealfields ){               
                 dealidset.add(deal.id);                 
             }
         }
        
         
         atlist=[Select Name,parentid,id from Attachment where ParentId in :dealidset];
        
         for(Attachment a :atlist ){
             WrapperClass w = new WrapperClass();
             w.Id = a.Id;
             w.Name=a.Name;
             for( deal__c d : Dealfields){
                 if(d.Id==a.parentid){
                     w.DealName=d.Name;
                 }
             }
             wcList.add(w);
         }
         
        return wcList;
    }
    public List<WrapperClass> getWrapperRec(){
       System.debug('asdf'+wcList.size());
        return wcList;
    }
    public class WrapperClass{
        public string Id{get;set;}
        public string Name{get;set;}
        public string DealName{get;set;}
    }
    
}

Hi all,

  i had requirement to pull the data from workspace contents.But it is not allowing to pull records, and giving error messages like this content does supports the List<> option.so i stuck here can anyone tell me how to get them in

a bulk way, so that i can show all the records in the page. i have developed some code, but it is retriving a single

record when i give the ID in the url like ?id=059R00000004IQBIA2 , this is workspace doc id. What i need to do now....

 

this is the page

<apex:page standardController="ContentWorkspacedoc">
    <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockTable value="{!ContentWorkspacedoc}" var="cwsd">
                        <apex:column value="{!cwsd.Id}"/> 
                        <apex:column value="{!cwsd.CONTENTDOCUMENTID}"/>     
                        <apex:column value="{!cwsd.ContentDocument.Title}"/> 
                        <apex:column value="{!cwsd.ContentDocument.LATESTPUBLISHEDVERSIONID}"/>
                        <apex:column value="{!cwsd.ContentWorkspace.NAME}"/>                        
                    </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Hi All,

   I came across an issue now which should not get at this point of time. Actually, i am working on a controller. I 've already reached apprx 3000 lines of code. Still the requirement is there to code in the controller. But it is showing SCRIPT TOO LARGE error, how could i overcome this issue?

 

Thanks in advance,

Chiru

Hello,
My Controller extension is supposed to query some records, but it is not working- the visualforce page is not displaying any records when the query should be returning. Is there an issue with this controller?

Here is the page:
<apex:page standardController="Discharge__c" extensions="CbosOldListExtension" lightningStylesheets="true">
    <apex:pageBlock title="Referrals/CBO History">
  <apex:pageBlockTable value="{!listofCbos}" var="cbolist">
   <apex:column >
    <apex:facet name="header">Referral Date</apex:facet>
    <apex:outputText value="{!cbolist.referral_date__c}"/>
   </apex:column>
   <apex:column >
    <apex:facet name="header">CBO Type</apex:facet>
    <apex:outputText value="{!cbolist.cbo_type__c}"/>
   </apex:column>
   <apex:column >
    <apex:facet name="header">CBO Name</apex:facet>
    <apex:outputText value="{!cbolist.cbo_name__c}"/>
   </apex:column>
   <apex:column >
    <apex:facet name="header">Referral Status</apex:facet>
    <apex:outputText value="{!cbolist.referral_status__c}"/>
   </apex:column>
   <apex:column >
       <apex:facet name="header">Rejection/Cancellation Reason</apex:facet>
    <apex:outputText value="{!cbolist.rejection_cancellation_reason__c}"/>
   </apex:column>
        <apex:column >
    <apex:facet name="header">Start of Service</apex:facet>
    <apex:outputText value="{!cbolist.start_of_service__c}"/>
   </apex:column>
   <apex:column >
       <apex:facet name="header">End of Service</apex:facet>
    <apex:outputText value="{!cbolist.end_of_service__c}"/>
   </apex:column>
  </apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

And the Controller:
public with sharing class CbosOldListExtension {
    
private final Discharge__c dis;
    
    Public List<Cbo__c> listofCbos {get; set;}
    
    Public CbosOldListExtension(ApexPages.StandardController stdController){
        this.dis = (Discharge__c)stdController.getRecord();
        try{
        Id myDischargeId = [Select Id, Name, Date_of_Birth__c from Discharge__c where Id = :this.dis.id].Id;
        String myDischargeName = [Select Name from Discharge__c where Name = :this.dis.name].name;
        //Date myDischargeDOB = [Select Id, Name, Date_of_Birth__c from Discharge__c where Name = :this.dis.id].Date_of_Birth__c;
        string myDischargeSSN = [Select Id, Name, ssn__c from Discharge__c where ssn__c = :this.dis.id].ssn__c;
        
        listofCbos = [SELECT Discharge_name__c, cbo_type__c, cbo_name__c, referral_date__c, referral_status__c, 
                      rejection_cancellation_reason__c, start_of_service__c, end_of_service__c 
                      FROM CBO__c 
                      WHERE discharge_name__r.name = :myDischargeName];
                 //  and   discharge_name__r.ssn__c = :myDischargeSSN];
        }
        catch(exception e){
            Apexpages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.FATAL, 'No old records'));
        }
    }
}
 

Hi, I'm trying to add a map component within a custom object. I found a code on this forum, but as I tried to edit it for my org, I got this error: 

Error: Incorrect parameter type for function 'not()'. Expected Boolean, received Text

Not sure where to find the cause. Any help? 

<apex:page standardController="Apartments__C">

<head>

<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
<script type="text/javascript"> 

$(document).ready(function() {

  var myOptions = {
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    mapTypeControl: false
  }

  var map;
  var marker;

  var geocoder = new google.maps.Geocoder();
  var address = "{!Apartments__c.Name} {!Apartments__c.city__c} {!Apartments__c.State__c}";
  var infowindow = new google.maps.InfoWindow({
  content: "<b>{!Apartments__c.Name}</b><br>" + address + " "
  });

  geocoder.geocode( { address: address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK && results.length) {
      if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {

        //create map
        map = new google.maps.Map(document.getElementById("map"), myOptions);

        //center map
        map.setCenter(results[0].geometry.location);

        //create marker
        marker = new google.maps.Marker({
            position: results[0].geometry.location,
            map: map,
            title: "{!!Apartments__c.Name}";
        });

        //add listeners
        google.maps.event.addListener(marker, 'click', function() {
          infowindow.open(map,marker);
        });
        google.maps.event.addListener(infowindow, 'closeclick', function() {
          map.setCenter(marker.getPosition()); 
        });

      }

    } else {
      $('#map').css({'height' : '15px'});
      $('#map').html("Oops! address could not be found, please make sure the address is correct.");
      resizeIframe();
    }
  });

  function resizeIframe() {
    var me = window.name;
    if (me) {
      var iframes = parent.document.getElementsByName(me);
      if (iframes && iframes.length == 1) {
        height = document.body.offsetHeight;
        iframes[0].style.height = height + "px";
      }
    }
  }

});
</script>

<style>
#map {
  font-family: Arial;
  font-size:12px;
  line-height:normal !important;
  height:250px;
  //min-width:300px;
  background:transparent;
}
</style>

</head>

<body>
<div id="map"></div> 
</body>   
</apex:page>
Hello.
Could anyone help me with next:
When a new Activity is added to Account a modal dialog should open with:
Simple header like Update Account
2 radio buttons - Yes (default) \ No 
If selected 'Yes' - Then a picklist from Account object should be shown with it current value selected, so user can change value and update account on save
If No - no updates need and modal just close.

Thanks in advance
I have an OnClick JScript as below for a Custom Button, where I need to make the checkbox Escalated_Call__c to true. 

What is wrong with the below code- No error, but do not make checkbox true.

{!REQUIRESCRIPT("/soap/ajax/41.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")}

var objCase = new sforce.SObject('Case');

objCase.Escalation_Reason_Details__c ='{!JSENCODE(Case.Escalation_Reason_Details__c)}';

if(objCase.Escalation_Reason_Details__c == '')
{
alert ('Please fill Escalation_Reason_Details__c');
}
else
{

objCase.Escalated_Call__c=true;

}
var result = sforce.connection.update([objCase]);
location.reload(true);
Hi, We have our Calendar set-up as a custom visualforce page along with a custom setting for the event category RGB color that shows based on the field Event_Category, checkbox is checked for available in lightning on the visualforce page and the lightning stylesheets applied from the lightning experience configuration converter but when in lightning experience when a user clicks on a date to create a new event it shows error Unable to access page 
which in classic normaly opens up a new event record creation page
Unable to Access Page
You are missing information needed by the page you have attempted to access. If you believe this is an error, please refresh your screen. If the error persists, please report it to our Customer Support team and provide the URL of the page you were requesting as well as any other related information.


Your Help is appreciated 
Thanks
Hello, I need help writing a test class. Here is my class (I am using it as a controller for an aura component).

public class getListViews {
@AuraEnabled
public static List<ListView> getListViews() {
    List<ListView> listviews =
        [SELECT Id, Name FROM ListView WHERE SobjectType = 'Discharge__c' and Name ='All New Discharges'];
    // Perform isAccessible() check here
    if (Schema.sObjectType.Discharge__c.isAccessible()){
    return listviews;
    }
    return listviews;
}

}

Can someone please assist in writing test class.
Users have been receiving a component error, however as System Admin role I don't run into this error. Any ideas on how I can fix this error for other users?

A component error has occured: Invalid definition for null:Proposal_Request_Distribution__mdt[]: Access to entity 'Proposal_Request_Distribution__mdt'denied

Any help would be much appreciated!
Task[] restoreTaskOwner = new Task[0];
for(Task task : [SELECT Id, OwnerId, CustonField__c FROM Task Where WhatId IN :changedOwnerIds AND IsClosed = FALSE AND CustonField__c<> null]){
if (task.OwnerId <> tak.CustonField__c) {
                task.OwnerId = task.CustonField__c;
                restoreTaskOwner.add(tsk); } }
Hello,
 I have a functioning component where I can have a user upload 1 attachment at a time.  I would like them to be able to upload multiple attachment at a time and then save.  I have found plenty of information on this topic but my component doe snot reside in SF.  I have a standalone process that utilizes lightning out.

Thanks,
P
master details and lookup relationship
We have ran into an issue where our triggers have stopped working, they are not firing any longer.  We have been told there is no way to monitor the triggers so that we could be alerted when they stop working.  Has anyone found a way to be notified when a trigger stops working?

Thanks,
Andrew

Hi,

Im using nested loop for fetching case comments depending on the languages(its a list), To achieve this I have implemented nested Loop.
1st loop fetches all the languages from the custom object and 
2nd loop fetches case comments depending on the language.
While im using this  "Too many SOQL queries" is firing please suggest me solution.

 

We can't save this record because the “UNITY WO Document Compliance Update on Orders” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: UNITY_OrderTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 8020Z0000017SXfQAM; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The cost cannot be increased if the PO is in Accepted, Final, or Completed status.: [] () . You can look up ExceptionCode values in the SOAP API Developer Guide.---This error occurred when the flow tried to update records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: UNITY_OrderTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 8020Z0000017SXfQAM; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The cost cannot be increased if the PO is in Accepted, Final, or Completed status.: [] () . You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 1922870313-4732 (-475982047)
Hi, I am trying to combine two picklist values from two different objects for selection on my vf page.

let's say, I have an object opportunity with Stage picklist

there is another object as "Order Intake" which is the child of opportunity; it has a picklist which says if the oif days are due by options:
10 days
20 days
30 days

I am creating a picklist for vf page as 'Select category' where I want options as Stage values + Order Intake values;
when I select the options it should display respective Order Intake or opportunity.

Please assist
Hello Community- seasoned Admin, but beginner developer here!

I'm building a Visualforce page that will serve as the default landing page for my Salesforce Community, and as a personal touch would like to display a nice welcome message and content that would render dynamically, based on who is logging in.  As far as merge fields go, I'm all set.

However where I'm getting stuck is to conditionally display a set of images stored in Documents, based on the Current User's value in the Company field({!$User.CompanyName}).

I've attempted to write logic using IF/ELSE IF/ELSE commands, however it's just not rendering correctly.  In short, here's what I'm trying to achieve:

If User's Company Name = 'Company 1', display Logo 1
If User's Company Name = 'Company 2', display Logo 2
..and so on..
...and so on...
....Else, display nothing

Thanks in advance for any suggestions you can provide!
Hi,

I am actually trying to deploy few custom fields from sandbox to production using an existing deployment connection.
But when I deploy i am getting the following error message.
"Your organization's code coverage is 0%. You need at least 75% coverage to complete this deployment. Also, the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage."

What is the reason for this?
should we rewrite/update the test class for the existing triggers?
I'm using the following code inside my custom chat agent window.

<liveAgent:clientChatQueuePosition label="People waiting" rendered="true" />

For some reason I get to see the label, but I don't see the queue position.

Any ideas?

Thanks!
hi guys i created a vf page,in which im getting the customer's signature on canvas, and saving that page as pdf in the realted list of attachment,
but problem is that the signature is not visible in pdf look into my code 

vf page

<apex:page controller="upl1" SHowHeader="false" sidebar="false" standardStylesheets="false" >
    
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <apex:stylesheet value="{!URLFOR($Resource.bootstrap,'bootstrap-3.3.6-dist/css/bootstrap.min.css')}"/>
    <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"/>
    <apex:includeScript value="{!URLFOR($Resource.bootstrap,'bootstrap-3.3.6-dist/js/bootstrap.min.js')}"/>
    
    </head>
        

    <body>  
            <div class="well well-lg text-center"><h1>Invoice</h1></div>
        
            <apex:form id="pbform">
          <apex:pageMessages />
          <div class="container1">
           <h1 class="labelCol vfLabelColTextWrap ">Record Signature:</h1>
           <canvas id="signatureCanvas" height="100px" width="350px" style="border: 3px solid antiquewhite; border-radius: 8px;" ></canvas>
          </div><br/>
          
          <div style="margin-left: 41%;">
           <apex:commandButton value="Save Signature" onclick="saveSignature();return false;" styleClass="button1"/>&nbsp;&nbsp;&nbsp;
           <apex:commandButton value="Clear" onclick="clearSign();return false;" styleClass="button1"/>
          </div>
       </apex:form>
       
        
        <apex:form >
            <apex:pageBlock >
                <apex:pageblockTable value="{!inv}" var="v" styleclass="table table-hover table table-box">
                    <apex:column headerValue="Product name">
                        <apex:outputField value="{!v.name}"/>
                    </apex:column>
                    <apex:column headerValue="Price">
                        <apex:outputField value="{!v.price__c}"/>
                    </apex:column>
                    <apex:column headerValue="Quantity">
                        <apex:outputField value="{!v.quantity__c}"/>
                    </apex:column>
                    <apex:column headerValue="Total">
                        <apex:outputField value="{!v.total_amount__c}"/>
                    </apex:column>
                </apex:pageblockTable>
            </apex:pageBlock>
            <div style="margin-left: 41%;">
            <apex:commandButton value="Generate pdf" action="{!gpdf}" styleClass="button1"/>
            </div>
        </apex:form>
    
    </body>
    <script>
  var canvas;
  var context;
  var drawingUtil;
  var isDrawing = false;
  var accountId = '';
  var prevX, prevY, currX, currY = 0;
  var accountId;

   function DrawingUtil() {
   isDrawing = false;
   canvas.addEventListener("mousedown", start, false);
   canvas.addEventListener("mousemove", draw, false);
   canvas.addEventListener("mouseup", stop, false);
   canvas.addEventListener("mouseout", stop, false);
   canvas.addEventListener("touchstart", start, false);
   canvas.addEventListener("touchmove", draw, false);
   canvas.addEventListener("touchend", stop, false);
   w = canvas.width;
      h = canvas.height;
  }

   function start(event) {
   event.preventDefault();
   
   isDrawing = true;
   prevX = currX;
   prevX = currY;
   currX = event.clientX - canvas.offsetLeft;
   currY = event.clientY - canvas.offsetTop;
   
   context.beginPath();
   context.fillStyle = "cadetblue";
   context.fillRect(currX, currY, 2, 2);
            context.closePath();
   
  }

   function draw(event) {
   event.preventDefault();
   if (isDrawing) {
    prevX = currX;
             prevY = currY;
             currX = event.clientX - canvas.offsetLeft;
             currY = event.clientY - canvas.offsetTop;
    context.beginPath();
    context.moveTo(prevX, prevY);
    context.lineTo(currX, currY);
    context.strokeStyle = "cadetblue";
    context.lineWidth = "2";
    context.stroke();
    context.closePath();
   }
  }

   function stop(event) {
   if (isDrawing) {
    context.stroke();
    context.closePath();
    isDrawing = false;
   }
  }
  
  function clearSign() {
   context.clearRect(0,0,w,h);
  }

   canvas = document.getElementById("signatureCanvas");
  context = canvas.getContext("2d");
  context.strokeStyle = "black";
  context.lineWidth = "2";
  drawingUtil = new DrawingUtil(canvas);
  

   function saveSignature() {
   var strDataURI = canvas.toDataURL();
   strDataURI = strDataURI.replace(/^data:image\/(png|jpg);base64,/, "");
   var accId = location.href.split('=')[1];
   accountId = accId;
   var result = CaptureSignatureController.saveSignature(strDataURI, accId, processResult);
  }

   function processResult(result) {
   alert(JSON.stringify(result));
   window.location.href = '/'+accountId;
  }

  </script>
  
  <style>
  .container1 {
   text-align: center;
   font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
   color: cadetblue;
   font-weight: 500;
   font-size: 14px;
  }
  
  .button1 {
   font-family: calibri;
   border-radius: 8px;
   background-color: rgb(51, 116, 116);
   height: 36px;
   color: azure;
   font-size: 17px;
   border-width: 0px;
   width: 116px;
  }
 </style>   
</apex:page>


controller


global with sharing class upl1 
{
    public List<cart__c> inv{get;set;}
    Id id;
    
    global upl1()
    {
        id=ApexPages.currentPage().getParameters().get('cid');
        inv=new List<cart__c>();
        inv=[select name,type__c,price__c,quantity__c,total_amount__c from cart__c where consumer__c=:id];
        
        
    }
    global static String saveSignature(String imageUrl, String accountId) 
 {
  
      try 
      {
       Attachment accSign = new Attachment();
       accSign.ParentID = accountId;
       accSign.Body = EncodingUtil.base64Decode(imageUrl);
       accSign.contentType = 'image/png';
       accSign.Name = 'Signature Image';
       accSign.OwnerId = UserInfo.getUserId();
       insert accSign;
       
       return 'success';
       
      }
      catch(Exception e)
      {
       system.debug('---------- ' + e.getMessage());
       return JSON.serialize(e.getMessage());
      }
  return null; 
 }
   
 
    public String rt{get;set;}
    public PageReference gpdf()
    {
       rt='pdf';
       attach();
        PageReference reRend2 = new PageReference('https://ap2.salesforce.com/'+id);
                                  reRend2.setRedirect(true);
                                   return reRend2;  
    }
    public void attach() 
        {
        Attachment myAttach = new Attachment();
        myAttach.ParentId = id;//Id of the object to which the page is attached
        myAttach.name = 'inv.name.pdf';
        PageReference myPdf = Page.task7i;//myPdfPage is the name of your pdf page
        myAttach.body = myPdf.getContentAsPdf();
        insert myAttach;
        
        }

}User-added image


User-added image
 
All,
We have contacts that are Customer Community Users at Parent Accounts. These parent accounts have child accounts (using the standard Parent Account field we lookup to the Parent Account from the Child Account).

What is the best way to expose the cases for the community users that are at the Parent Account so that they see the cases created by users in the Child Accounts? There are lots of discussions on this for the old Customer Portal... but thing's have changed for the Community.