• Sami Cohen
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 14
    Replies

Hi,

 

I would like to implement a chatter component (via Rest API) into  pure HTML & javascript (Not from VisualForce).

The issue is that i cannot call the restapi from javascript due to browser same origin policy.

Do I need a proxy for that?

Is there a workaround?

 

Thanks in advance. 

Hi,

 

Can we insert multiple records using the Rest API?

 

thanks. 

Does anyone know if it is possible to use the embedded FCKEditor in a managed package.

Hi all,
 
 
It seems that VF doesn't know to render currency field with the right currency Symbol when displaying the UnitPrice field of the  PriceBookEntry sObject:
 
Here my Controller Code:
 
Code:
public class TEST {public PriceBookEntry getMyProd(){  return [select Id,UnitPrice,Product2.currencyisocode from PriceBookEntry where id =:'01uR0000000bGho'];}}

 01uR0000000bGho is  PriceBookEntry record id  which currency equals to  EUR ->  EUR 1,500.00
 
Here is my VF Page
 
Code:
<apex:outputField value="{!MyProd.UnitPrice}"/><br/>Real currency Symbol : <apex:outputField value="{!MyProd.Product2.currencyisocode}"/>

 
Here is the result:
 
List Price  USD 1,500.00
Real currency Symbol : EUR 
When the expected result should be :
 
List Price  EUR 1,500.00
Real currency Symbol : EUR
 
 
This is very strange, it seems to be a serious issue.
 
Any Idea or comment?


Message Edited by Sami Cohen on 01-15-2009 04:29 AM

Message Edited by Sami Cohen on 01-15-2009 04:30 AM

Message Edited by Sami Cohen on 01-15-2009 04:31 AM

Message Edited by Sami Cohen on 01-15-2009 04:50 AM
Message Edited by Sami Cohen on 03-17-2009 11:38 PM
Hi,
I don't know how to retrieve the currencySymbol  in case the organization doesn't use multiple currency.
 
In the case the org use MultiCurrency i can call the userInfo.getDefaultCurrency() method.
 
But in the case it doesn't there is a problem.
Does exist a property like in the API - CurrencySymbol (getUserInfoResult) or
another way to retrieve the currency symbol ($, ...)?
 
 
Thanks,
 
 

 

Hi,
I'm trying to use the setup style in my  visual page with no success.
 
Code:
<apex:page setup="true"  controller="mycontroller" showHeader="false">

 Any Idea?

  
Hi all,
Recently, we encoutered new problem in List iteration.
The following code generates an exception saying that  the element "d" is null :
 
Code:
for(Opportunity d : [select name from opportunity])
{
    // do something with d
}

We resolved the bug by inserting a "If" condition before performing any operation into the loop.
Is is very strong!!!!
Any comment?

Here is my VisualPage code:
 
Code:
<apex:page controller="testConCTRL">
<apex:form >
<apex:pageBlock >
        <apex:dataTable value="{!LIST}" var="Prod" >            
            <apex:column value="{!Prod.Name}">
            </apex:column>                 
        </apex:dataTable>               
                  
        <apex:commandButton value="next" action="{!setcon.next}" ></apex:commandButton> 
        <apex:commandButton value="previous" action="{!setcon.previous}" ></apex:commandButton>   
</apex:pageBlock>
</apex:form>
</apex:page>

 Here is my Controller:
Code:
public class testConCTRL {

List<Product2> p = new List<Product2>();


public ApexPages.StandardSetController setCon {

get {

if(setCon == null) {
setCon = new ApexPages.StandardSetController(Database.getQueryLocator([Select Id, Name FROM Product2]));
setcon.setpageSize(5);
}

return setCon;

}

set;

}
public List<Product2> getLIST() 
{
    p= new List<Product2>();
    p = (List<Product2>) setCon.getRecords();
    return p;
}

}

 I have 2 problems:
  • The getRecords() actions return just 4 entries although I have more than 10 entries in my Product2 object.  
  • The next() action returns the same result everytime.

Help would be appreciated.



This should not be confused with my previous message related to the pre-chat form.

 

In the post chat form of Live Agent, the developer documentation provides an example of how to spit out some values about the chat (like that would be even remotely interesting to the customer) and at the end there's the fantastically unhelpful comment: <!-- Implement your post-chat message, form, or survey here -->

 

Nowhere does it say how I can get hold of the transcript object to store the values. I just want to implement a simple customer satisfaction form in the post-chat.

 

Does anyone have any pointers or examples of how this can be accomplished? 

 

Thanks, Finn Arild.

Hi,

 

