• boihue
  • NEWBIE
  • 50 Points
  • Member since 2008

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

Hi,

I have two objects Department and Employee that is joined to Department object with the DeptID field (1 Department can have 0 or n Employees but the Employee object is not the Related list of Department). I want to write a trigger when deleting the any Department then all Employees of this Department will also be deleted. I want to use the Bulk Delete (or Cascade Delete) method to avoid the Governor limit of Salesforce. All helps will be appreciated.

Thanks and best regards

  • September 25, 2009
  • Like
  • 0

Hi,

 

When I click on the Object Tab, the first list displayed will be the Object Recent layout, I would like to know how to modify this layout to add the desired fields (By default, there's only the Name column of this object).

 

Best regards

  • August 31, 2009
  • Like
  • 0

Hi,

I had to override a standard button in the Opportunity page by using the S-Control HTML. When clicking on this standard button, I wanted to popup a warning message to the users then redirected them back to the Opportunity main page after the users click on the OK button. Here are my codes:

 

<HTML>

<Script Language="Javascript">

function initPage() {
    var sURL = "/006/o";

    alert("Warning message");
    window.location = sURL;
}
</Script>
</HEAD>
<BODY onLoad=initPage()>
</BODY>
</HTML>

 

The system redirected the users back to the Opportunity main page but this Opportunity page was displayed inside the principal Opportunity main page. Could any expert tell me how to fix this redirecting issue?

Best regards!

Message Edited by boihue on 03-20-2009 08:14 AM
  • March 20, 2009
  • Like
  • 0

Hi,

I would like to ask if any expert know how to develop the Lookup button in the Visualforce Page. Thanks!

Best regards

 

  • February 26, 2009
  • Like
  • 0

Hi experts,

I have completed a new Visualforce Page and its controller and I am planning to deploy these changes to the production but I have encountered an issue in my Test Method module. I hope to get some helps from you.

 

Here are some lines of codes from my Controller:

 

public class OpportuniteProduitController {

       private final ApexPages.StandardController controller;

    

     public Boolean bValue {

        get {

                 return bValue;

        }

          set;

    }

 

     public String ProductName {

        get {

                 return sProdName;

        }

          set;

    }

      public String getTextStyle()

    {

          return 'color:blue; font-weight:bold; font-size:small';

    }

    ........

}

Here are the codes from my Test Method module:

 

 

public class OpportuniteProduitTest

{

    public static testMethod void OpportuniteProduitTest()

   {

        PageReference pageRef = new PageReference('Page.OpportuniteProduitPage');

        Test.setCurrentPage(pageRef);

 

       

        OpportuniteProduitController controller = new OpportuniteProduitController( null );

 

       

        controller.bValue();

        controller.ProductName();

        controller.getTextStyle();

 

        controller.Save();

        controller.Cancel();

    }

}

 

I always got the errors from the two following lines when I wanted to save the codes in IDE. What is the correct syntax should I use in this case?

        controller.bValue();

        controller.ProductName();

 

Best regards!

 

 

Message Edited by boihue on 01-30-2009 08:09 AM
  • January 30, 2009
  • Like
  • 0

Hi,

I always see the following instruction in the codes "/setup/ui/recordtypeselect.jsp". I would like to know what this file does for, where this file is and how to see the content of this file.

Best regards!

  • January 28, 2009
  • Like
  • 0
Hi,
Do any expert know how to display a Visualforce Page in a new separated Window when clicking from a button of the current page?
Best regards!
  • January 12, 2009
  • Like
  • 0
Hi,
I want to override (replace) the process of the Standard button of an Object with a new Visualforce Page, but when I click on the Override action of this button then select the Visualforce Page option and I didn't see any available Visualforce Page. I have already successfully created a new Visualforce Page and I really saw it in the Salesforce system. Do any expert have any idea how to make this Visualforce Page available for this Object?
Best regards!
  • January 08, 2009
  • Like
  • 0
Hi,
I am developing a new Visualforce Page using the Extensions option on a new Apex Controller named OpportunityProductController. In this Visualforce Page, I'm using the apex:inputField for a Picklist field (Section__c). In the Save function of the OpportunityProductController Apex Controller how can I retrieve the value of this Section__c Picklist that was selected by the user? I need to save this value into another Custom object that's why I need to retrieve its value. Is there any Apex component that we can use for having a Calendar like the apex:inputField based on the Date field of Salesforce object?
 
Code:
<apex:page standardController="OpportunityLineItem" extensions="OpportunityProductController" title="Product" tabStyle="Opportunity">
  <apex:sectionHeader title="Opportunity / Product">
    <apex:form>
        ...     
        <apex:inputField id="cwSection" value="{!OpportunityLineItem.Section__c}" />
        <apex:inputField id="cwService" value="{!OpportunityLineItem.ServiceDate}" />
        ...
    </apex:form>
  </apex:sectionHeader>
</apex:page>
 
 
public class OpportunityProductController {
 
    public PageReference Save()
    {
      // Apex Codes (Retrieving of Section__c value)
    }
}


 
Thanks for the help!
Boi Hue
  • January 06, 2009
  • Like
  • 0
Hi,
I would like to know if there's a way to display five OutputLabel or inputText at the same line.
Best regards,
Boi Hue
  • December 23, 2008
  • Like
  • 0
Hi,
I knew that the Apex trigger can display the Error message to the salesforce users, but is it possible to also display the Success message to the user from Apex trigger? If not, is it possible to execute the JavaScript codes from the Apex trigger?
Thanks for your help!
Boi Hue
  • December 15, 2008
  • Like
  • 0
Hi experts,
I found a Salesforce object named OpportunityContactRole by using the IDE (Eclipse) and I want to add a new trigger for this object but I got the following Error message when try to save the new created trigger:
    Save error: SObject type does not allow triggers: OpportunityContactRole
I really need to add the special processing to this object before updating, do any experts have any idea how to fix this issue?
Best regards!
Boi Hue


Message Edited by boihue on 12-09-2008 11:02 AM

Message Edited by boihue on 12-09-2008 11:02 AM
  • December 09, 2008
  • Like
  • 0
Hi Experts,
I would like to code for a new button in Visualforce Page that will direct me to an Opportunity (in Edit mode) with some fields automatically filled up using the information passing as parameters from my calling Visualforce Page. Please help!
Best regards,
Boi Hue
 
  • December 04, 2008
  • Like
  • 0
Hi experts,
 
I would like to know how to fire an action (Execution of a function in the Custom Controller class) everytime the user click on any option of the Radio button.
 
Best regards,
Boi Hue
 
  • November 27, 2008
  • Like
  • 0
Hi,
Could any expert show me how to use VB .NET for retrieving the data from both joined Account and Contact tables? I can retrieve the data from the Account table but I don't know how to retrieve the Contact data. Here're my codes:
 
Dim qr As QueryResult = Nothing
binding.QueryOptionsValue = New apex.QueryOptions
binding.QueryOptionsValue.batchSize = 250
binding.QueryOptionsValue.batchSizeSpecified = True
 
Try
    qr = binding.query("Select a.Id, a.Name, (Select c.Id, c.firstname, c.lastname From a.Contacts c) From Account")
    Dim bContinue As Boolean = True
    Dim loopCounter As Integer = 0
    While bContinue
        loopCounter += 1
        For i As Integer = 0 To qr.Records.GetUpperBound(0)
            Dim acct As Account = CType(qr.records(i), Account)
            Dim sId As String = acct.Id
            Dim sName As String = acct.Name
 
            Console.WriteLine("Contact " & (i + 1) & ": " & sId & " " & sName)
        Next
 
        If qr.done Then
            bContinue = False
        Else
            qr.binding.queryMore(qr.queryLocator)
        End If
    End While
 
If there's any way to retrieve the data from both joined tables, it would be appreciated.
 
Best regards!
  • November 04, 2008
  • Like
  • 0
Hi,
After installing the Excel connector, now from Excel I can only connect to the Salesforce Production environment. Does any expert know how to change the connection if I want to connect to my Sandbox environment?
Best regards!
  • October 24, 2008
  • Like
  • 0
Hi,
Does any expert know how to set the focus to a specified field in the Visualforce Page?
Best regards!
  • October 23, 2008
  • Like
  • 0
Hi,
In the new version 9 of Salesforce, we can use the new features of Custom Label in the Apex Codes and Visualforce Pages. I knew how to use this new Custom Label in my Visualforce Pages but could any expert show me a sample how to use this new Custom Label in the Apex Codes.
Best regards,
Boi Hue
  • October 15, 2008
  • Like
  • 0
Hi,
 
I would like to know if we can create in Salesforce any scheduled task that runs daily at a specified time, the same as the Scheduled tasks in Windows or the Cronjob in Unix.
 
Best regards!
  • October 08, 2008
  • Like
  • 0
Hi,
I have a trigger having a command for retrieving all records from the Account object that respond to some conditions as follow:
     Account[] accountList = [select name from account where id = :idAnnonceur or id = :idAgence];
 
In some cases, the number of returned records from this object are more than 20 so Salesforce returned an error message as follow:
     UpdateRelation: execution of BeforeUpdate caused by: System.Exception: Too many SOQL queries: 21
 
It seems that Salesforce is limited the Update transactions to Max 20. Is there any way to bypass this limit?
Regards!
  • September 26, 2008
  • Like
  • 0

Hi,

 

When I click on the Object Tab, the first list displayed will be the Object Recent layout, I would like to know how to modify this layout to add the desired fields (By default, there's only the Name column of this object).

 

Best regards

  • August 31, 2009
  • Like
  • 0

Hi,

I had to override a standard button in the Opportunity page by using the S-Control HTML. When clicking on this standard button, I wanted to popup a warning message to the users then redirected them back to the Opportunity main page after the users click on the OK button. Here are my codes:

 

<HTML>

<Script Language="Javascript">

function initPage() {
    var sURL = "/006/o";

    alert("Warning message");
    window.location = sURL;
}
</Script>
</HEAD>
<BODY onLoad=initPage()>
</BODY>
</HTML>

 

The system redirected the users back to the Opportunity main page but this Opportunity page was displayed inside the principal Opportunity main page. Could any expert tell me how to fix this redirecting issue?

Best regards!

Message Edited by boihue on 03-20-2009 08:14 AM
  • March 20, 2009
  • Like
  • 0

Hi,

I would like to ask if any expert know how to develop the Lookup button in the Visualforce Page. Thanks!

Best regards

 

  • February 26, 2009
  • Like
  • 0

Hi experts,

I have completed a new Visualforce Page and its controller and I am planning to deploy these changes to the production but I have encountered an issue in my Test Method module. I hope to get some helps from you.

 

Here are some lines of codes from my Controller:

 

public class OpportuniteProduitController {

       private final ApexPages.StandardController controller;

    

     public Boolean bValue {

        get {

                 return bValue;

        }

          set;

    }

 

     public String ProductName {

        get {

                 return sProdName;

        }

          set;

    }

      public String getTextStyle()

    {

          return 'color:blue; font-weight:bold; font-size:small';

    }

    ........

}

Here are the codes from my Test Method module:

 

 

public class OpportuniteProduitTest

{

    public static testMethod void OpportuniteProduitTest()

   {

        PageReference pageRef = new PageReference('Page.OpportuniteProduitPage');

        Test.setCurrentPage(pageRef);

 

       

        OpportuniteProduitController controller = new OpportuniteProduitController( null );

 

       

        controller.bValue();

        controller.ProductName();

        controller.getTextStyle();

 

        controller.Save();

        controller.Cancel();

    }

}

 

I always got the errors from the two following lines when I wanted to save the codes in IDE. What is the correct syntax should I use in this case?

        controller.bValue();

        controller.ProductName();

 

Best regards!

 

 

Message Edited by boihue on 01-30-2009 08:09 AM
  • January 30, 2009
  • Like
  • 0

Hi,

I always see the following instruction in the codes "/setup/ui/recordtypeselect.jsp". I would like to know what this file does for, where this file is and how to see the content of this file.

Best regards!

  • January 28, 2009
  • Like
  • 0
Hi,
Do any expert know how to display a Visualforce Page in a new separated Window when clicking from a button of the current page?
Best regards!
  • January 12, 2009
  • Like
  • 0
Hi,
I am developing a new Visualforce Page using the Extensions option on a new Apex Controller named OpportunityProductController. In this Visualforce Page, I'm using the apex:inputField for a Picklist field (Section__c). In the Save function of the OpportunityProductController Apex Controller how can I retrieve the value of this Section__c Picklist that was selected by the user? I need to save this value into another Custom object that's why I need to retrieve its value. Is there any Apex component that we can use for having a Calendar like the apex:inputField based on the Date field of Salesforce object?
 
Code:
<apex:page standardController="OpportunityLineItem" extensions="OpportunityProductController" title="Product" tabStyle="Opportunity">
  <apex:sectionHeader title="Opportunity / Product">
    <apex:form>
        ...     
        <apex:inputField id="cwSection" value="{!OpportunityLineItem.Section__c}" />
        <apex:inputField id="cwService" value="{!OpportunityLineItem.ServiceDate}" />
        ...
    </apex:form>
  </apex:sectionHeader>
</apex:page>
 
 
public class OpportunityProductController {
 
    public PageReference Save()
    {
      // Apex Codes (Retrieving of Section__c value)
    }
}


 
Thanks for the help!
Boi Hue
  • January 06, 2009
  • Like
  • 0
How do I create a controller, usually it is to the right of the Page Editor select button when developing but it no longer exists, where do I go to create the controller?

Thanks!! I am new at developing so I may have more questions, is there anyway some one could send me there email address and maybe we can work out something for some help? It would be much appreciated!!

Rye
I am trying to use the code below to assign the value from an inputfield into a variable within my controller to then use that value in a query.  Please could someone tell me what I need to enter to assign that data

Page
<apex:inputField value="{!emp2.Paynumber__c}" id="PaySearch" /> <p/> 

Controller
public class EmployeeList {

String PayN = '15154';

    public PageReference update1() {
        PayN = {!$component.PaySearch);
        return null;
    }
  • December 30, 2009
  • Like
  • 0
Hi,
I would like to know if there's a way to display five OutputLabel or inputText at the same line.
Best regards,
Boi Hue
  • December 23, 2008
  • Like
  • 0
Case 1 --- ABC__c  a = [select a.Id, a.name from A where a.label = 'apex'];

Case 2 --- List <ABC__c> a = [select a.Id, a.name from A where a.label = 'apex'];


In case of Case 1 , if there is no matching record then it throws an exception when run (no row assigned to Sobject) whereas Case 2 does not throw an exception.

For now I am using syntax of Case 2 in my coding but how can I make the code (Case 1) more efficient without having to use a list as defined in Case 2.

I need to use this in many places, any help would be appreciated.



thanks,
kathyani



I am consolidating my Force.com Developer pdf Library and I can't find the Apex Developer's Guide for Winter 09. Is it not available yet?
I found the Apex Language Reference for Winter 09, and the Visualforce Developer's Guide for Winter 09, but not the Apex Developer's Guide.
Was it supplanted by the Force.com Developer's Guide?
I have a custom field on the contact record that needs to be updated once a year to summarize YTD and Prior Year activity.  I can't use the standard SF rollup fields because it is not possible to dynamically specify the "current year" in the calculation.  I also can't hard-code the current year because the field is part of a package and I don't want to force users to install a new package at the start of every year.  Note that a trigger maintains the YTD/Prior Year activity fields on an ongoing basis.  The bulk update is used at the beginning of a new year to essentially move the YTD amount to the Prior Year field and reset the YTD field to 0.

I've thought through/tried a few solutions but none of them are viable/palatable:
  1. Use VisualForce to create a page with a button that would initiate the mass-update via an @future Apex method.  Good in concept but I'll quickly run into governor limits.
  2. Use the VisualForce/button solution and have the user initiate the update multiple times, biting off chunks of the data each submission that will fall under the governor limits.  Not a practical solution from a user interface perspective.
  3. Use an s-control and make multiple API calls that are within the governor limits.  This would work but it feels wrong to rely on the browser to perform a bulk-update
I couldn't find any other posts on this issue but I suspect others have faced this.  Has anyone else come up with a solution to this challenge that they can share?

Thanks...




  • December 09, 2008
  • Like
  • 0
Hi experts,
I found a Salesforce object named OpportunityContactRole by using the IDE (Eclipse) and I want to add a new trigger for this object but I got the following Error message when try to save the new created trigger:
    Save error: SObject type does not allow triggers: OpportunityContactRole
I really need to add the special processing to this object before updating, do any experts have any idea how to fix this issue?
Best regards!
Boi Hue


Message Edited by boihue on 12-09-2008 11:02 AM

Message Edited by boihue on 12-09-2008 11:02 AM
  • December 09, 2008
  • Like
  • 0
Hi,

I've built a matrix of PageBlockTables with a bunch of values in the columns and the totals in the header. Now for the problems:
  • How do I format the header? None of my efforts to get the column header to align on the right hand side of the column has had any effect.
  • How do I display a currency symbol in the header?
Code:
<apex:facet name="header">&euro;{!totalCAssets}</apex:facet>
OR 
<apex:column style="text-align:right" headerstyle="text-align:right" width="25%" headerValue="&euro;{!totalCAssets}">

didn't work. It simply displays the string "&euro;

Still trying to work out a few other issues I'm experiencing, but those would be a great help already!

Thanks for your help!
Marc

I have a text formula to which I would like to add a carriage return/line break.  I tried concatenating chr(13) and chr(10), but the validation didn't like it.  Is this possible?