• Pan_AK
  • NEWBIE
  • 50 Points
  • Member since 2011

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

Hello:

   I'm scratching my head on this one, probably obvious to many but I can't figure out what's wrong. Eclipse is giving me this error:

 

"Save error: Invalid field stage for SObject Opportunity" line 9

 

Sales_Commission and Accounting are both children to Opportunity, but I couldn't address the Accounting object without a SOQL query. I guess that's the right way to do it?

 

  The code looks like this: (and thx for the help)

 

trigger ClosedWonOpportunity on Opportunity (After Insert, After Update) {
   List <Opportunity> opps = Trigger.new;
   List <Sales_Commission__c> scs = new List<Sales_Commission__c>();
   For (Opportunity opp : trigger.new) {
       if ((opp.stage == 'Closed Won') || (opp.stage == 'Closed Won - Quickpay')
           ||(opp.stage == 'Closed Won 50%')) {
               Sales_Commission__c cs = new Sales_Commission__c();
               sc.Opportunity__c = opp.Name;
               if (opp.stage == 'Closed Won') {
                   sc.Sale_Amount__c = [select Recognized_Amount__c from Accounting__c where
                     Opportunity__r.Name = :opp.name].Recognized_Amount__c;
                     .
                      .
                       .
                      
               }
           scs.add(sc);
           }
   }
   insert(scs);
}

Hi

 

Is it possible to add Customer portal users to self register themselves and add as contacts of the account id passed as parameter. 

 

I know that we can hardcode Account ID in SiteRegisterController Apexclass to assign all the self register contacts to that account, but is it possible to add them dynamically to different accounts passed as parameter?

Hi,

 

Just want to ask if the assigning of OwnerId to a record in Custom Object will affect the license limit of certain user?

I have this case that the owner id of the custom object was set to Inactive, the reason why it cannot attach a file. What i did is that I temporary assign the owner id of these records to an active account like System Administrator. I also created a trigger that once the 'real' owner of these records becomes Activated, it will automatically update the Owner Id back to the real owner. I just want to upsert some files even though the owner is still Inactive user.

Example:

CustomObject. has the following records:

Id = 1 OwnerId = System Administrator

Id = 2 OwnerId = System Administrator

Id = 3 OwnerId = System Administrator

 

Now,my question is, will this have an effect to the license limit of the System Administrator account?

 

Your answers will really help a lot.

 

Thanks!!!

  • November 15, 2011
  • Like
  • 0

Hello:

   I'm scratching my head on this one, probably obvious to many but I can't figure out what's wrong. Eclipse is giving me this error:

 

"Save error: Invalid field stage for SObject Opportunity" line 9

 

Sales_Commission and Accounting are both children to Opportunity, but I couldn't address the Accounting object without a SOQL query. I guess that's the right way to do it?

 

  The code looks like this: (and thx for the help)

 

trigger ClosedWonOpportunity on Opportunity (After Insert, After Update) {
   List <Opportunity> opps = Trigger.new;
   List <Sales_Commission__c> scs = new List<Sales_Commission__c>();
   For (Opportunity opp : trigger.new) {
       if ((opp.stage == 'Closed Won') || (opp.stage == 'Closed Won - Quickpay')
           ||(opp.stage == 'Closed Won 50%')) {
               Sales_Commission__c cs = new Sales_Commission__c();
               sc.Opportunity__c = opp.Name;
               if (opp.stage == 'Closed Won') {
                   sc.Sale_Amount__c = [select Recognized_Amount__c from Accounting__c where
                     Opportunity__r.Name = :opp.name].Recognized_Amount__c;
                     .
                      .
                       .
                      
               }
           scs.add(sc);
           }
   }
   insert(scs);
}

Hello. I have this piece of code where I am searching through a web service callout some objects. I want to import to salesforce multiple results at a time and I am saving them in a Map<key, myObject>.

After adding over 100 objects to the map i get the viewstate limit error and I am not showing this map in the vf page. I am using it in the controller to store my objects before the import process.

Any suggestions how could i solve this?

Hi

 

Is it possible to add Customer portal users to self register themselves and add as contacts of the account id passed as parameter. 

 

I know that we can hardcode Account ID in SiteRegisterController Apexclass to assign all the self register contacts to that account, but is it possible to add them dynamically to different accounts passed as parameter?

I want check country account this page is match country visited object. But it not work not show when click save

 

 