Can we insert multiple records using the Rest API?

 

thanks. 

Does anyone know if it is possible to use the embedded FCKEditor in a managed package.

I am trying to invoke system.schedule method. The first parameter is name of the schedule, second is the schedule string and third is the instance of the apex class that implements Schedulable interface.

 

The schedule string is the following

 

'58 0 20 12 5 ? 2010'

 

I get an exception saying System.Exception: trigger must be associated with a job detail

 

Has anyone encountered this exception before? Any idea where i could be missing? Any help would be appreciated.

 

3:0:57.407|METHOD_ENTRY|[109,32]|system.schedule(String, String, scheduleActiveQChecker)
3:0:57.450|EXCEPTION_THROWN|[109,32]|System.Exception: trigger must be associated with a job detail
3:0:57.450|METHOD_EXIT|[109,32]|schedule(String, String, APEX_OBJECT)

Hi

 

Can i customize product object? As I dont require the Price to be added for the product i am creating 

Hi

 

I am looking to provide data integration for a client who has Professional Edition.  My experience to date is with Enterprise and Unlimited and it seems there is very little available connectivity options in Prof Ed:

 

No Web Services API, workflow, outbound messaging or even Data Loader support:


http://www.salesforce.com/us/pdf/datasheets/compare_edition_datasheet.pdf

 

 

Please could anyone suggest options to integrate to back office systems; either real-time or batch.

 

Many thanks in advance.

 

Paul

 

 

I see that the support for currencies (for example for annual revenue field on the account record) is not enabled for all clients of salesforce. How can I get the currency used by an organisation when this feature is not enabled? The only thing I can find that is filled in is the currencysymbol property of the GetUserInfoResult object. Am I really to program a table that maps these symbols to currencies? Is this even a one to one relation? Can't I just get the currency iso code for that organisation? The  field userDefaultIsoCurrencyCode is null, so it isn't there. Where or where can I get this?
 
Thanx
Koen.
Hi,
I'm trying to use the setup style in my  visual page with no success.
 
Code:
<apex:page setup="true"  controller="mycontroller" showHeader="false">

 Any Idea?

  
The StandardSetController (or Database.QueryLocator) ignores the SOQL 'where' clause.

Because QueryLocator can only be used with StandardSetController or in managed sharing recalc, I can't test the it separately to see exactly where the bug lies.

This (simplified) example shows the bug in the StandardSetController context.

I have a custom visualforce page that lists users:

Code:
<apex:page controller="CtlBugPgr" title="Bug">
<apex:form>

<apex:pageBlock title="Users" id="UserList">

<apex:pageBlockTable value="{!data}" var="each">
  <apex:column headerValue="Active?">{!each.IsActive}</apex:column>
  <apex:column headerValue="User">{!each.Name}</apex:column>
  <apex:column headerValue="UserType">{!each.UserType}</apex:column>
</apex:pageBlockTable>

</apex:pageBlock>

</apex:form>
</apex:page>

 The controller for this page uses StandardSetController:

Code:
public class CtlBugPgr {

  //-------------------------------------------------------------------------------
  // User List
  //-------------------------------------------------------------------------------
  public User[] data { get { return (List<User>)pgr.getRecords(); } set; }

  public ApexPages.StandardSetController pgr {
    get {
      if (pgr == null) pgr = initPager();
      return pgr;
      }
    set;
    }
  
  //-------------------------------------------------------------------------------
  // privates
  //-------------------------------------------------------------------------------
  private ApexPages.StandardSetController initPager() {
    ApexPages.StandardSetController ret = new ApexPages.StandardSetController(Database.getQueryLocator(
[select Name, UserType, IsActive from User where IsActive = true and UserType = 'Standard']
));
ret.setPageSize(10); // UPDATED: necessary to reproduce bug!
return ret;
} }

 
Note the two conditions in the where clause of the SOQL.

If I run the query directly via "executeAnonymous" I get what I expect:

Code:
> System.debug([select Name, IsActive, UserType from User where IsActive = true and UserType = 'Standard']);

20081125225927.981:AnonymousBlock.i: line 1, column 1: ( User:{UserType=Standard, IsActive=true, Name=John Hart, Id=...})

 
However, in the visualforce page, all Users are returned:






Message Edited by jhart on 11-26-2008 03:25 PM
  • November 25, 2008
  • Like
  • 0
Hi Forum members,

I am trying to send emails via Messaging.MassEmailMessage in Apex trigger.

I am not able to save the trigger

