• sparc1.3696571782628958E12
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 4
    Replies

Hi All

 

I have an object named "Business_Unit__c" in which I am having the Standard Name field that equals to the name of my "Business Unit" (hereafter mentioned as BU) and initially I have 1 Text Field that would contain the name of my "Sub-Business Unit" (hereafter mentioned as SBU).

 

Functionally a BU can contain more than one SBU.

 

So what I require is that there should be a CustomLink that should say "Add another SBU"  (Just like you say add another Attachment in gmail). 

 

On click of this Link, dynamically another text field should appear along with a label that says "SBU#2" and this should occur again and again likewise for dynamically adding "SBU#3", "SBU#4", ....... and so on.

 

At the end of my Page I want a "SAVE" button that should create as many text fields as are there, and save the record in my Custom Object "Business_Unit__c".

 

PLEASE HELP... ITS URGENT...

 

Thanks in Advance

Shiv

Hi All

 

I have two selectlists. One Named BU and other is the SBU.

 

My SBU selectlist is dependent on the values of BU selectlist.

 

Following is the visualforce page code:

 

   <apex:outputLabel value="Select BU : " title="Select BU" >
                </apex:outputLabel>                            

                <apex:selectList value="{!BUOptions}" size="1" id="BUs">
                    <apex:selectOptions Value="{!Items}"></apex:selectOptions> 
                    <apex:actionSupport event="onchange" reRender="SBUs,ReportType"/>

                </apex:selectList>
            <br/>
                <apex:outputLabel value="Select SBU : " title="Select SBU">
                </apex:outputLabel>                            
                
                <apex:selectList value="{!SBUOptions}" size="1" id="SBUs" >
                    <apex:selectOptions Value="{!SBUItems}"></apex:selectOptions> 
                </apex:selectList>

 

Controller for the above is as follows:

 

public List<SelectOption> getItems() {
          List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('None','--- None ---'));
            options.add(new SelectOption('ALL','ALL'));
            options.add(new SelectOption('CMH','CMH'));
            options.add(new SelectOption('FIS','FIS'));
            return options;
    }

    public List<SelectOption> getSBUItems()
    {
        List<SelectOption> options = new List<SelectOption>();
        if(BUOptions == 'FIS')
        {   
            options.add(new  SelectOption('CONSOLIDATED','CONSOLIDATED'));    
            options.add(new SelectOption('FIS-Asia','FIS-Asia'));
            options.add(new SelectOption('FIS-Europe','FIS-Europe'));
   
        }
        else if(BUOptions == 'CMH')
        {       
            options.add(new SelectOption('CONSOLIDATED','CONSOLIDATED'));    
            options.add(new SelectOption('CMH-E','CMH-E'));
            options.add(new SelectOption('CMH-HC','CMH-HC'));
        }
else { options.add(new SelectOption('--- None ---','--- None ---')); } return options; }

 

 

Now I also have a button on my Visualforce page and an OutputLabel.

 

The Output Label has to simply display the contents of SBU Selectlist.

 

 <apex:commandButton title="Go" value="Go" />
            <apex:outputLabel value="{!SBUOptions}" title="Output" id="displaySBU"/>

 

Initially when I open my page, both BU and SBU selectlist values have "--- None ---".

 

I select a BU. Corresponding SBU values get rendered. I then select a SBU value.

 

************* EVERYTHING WORKS FINE UPTILL THIS POINT **********

 

But as soon as I click my button, I guess the page gets re-rendered or god knows what, but the

 

1.  BU remains the same what I had selected.

2.  Whatever might be the value of BU, the SBU value becomes "CONSOLIDATED".

 

and my Output Label shows "--- None ---"

 

*******************************************************************************

 

I WANT MY OUPUT LABEL TO SHOW THE VALUE OF SBU SELECTLIST.

 

PLEASE HELP.

 

Thanks in Advance

Shiv

Hi All

 

At present when I am exporting or taking a printable view of any report, the downloaded file is named as say for ex: "report1369745790672".

 

I want to give some meaningful name to it while exporting itself. I do not wish to manually rename it post its download.

 

Is it possible through apex?

 

Please help. URGENTLY REQUIRED.

 

Thanks

Shiv

Hi All

 

I am Working in the QA Sandbox Environment.

 

I have the Administrator profile(Dont know if this information is required). I Scheduled my Dashboard to be mailed to me at 8:00 PM, but I didnt receive it.

 

I thought it could be because of the Time Zone issue. I have my time zone set to +5:30 (Asia/Calcutta) IST.

 

