• Liquid
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hi,

Our corporate website is generating leads to the SF platform through the meta API.

 

Why is chatter pushing notifications every time a lead has been created through the API? is there a way to disable this ?

 

Thanks in advance!

  • October 11, 2010
  • Like
  • 0

Hi,

Our corporation instance of salesforce enterprise has been updated to winter 11, however when I click on my user name and go to system log, the old system log appears.

 

What do I need to do in order to enable the new one?

 

Thanks in advance!

  • October 11, 2010
  • Like
  • 0

Hi Im trying to do something that sounds pretty simple to my clients...

Every quarter a new price book is generated, and sometimes they want to clone an existing PriceBook only with a different Currency + update the UnitPrice according to the exchange rate in the company's Currency table.

 

So this is what the client does, goes to a price book -> Creates a new price book from an existing one.

Goes to my SF page with the new pricebook ID in the QS, chooses the new currency and I would ideally want to change all the PriceBookEntry currency + unitprice.

 

In short, the error thrown at me is :

 

System.SObjectException: Field is not writeable: PricebookEntry.CurrencyIsoCode
Class.vfChangePriceBookEntriesCurrController.CommitChanges: line 43, column 9 External entry point

 

Here is my VF page:

 

 

 

 

<apex:page sidebar="false" controller="vfChangePriceBookEntriesCurrController">
    <apex:pageBlock title="{!pbName} change currency">
        <apex:form >
            <table style="width:100%">
                <tr>
                    <td>
                        Change currency to :
                    <apex:selectList id="CurrencyTo" style="width: 50px;" size="1" value="{!currencyTo}">
                        <apex:selectOptions value="{!allCurrencyISOOptions}"/>
                    </apex:selectList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <apex:commandButton value="Commit" Action="{!CommitChanges}" />
                    </td>
                </tr>
            </table>        
        </apex:form>
    </apex:pageBlock>
</apex:page>

 

 

 

 

 

And the controller: 

 

public with sharing class vfChangePriceBookEntriesCurrController {
    public String pbName                                                    {get;set;}
    private String pbID                                                     {get;set;}
    public Pricebook2 pb                                                    {get;set;}
    public List<SelectOption> allCurrencyISOOptions                         {get;set;}
    public List<CurrencyType> allCurrencysDB                                {get;set;}
	public String currencyTo 												{get;set;}
    public vfChangePriceBookEntriesCurrController()
    {          
        //get id from qs
        if(ApexPages.currentPage().getParameters().get('id') != '' && ApexPages.currentPage().getParameters().get('id') != Null)
                pbID = ApexPages.currentPage().getParameters().get('id') ; 
        pb = [Select p.Name, (Select UseStandardPrice, UnitPrice, SystemModstamp,
        						 ProductCode, Product2Id, Pricebook2Id, Name, LastModifiedDate,
        						 LastModifiedById, IsDeleted, IsActive, Id, CurrencyIsoCode, CreatedDate,
        						 CreatedById From PricebookEntries) From Pricebook2 p where Id =: pbID ]; 
        if (pb!=null)
        pbName = pb.Name;   
        allCurrencyISOOptions = new List<SelectOption>();
        allCurrencysDB = new List<CurrencyType>();
        allCurrencysDB = [Select c.IsoCode, c.ConversionRate From CurrencyType c where IsActive=true and IsCorporate=false];
        if (allCurrencysDB!=null && allCurrencysDB.size()>0)
        	{
        		for(CurrencyType c : allCurrencysDB)
                	allCurrencyISOOptions.add(new SelectOption(c.IsoCode,c.IsoCode));
        	}
        
    }
    public PageReference CommitChanges()
    {
    	System.debug('In commit!');
	    if (currencyTo!=null && currencyTo!='')
	    {
	    	system.debug('Currency: ' + currencyTo);
	    	double rate = 0.0;
	    	for (CurrencyType ct : allCurrencysDB)
	    		if (ct.IsoCode == currencyTo)
	    			rate = ct.ConversionRate;
	    	if (rate!=0.0 && pb.PricebookEntries.size()>0)
	    	{
		    	for (PricebookEntry e : pb.PricebookEntries)
		    	{
		    		e.CurrencyIsoCode = currencyTo;
		    		e.UnitPrice = e.UnitPrice * rate;
		    	}
		    	update pb.PricebookEntries;
	    	}
	    }
	    return null;
    }
}

 

Any help is welcome! :)

Thanks in advance..!

 

 

  • September 12, 2010
  • Like
  • 0

Hi,

I have a sandbox with some custom VF pages...

For some reason with the same user, I do not see the Page editor in Chrome wiliest in IE 8 or Firefox it works perfectly fine.

 

What am I missing in here ? :0

  • September 07, 2010
  • Like
  • 0

Hi I have a visual force page with a ton of logics on it with code behind.

I have been asked to add a button that takes the second phase of the page and saves it as pdf.

 

now i know theres the renderas="pdf" tag, however i need to be able to call it from a button... meaning this scenario:

 

