• pierpi
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 10
    Replies
Hi,
I tried using the sf:listMetadata target in the ant migration tool to list all defined Reports (metadataType="Report") but I get no reports, although I have defined many of them (indeed if I use the sf:retrieve target, specifying reports, I can retrieve them).

The listMetadata works fine with other elements (e.g. CustomObject, ReportType, Profile, etc.).

Any ideas?  I also run a sf:describeMetadata and I see the Report element listed.
 
My ultimate goal is to identify selected reports based on specific internal logic without having to go through the GUI one by one.
 
Thanks
Pierpaolo 
  • October 26, 2009
  • Like
  • 0
Hi,
I am trying to convert a master-detail relationship into a regular lookup.  According to the on-line help (search for "What happens if I detach a Master-Detail Relationship?") I need to pay attention to report types and reports, among other things.

I think I need to create new custom report types "cloning/duplicating" the logic defined in the "master-detail" report types for those objects I want to convert the field relationship for.  I need also to "clone/duplicate" all defined reports (of the given type).  

My questions are:
1. How do I find all the report types "based" on the master-detail relationship I am about to modify?
2. Is there a way to easily "clone/duplicate" the above report types?
3. How do I find all the reports defined on the report types at point 1.
4. Is there a way to easily "clone/duplicate" the reports found above?
5. I have noticed that reports can be scheduled to run at configurable times.  Will I have to "recreate" those schedule for the newly duplicated reports?
6. Are there any other things I should be aware of?

Thanks a lot, I know I asked a lot of questions but I was not able to find the necessary documentation.
Pierpaolo 
  • October 24, 2009
  • Like
  • 0

Hi, 

I have a page defining several styles and containing several components.  If my component contains html segments part of a style defined in the main page I have problems when rendering the page as pdf.  The non-pdf page renders properly with no problems.  I tried looking around the posts and the documentation with no success. 

 

If I include the custom component MyComponent the rendered pdf loses the style.  If I inline the component it works fine.

 

Below is a simplified version of what I developed.

 

Page:

 

 

<apex:page renderAs="pdf"  standardstylesheets="false" sidebar="false" showheader="false" >

 

<head> <style type="text/css">

 

body,td {

    font-family: Arial;

    font-size: 11px;

}

.table_blue {

    border-collapse: collapse;

}

 

.table_blue .head td {

    border: 1px solid #000000;

    padding: 5px 3px;

    vertical-align: top;

    background-color: #A4A4A4;

    font-weight: bold;

}

</style>

</head>

<body>

<table cellpadding="0" cellspacing="0" width="100%" class="table_blue">

       <c:LineItemHeaderComponent />

<!--tr class="head">

    <td align="center" nowrap="nowrap">"Column 1" </td>

    <td align="center" nowrap="nowrap">"Column 2" </td>

</tr>-->

</table>

</body>

</apex:page>

 

 

 

 

 My component:

 

 

<apex:component >

<tr class="head">

    <td align="center" nowrap="nowrap">"Column 1" </td>

    <td align="center" nowrap="nowrap">"Column 2" </td>

</tr>

</apex:component>

 

Thanks a lot 

 

 


 

  • August 21, 2009
  • Like
  • 0

It is probably an easy question, but I have been looking at the messages on the board and I can't still figure this out.  I need to display the translation of a given key (string) for multiple keys.  Basically is as if i need to call multiple times the same method with different parameters.  I was thinking to define a controller with a map of all possible keys (and their associated translation). 

 

I tried the following (simplified version):

 

(i also tried to assign to inputParam below a dynamically "retrieved" string <apex:param name="currText" value="{!num}" />)

 

<apex:page controller="DictionaryController">

   <apex:outputText value="Translation for one is: {!outParam}">
      <apex:param assignTo="{!inputParam}" value="one" />
      <apex:param name="currText" value="one" />
      <apex:param name="q" value="{!outParam}"/>
   </apex:outputText>