public PageReference save()
    {
    
    Account AccS = [Select id,Country__c from Account Where id =: objCus[0].AccountID__c];
    String CountryName = Accs.Country__c;
    Boolean CheckCountry = False;
    List<Country_Visited__c> lstCRV = [Select id,Name from Country_Visited__c Where Customer_Visit_ReportID__c =:    objCus[0].Customer_Visit_ReportID__c];
    
    for(Country_Visited__c CRV : lstCRV){
        if(CRV.Name == CountryName){
            CheckCountry = True;
        }
    }
    
    if(CheckCountry == True){
      
        if(objCus.size()>0)
        {  
            CountryVisited();      
            
            List<Customer_Visited__c > lstCV = [Select id from Customer_Visited__c Where AccountID__c =: objCus[0].AccountID__c];
            
            objCus[0].Nums__c = lstCV.size();        
            insert objCus;
            CusID = objCus[0].id;
            
            
        }
        insertExistingProduct(); 
        insertNewProduct();
        insertTask();
        CreateOpportunity();       
        
        return Cancel();
        }
        showmessage = 'True';
        return null;
    }
    
    public string showmessage
    {
        get;set;
    }

 Page 

 

<apex:pageBlock id="pageBlock" mode="edit">
        <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"   rerender="error" onclick="showmsg()"/>
                <apex:commandButton value="Cancel" action="{!Cancel}" rerender="error"/>                                           
        </apex:pageBlockButtons>
</apex:pageBlock>


<script> 
function showmsg(){
if('{!showMessage}'=='True'){

    alert('your message!'); 
    return false;

}
}
</script> 

 Thank so much.

I'm trying to run a subquery on my query for a custom object to get it's public and and private tags.

 

I can't find any documentation about using this relatinoship, but I've activated tagging, and I can query for 'SObjectName__Tag' just fine - I would just prefer not to have to match them up afterward to speed things up on my object creation:

 

So I'm trying to figure out - I know this is syntactically not correct but hoping it will inspire someone to help me fix my mistakes!

 

List<SObject> customObjectListWithTags = [SELECT Id,Name, (SELECT Id,Name FROM CustomObject__Task) FROM CustomObject__c];

 Thanks...

For Sites development, there's a Site object with a getName() method that lets you dynamically get the name of the site in which your code is running, which is useful if you have some apex code that runs in the context of multiple sites but might need to do something slightly different depending on context.

 

There does not appear to be an equivalent method for code running in either the Customer or Partner Portal, and the method on the Site object returns and empty string. 

 

Does anyone know of how to find the name of the portal in which one's code is running?  (basically, you want to ask the Saleforce Context, "hey, what portal am I being accessed through?")

  • November 11, 2011
  • Like
  • 0

Hello. We are using the non-profit starter pack, and would like to send each donor (aka Contact) an email listing all of their donations (Opportunities) so far this year. I was told that I'd need to create a Visual Force email template to do this. I'm new to VF, but I do have experience with other programming languages, so just need some help getting started. 

 

Can someone please point me to an example of how to include a list of donations (aka Opportunities) as a merge field in the body of a mass email? 

 

Thanks in advance,
 

David



Doing a project for a customer, and they have a login-enabled site.  We're trying to use the Public Knowledge Base AppExchange package with this site, but the CSS keeps having issues.  In doing some research and reviewing the generated HTML for the pages, it's apparent that the Site is including the following snippet in every page if the site is login-enabled.  This is not including the fact that the user is still anonymous when browsing as well (the anonymous users are being forced to inherit this CSS as well).

 

<link class="user" href="/sCSS/23.0/1320195876000/PortalDefault/default/gc/elements.css" rel="stylesheet" type="text/css" />

<link class="user" href="/sCSS/23.0/1320195876000/PortalDefault/default/gc/common.css" rel="stylesheet" type="text/css" />

<link class="user" href="/sCSS/23.0/1320195879000/PortalDefault/gc/dStandard.css" rel="stylesheet" type="text/css" />

<link class="user" href="/sCSS/23.0/1320195879000/PortalDefault/00DV00000000Uh4/00530000004j8Yx/gc/dCustom0.css" rel="stylesheet" type="text/css" />

<link class="user" href="/sCSS/23.0/1320195876000/PortalDefault/default/gc/extended.css" rel="stylesheet" type="text/css" />

<link class="user" href="/sCSS/23.0/1320352245000/PortalDefault/00DV00000000Uh4/060V0000000D0Ua/gc/portal.css" rel="stylesheet" type="text/css" />

<link class="user" href="/sCSS/23.0/1320195876000/PortalDefault/default/gc/setup.css" rel="stylesheet" type="text/css" />

 

How do I make it so that this is not happening?  We include these attributes in all the VF pages and templates for the Site:

  • showHeader="false"
  • sidebar="false"
  • standardStyleSheets="false"

 

But it doesn't seem to respect that if the site is login-enabled.  When I disable the login functionality for the site, teh CSS fo rthe portal is not included, but other standard CSS is.

 

Has anyone run into this with Sites, and if so, how do you overcome it?

 

 

Hi,

 

I have to write a apex class in Database.com to migrate account object records from Force.com edition to Database.com edition using Rest API.

 

Kindly provide me some sample Rest API apex classes for the above scenario.

 

Thanks in advance,

MVP

  • October 15, 2011
  • Like
  • 0