First of all I'll like to have a clear understanding as to, according to which Time Zone are the Dashboards scheduled for mailing. If these are scheduled according to PST, I should have received my Dashboard by somewhere around 8:00 AM the next day. Still nothing.

 

Could it be because of the fact that I am working in Sandbox???

 

Please help.

 

Thanks in Advance!

Shiv

Hi All

 

I wish to delete records from my Opportunity Object based on a criteria, i.e. for those where Amount < 500000.

 

I wish to schedule this such that this deletion automatically takes place on every specific date ( say 1st of every month).

 

Thanks in Advance!!!

 

Shiv

Hi All

 

I have a custom field named "Unit__c" in Accounts (standard object). I have a similar field "Unit__c" in Opportunity as well.

 

I now have a custom field named "Account_Name__c" in Opportunity (Not using the standard lookup, relating my Opportunity to Accounts for the fact that, Apex Data Loader requires the 15 digit ID while inserting, which I dont have in my .CSV file before hand).

 

What I want to do is that once I get the Account Name in my custom text field "Account_Name__c" in the Opportunity object, I wish to compare the text value with the Account Name value for those present inside the Standard Account Object. If the value is found, I want to return the corresponding "Unit__c" value for that account to the "Unit__c" value inside the opportunity. 

 

For this I have written the following trigger code:

 

trigger setUnit on Opportunity (Before Insert, Before Update) {

for(Opportunity o:trigger.new)
    {
    string Acct_Name = o.Account_Name__c;
    
    List<Account> acc = [SELECT Name,Unit__c FROM Account WHERE Name=:Acct_Name];
        
    if(acc.size() > 0 && acc[0].Unit__c <> NULL)
            o.Unit__c = acc[0].Unit__c;        
    }

}

The code for the trigger works fine when I am creating new opportunities inside salesforce.

 

But, when I insert multiple records through APEX Data Loader, it throws System.LimitException: Too many SOQL queries: 101 error.

 

Please help asap.

Hi All

 

I have an object named "Business_Unit__c" in which I am having the Standard Name field that equals to the name of my "Business Unit" (hereafter mentioned as BU) and initially I have 1 Text Field that would contain the name of my "Sub-Business Unit" (hereafter mentioned as SBU).

 

Functionally a BU can contain more than one SBU.

 

So what I require is that there should be a CustomLink that should say "Add another SBU"  (Just like you say add another Attachment in gmail). 

 

On click of this Link, dynamically another text field should appear along with a label that says "SBU#2" and this should occur again and again likewise for dynamically adding "SBU#3", "SBU#4", ....... and so on.

 

At the end of my Page I want a "SAVE" button that should create as many text fields as are there, and save the record in my Custom Object "Business_Unit__c".

 

PLEASE HELP... ITS URGENT...

 

Thanks in Advance

Shiv

Hi All

 

At present when I am exporting or taking a printable view of any report, the downloaded file is named as say for ex: "report1369745790672".

 

I want to give some meaningful name to it while exporting itself. I do not wish to manually rename it post its download.

 

Is it possible through apex?

 

Please help. URGENTLY REQUIRED.

 

Thanks

Shiv

Hi All

 

I have a custom field named "Unit__c" in Accounts (standard object). I have a similar field "Unit__c" in Opportunity as well.

 

I now have a custom field named "Account_Name__c" in Opportunity (Not using the standard lookup, relating my Opportunity to Accounts for the fact that, Apex Data Loader requires the 15 digit ID while inserting, which I dont have in my .CSV file before hand).

 

What I want to do is that once I get the Account Name in my custom text field "Account_Name__c" in the Opportunity object, I wish to compare the text value with the Account Name value for those present inside the Standard Account Object. If the value is found, I want to return the corresponding "Unit__c" value for that account to the "Unit__c" value inside the opportunity. 

 

For this I have written the following trigger code:

 

trigger setUnit on Opportunity (Before Insert, Before Update) {

for(Opportunity o:trigger.new)
    {
    string Acct_Name = o.Account_Name__c;
    
    List<Account> acc = [SELECT Name,Unit__c FROM Account WHERE Name=:Acct_Name];
        
    if(acc.size() > 0 && acc[0].Unit__c <> NULL)
            o.Unit__c = acc[0].Unit__c;        
    }

}

The code for the trigger works fine when I am creating new opportunities inside salesforce.

 

But, when I insert multiple records through APEX Data Loader, it throws System.LimitException: Too many SOQL queries: 101 error.

 

Please help asap.