Code i used for that is
/////////////////////////////////////
trigger mytrigger on Account (after update)
{
    if (Trigger.isAfter && Trigger.isUpdate)
    {

           String[] toAddresses = new String[]{'xyz@abc.com', 'ijk@abc.com'};
           Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
            mail = new Messaging.MassEmailMessage();
            mail.setToAddresses(toAddresses);
            mail.setPlainTextBody(' test mails ');
            mail.setSenderDisplayName('ABCD corp') ;
            Messaging.sendEmail(new Messaging.MassEmailMessage[] {mail});

    }
}
/////////////////////////////////////

now i am not able to save this cause,i think i am missing something in this cause mail object of Messaging.MassEmailMessage  is not recognizing "setToAddresses"  method and other methods

Please advice the right way to use this for massmailing
My requirement is to post emailbody to various contacts

Thanks
Nikhil


Message Edited by Nikhil on 10-22-2008 12:36 AM
  • October 22, 2008
  • Like
  • 0
Hi all,
 
I get a Javascript error (Invalid Argument) while using apex:commandLink. My code is as under:
 
Code:
<apex:pageBlock rendered="{!showFifthSection}">
    <table width="80%">
        <tr>
            <td style="font-weight:bold;" width="20%" valign="top">
                Enter Hi ROC adjustment criteria:
            </td>
            <td width="10%">
                <apex:inputField value="{!contractTerms.ADJ_RT_CRITERIA__c}" />
            </td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">
                <apex:pageMessage severity="info" strength="1" title="Please include details regarding the criteria for which the Hi-ROC rate reduction or increase would adjust.  Describe any rate adjustment tables, and include references to pages and sections within the contract that explain the rate adjustment criteria.  Include details, such as number of month's notice an account must have before a rate change." />
            </td>
        </tr>
        <tr>
            <td style="font-weight:bold;">Enter effective date(s) Hi-ROC adjustment(s):</td>
            <td><apex:inputField id="termDt" value="{!termDates.Date__c}"/> <apex:CommandButton action="{!addTermDates}" value="Add" onclick="return checkBlankDate(document.getElementById('{!$Component.termDt}'));"></apex:CommandButton>
        </td>
        <td></td>
    </tr>
    <tr>
        <td colspan="3 align="left">
            <apex:dataTable value="{!allTermDates}" var="a" title="Details of Effective Date" >
                <apex:column >
                     <apex:commandLink value="Remove" action="{!removeTermDates}">
                         <apex:param name="termDates" value="{!a.Id}" />
                     </apex:commandLink>
                </apex:column>
                <apex:column > <span style="padding:15px;"/><apex:outputField value="{!a.Date__c}"/></apex:column>
            </apex:dataTable>
        </td>
    </tr>
    <tr>
        <td colspan="3" align="right">
            <apex:commandButton action="{!nextPage}" value="Continue" styleClass="btn" onclick="return checkEmptyFields(this.form);"></apex:commandButton>
        </td>
    </tr>
</table>    
</apex:pageBlock>

 It throws me an error as soon as I click the Remove link. However the records get deleted on the Remove Link but it throws the error. Kindly advise if I've missed out on anything.
When I do a View Source of the generated page it says that there is an error in a javascript function that is generated by Salesforce. The function name is dpf() and the error is thrown at if (adp != null). The javascript generated code is as under.
Code:
 
 
function dpf(f) {
    var adp = f.adp;
    if (adp != null) {
        for (var i = 0;i < adp.length;i++) {
            f.removeChild(adp[i]);
        }
    }
};
function apf(f, pvp) {
  var adp = new Array();
  f.adp = adp;var ps = pvp.split(',');
  for (var i = 0,ii = 0;i < ps.length;i++,ii++) {
    var p = document.createElement("input");
    p.type = "hidden";  
    p.name = ps[i];
    p.value = ps[i + 1];
    f.appendChild(p);
    adp[ii] = p;i += 1;
  }
};
 
function jsfcljs(f, pvp, t) {
  apf(f, pvp);
  var ft = f.target;
  if (t) {
    f.target = t;
  }
  f.submit();
  f.target = ft; 
  dpf(f);
};

 Are there any constraints on using an apex:commandLink or an apex:dataTable within an HTML table?


Message Edited by kriiyer on 07-29-2008 07:07 AM
Hello there,
I have a requirement where I need to encrypt/decrypt some data stored on the salesforce.com custom objects .. i.e., I need to encrypt some information, store them in a custom object, and then when needed , I need to query the encrypted information and decrypt it.

Does any force.com API allows me to do this ? or any other way I can achieve this encryption for my data ? I am currently using Flex toolkit for force.com for my project,

I would appreciate any response.

Thanks,
Arun B