</apex:page>

and the controller:

 

public with sharing class DictionaryController {
 public String inputParam {get; set;}
 private String outParam;
 

//the getOutParam method also does not work (inputParam is null) if it tries to get the inputParam value, which should

//have been set previously via the apex:param .... assignTo declaration in the apex page.


 public String getOutParam(){
  String currText = System.currentPageReference().getParameters().get('currText');
  
  if( currText == 'one') return 'uno';
  else return 'altro';
 }
 
 public String getNum() {
  return 'one';
 }
}

 

Thanks a lot for the help.

  • August 11, 2009
  • Like
  • 0

Hi All,

 

How can I programmatically retrive which standard and custom objects a given security profile has access to?

Also how to retrieve field level permissions?

 

Thanks

 

  • September 21, 2009
  • Like
  • 0

I have a sites pages that has the following line of code that have image.

 

 

<apex:page showHeader="false">
<apex:image id="Holidays" value="{!$Resource.default1}" width="220" height="55" />

 

I want to change the images based on the field value in the ojbect.

My custom object name  holidays__c. Custom page  titled  holidayspecialpage.

with custom field season__c. I have a custom controller and page works fine on sites page.

 

I want to change the image in my apex page based on the value of season__c

 if(season__c = summer) static resouce summer image.

How can I acheive this?

  • August 12, 2009
  • Like
  • 0

It is probably an easy question, but I have been looking at the messages on the board and I can't still figure this out.  I need to display the translation of a given key (string) for multiple keys.  Basically is as if i need to call multiple times the same method with different parameters.  I was thinking to define a controller with a map of all possible keys (and their associated translation). 

 

I tried the following (simplified version):

 

(i also tried to assign to inputParam below a dynamically "retrieved" string <apex:param name="currText" value="{!num}" />)

 

<apex:page controller="DictionaryController">

   <apex:outputText value="Translation for one is: {!outParam}">
      <apex:param assignTo="{!inputParam}" value="one" />
      <apex:param name="currText" value="one" />
      <apex:param name="q" value="{!outParam}"/>
   </apex:outputText>

</apex:page>

and the controller:

 

public with sharing class DictionaryController {
 public String inputParam {get; set;}
 private String outParam;
 

//the getOutParam method also does not work (inputParam is null) if it tries to get the inputParam value, which should

//have been set previously via the apex:param .... assignTo declaration in the apex page.


 public String getOutParam(){
  String currText = System.currentPageReference().getParameters().get('currText');
  
  if( currText == 'one') return 'uno';
  else return 'altro';
 }
 
 public String getNum() {
  return 'one';
 }
}

 

Thanks a lot for the help.

  • August 11, 2009
  • Like
  • 0

Hello;

I try to pre populate the "new contract" fields using this post: https://na6.salesforce.com/secur/forgotpassword.jsp?r=F0j6FwEhch5yAH5YV_T_3ArID6fs0T.iZQby4uyjseu93wK2_bIiNgdnh_t12R67

 

Basically what I did:

 

 

A visualforce page with this line only:

 

<apex:page standardController="Task" extensions="CustomEditContract" action="{!doCreate}"/>

 

 

And and apex class (CustomEditContract):

 

public class CustomEditContract { public CustomEditContract(ApexPages.StandardController controller) { } public PageReference doEdit() { /* Get the pagereference for the contract edit */ Contact contr = new Contact(); ApexPages.StandardController theC= new ApexPages.standardController(contr); PageReference p = theC.edit(); return p; } }

 The problem is that the edit() doesn't accepts an object without an ID.

I don't want to use S-controls or building the entire page using visualforce, but I didn't found any other solutions.

So, is there no way of pre populating a new object using apex and the StandardController?

 

Thanks;

Farid

 

Is there a way to get a handle on the PageReference that corresponds to the New / Edit / Delete actions for SObjects.

 

In Visualforce, you can get the URL by using the URLFOR function:

 

 

