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

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 7
    Questions
  • 20
    Replies

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,
 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
Hi,
I have a javascript button on click event on opportunity object...it works well..
Now i want if stagename = 'ABC', only then it gets enable ...otherwise it should be hidden or greyed out...
any help will be appreciated...
Thanks in advance!!!
 
Hi all,

I am working on this since hours trying many code forms, trying with java script, with ajax, etc., without success.

For a special reason I am using two form tags in my Visualforce code.
I have the same case as here described:

https://salesforce.stackexchange.com/questions/8320/how-to-handle-two-form-tags-in-visualforce-page

My javascript code looks like this (this is one of my trials):
 
<apex:form >
             <script type="text/javascript">
                function grabExName(){
                  var ex = document.getElementById('optypage:cform:new_info').value;
                  alert(ex);
                }
             </script>
             <apex:actionFunction name="UpdateRelevantInformation" action="{!UpdateRelevantInformation}" reRender="out" oncomplete="grabExName();">
                <apex:param name="new_info" value="" />
             </apex:actionFunction>
        </apex:form>
This is in the "<body>" part of the code.

My commandbutton looks like this:
 
<apex:commandlink styleclass="btn btn-primary" id="new_info" value="Save new info" action="{!UpdateRelevantInformation}"  />

When I click that button it should let work the form with id "cform", so that when I click on the button, the functionality behind the action "UpdateRelevantInformation" should work.
Am I missing something here? because when I put the button on the second form, "UpdateRelevantInformation" doesn't do anything, but if I put the button in the first form, where the item Relevant Information should be updated, the button works.

I would appreciate your help.
 
Working on assignment where I'm getting the below error in fflib_SObjectDomain class.
Apex trigger AccountsTrigger caused an unexpected exception, contact your administrator: AccountsTrigger: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Class.fflib_SObjectDomain.triggerHandler: line 346, column 1

This line is 
Type constructableClass = domainClassName.endsWith('Constructor') ? Type.forName(domainClassName) : Type.forName(null,domainClassName+'.Constructor');
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?

Hai,

 

I have an issue with my javascript for treeview.The issue is that while I am selecting a single parent checkbox,then the entire child checkboxes of every parent node is also get checked.What is the issue with my javascript?

 

***script***

 

function checkAll(cb,cbid)
{

var inputElem = document.getElementsByTagName("input");

for(var i=0; i<inputElem.length; i++)
{
if(inputElem[i].id.indexOf(cbid) !=-1)
{
if(cb.checked)
{
inputElem[i].checked = true;

}
else
{
inputElem[i].checked = false;

}
}
}

}

 

*****VF page*****

 

<ul id="tree1" class="filetree">
<apex:repeat value="{!AllIndustries}" var="parent">
<li><span class="folder"><strong><input type="checkbox" id="checkInd1" name="{!parent.industries_level1_id}" value="{!parent.industries_level1_id}" onclick="checkAll(this,'checkInd2')"/>
<apex:outputtext style="color:blue;" escape="false" value="{!parent.industries_level1_name}"/></strong></span>
<ul>
<apex:repeat value="{!parent.industries_level2}" var="child">
<li><span class="folder">
<input type="checkbox" id="checkInd2" value="{!child.industries_level2_id}" />
<apex:outputtext style="color:green;" escape="false" value="{!child.industries_level2_name}"/></span>

</li>
</apex:repeat>
</ul>

</li>
</apex:repeat>
</ul>

what is the difference between "before update" and "after update"?

  • December 21, 2010
  • Like
  • 0

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;}
    }
    
}

Hello everyone!!

 

 

 

Is there any way to make a sharing of a record by a user who is not the owner of the record?

 

Thanks in advance!!

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.