A. User comes in to the page does a few things and clicks next.

B. The results are displayed.

C. He clicks on a new button that i create, and he expects to see the same results only in pdf...

 

any idea of how to do it ? i basiclly want when the user clicks on the button to take the currents page state (after i have run all the logics to get the results) and make it a pdf...

 

its important to say there are a lot of logics and i cant simply redirect him to another page with the results because there is too much logic to be copied to a new page just for the pdf..

 

 

Thanks in advance!

  • September 02, 2010
  • Like
  • 0

Hi,

Our corporation instance of salesforce enterprise has been updated to winter 11, however when I click on my user name and go to system log, the old system log appears.

 

What do I need to do in order to enable the new one?

 

Thanks in advance!

  • October 11, 2010
  • Like
  • 0

Hi Im trying to do something that sounds pretty simple to my clients...

Every quarter a new price book is generated, and sometimes they want to clone an existing PriceBook only with a different Currency + update the UnitPrice according to the exchange rate in the company's Currency table.

 

So this is what the client does, goes to a price book -> Creates a new price book from an existing one.

Goes to my SF page with the new pricebook ID in the QS, chooses the new currency and I would ideally want to change all the PriceBookEntry currency + unitprice.

 

In short, the error thrown at me is :

 

System.SObjectException: Field is not writeable: PricebookEntry.CurrencyIsoCode
Class.vfChangePriceBookEntriesCurrController.CommitChanges: line 43, column 9 External entry point

 

Here is my VF page:

 

 

 

 

<apex:page sidebar="false" controller="vfChangePriceBookEntriesCurrController">
    <apex:pageBlock title="{!pbName} change currency">
        <apex:form >
            <table style="width:100%">
                <tr>
                    <td>
                        Change currency to :
                    <apex:selectList id="CurrencyTo" style="width: 50px;" size="1" value="{!currencyTo}">
                        <apex:selectOptions value="{!allCurrencyISOOptions}"/>
                    </apex:selectList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <apex:commandButton value="Commit" Action="{!CommitChanges}" />
                    </td>
                </tr>
            </table>        
        </apex:form>
    </apex:pageBlock>
</apex:page>

 

 

 

 

 

And the controller: 

 

public with sharing class vfChangePriceBookEntriesCurrController {
    public String pbName                                                    {get;set;}
    private String pbID                                                     {get;set;}
    public Pricebook2 pb                                                    {get;set;}
    public List<SelectOption> allCurrencyISOOptions                         {get;set;}
    public List<CurrencyType> allCurrencysDB                                {get;set;}
	public String currencyTo 												{get;set;}
    public vfChangePriceBookEntriesCurrController()
    {          
        //get id from qs
        if(ApexPages.currentPage().getParameters().get('id') != '' && ApexPages.currentPage().getParameters().get('id') != Null)
                pbID = ApexPages.currentPage().getParameters().get('id') ; 
        pb = [Select p.Name, (Select UseStandardPrice, UnitPrice, SystemModstamp,
        						 ProductCode, Product2Id, Pricebook2Id, Name, LastModifiedDate,
        						 LastModifiedById, IsDeleted, IsActive, Id, CurrencyIsoCode, CreatedDate,
        						 CreatedById From PricebookEntries) From Pricebook2 p where Id =: pbID ]; 
        if (pb!=null)
        pbName = pb.Name;   
        allCurrencyISOOptions = new List<SelectOption>();
        allCurrencysDB = new List<CurrencyType>();
        allCurrencysDB = [Select c.IsoCode, c.ConversionRate From CurrencyType c where IsActive=true and IsCorporate=false];
        if (allCurrencysDB!=null && allCurrencysDB.size()>0)
        	{
        		for(CurrencyType c : allCurrencysDB)
                	allCurrencyISOOptions.add(new SelectOption(c.IsoCode,c.IsoCode));
        	}
        
    }
    public PageReference CommitChanges()
    {
    	System.debug('In commit!');
	    if (currencyTo!=null && currencyTo!='')
	    {
	    	system.debug('Currency: ' + currencyTo);
	    	double rate = 0.0;
	    	for (CurrencyType ct : allCurrencysDB)
	    		if (ct.IsoCode == currencyTo)
	    			rate = ct.ConversionRate;
	    	if (rate!=0.0 && pb.PricebookEntries.size()>0)
	    	{
		    	for (PricebookEntry e : pb.PricebookEntries)
		    	{
		    		e.CurrencyIsoCode = currencyTo;
		    		e.UnitPrice = e.UnitPrice * rate;
		    	}
		    	update pb.PricebookEntries;
	    	}
	    }
	    return null;
    }
}

 

Any help is welcome! :)

Thanks in advance..!

 

 

  • September 12, 2010
  • Like
  • 0

Hi,

I have a sandbox with some custom VF pages...

For some reason with the same user, I do not see the Page editor in Chrome wiliest in IE 8 or Firefox it works perfectly fine.

 

What am I missing in here ? :0

  • September 07, 2010
  • Like
  • 0