<apex:commandButton value="New"action="{!URLFOR($Action.Gathering__c.New, null, [cid=theContact.id])}"/>

 This will properly take me to the New Gathering__c page.

 

Can I get at this in Apex?  Something like:

 

PageReference pageRef = ApexPages.Action.Gathering__c.New;

pageRef.getParameters().put(cid, theContact.id);ApexPages.Action ac = ApexPages.Action.Gathering__c.New;

 Neither of these work like the Page.Custom_Apex_Page

 

Is the only solution to override the New / Edit Views and make a custom Apex Page / Controller?

 

Thanks 

 

 

 

 

It looks like if you specify a templateId on a Messaging.SingleEmailMessage object, you must also specify a TargetObjectId. That's fine if you are sending to an existing contact or user, but what if you just have an email address? Can you send an email using a template and just specify an email address? If not, any ideas on how to leverage a template in this manner?

I'm new to sfdc developing and i would like to pre-populate a field value when someone clicks the new button on any given object.

 

To my limited understanding there is no trigger that fires at this point. Is there a way to pre-populate field values using apex when someone clicks the new button? Thanks!

  • April 29, 2009
  • Like
  • 0

I have a custom object called Merchant_Analysis__c which has a master-detail relationship with Opportunity. There is a field on the custom object called Opportunity__c which is just a reference to the parent Opportunity. I have a simple javascript button on the Opportunity called  New Merchant Analysis which simply passes the opportunity id to the visualforce controller via GET.

 

In my save method for the controller I set the Merchant_Analysis__c.Opportunity__c field to the ID of the Opportunity

 

public analysisController()

{

String oid = System.currentPageReference().getParameters().get('id');

 

if(oid != null && oid != '')

{

Opportunity o = [select id,name from Opportunity WHERE id=:oid];

this.oppID = o.id;

}

}

public PageReference save()

{

analysis.Opportunity__c = oppID;

analysis.recordtypeid = recType;

insert analysis;

 

PageReference analysisPage = new PageReference('/' + analysis.id);

analysisPage.setRedirect(true);

 

return analysisPage;

}

 

 The variable oppID is a public class level String variable that holds the Opportunity ID. For some reason when I run my test methods I get the following error:

 

System.SObjectException: Field is not writeable: Merchant_Analysis__c.Opportunity__c

 I've checked all the field level securities and everything to make sure Opportunity__c is not read only anywhere. For some reason I cannot figure out how to get past this error or even what is causing it.

 

Does anyone know how I can set the the relationship field of a Custom Object with a Master-Detail Relationship?

 

 

Any help would be great, as this problem has been plaguing me for too long now.

 

 

Thanks,

Jonathan 

 

 

 

Message Edited by jbroquist on 02-26-2009 11:52 AM
Message Edited by jbroquist on 02-26-2009 11:52 AM
Hi All,

I've written a code in c# to send an email using API and using template in sales force, but i am unable to access the variables in the template i.e. how would the variables get values in templates by using API.

My template body has following variable {!Opportunity.Account} which contains account name of the opportunity.
And following is my code:

SingleEmailMessage[] messages = new SingleEmailMessage[1];
messages[0] = new SingleEmailMessage();
messages[0].emailPriority = EmailPriority.High;
messages[0].replyTo = "test@salesforce.com";
messages[0].saveAsActivity = false;
messages[0].targetObjectId = "005R0000000HncC";
messages[0].useSignature = true;
messages[0].templateId = "00X40000000nbZ8";
SendEmailResult[] result = binding.sendEmail(messages);

The email is being sent successfully but with no account name. i.e. if the template body is "Opportunities account name is {!Opportunity.Account}" then it is sent as "Opportunities account name is"

Can anyone help me to find out how should i relate the object and object id from code i.e. how to fill the variables which are used in template body.

Help is appreciated.

Regards,
Rani
  • September 17, 2008
  • Like
  • 0