• Venkat Polisett
  • NEWBIE
  • 470 Points
  • Member since 2006

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

Hey all,

 

I'm new to apex coding and i'm have an incredibly hard time understanding something that should be really simple.

 

I have a custom object Reference_Request__c that has a field OftR__c - reference

 

OftR__c in turn is reference to Opportunity.

 

Basically, what i want to do is set Reference_Request__c 's OwnerId to OftR__c's OwnerId.

 

I know that OwnerId is a lookup for OftR__c, but i dont really know what that means or how i should approach something like that.

 

this is what i have so far, but it returns an Exception on line 5.

 

trigger Insert_RelatedOwnerID_as_RefReqOwnerID on Reference_Request__c (before update, before insert) {
	List<Reference_Request__c> l = new List<Reference_Request__c>();
	for(Reference_Request__c req: Trigger.new){
		l = [Select req.OftR__r.Owner_ID__c From Reference_Request__c req limit 1];
		req.OwnerId = l[0].OwnerId;

	
	}
}

 

 

 

 

 

 

While i'm here asking for help, could someone explain the child-parent, parent-child relationship i have here? I read the web api on relationships and i just cant seem to connect the dots.

 

Any help is appreciated

  • June 16, 2010
  • Like
  • 0

I have a visual force email template that uses a component to place an attachment into an email.  I also have code in my application that transitions to the the EmailAuthor.jsp page using a url that looks like this:

 

https://na7.salesforce.com/_ui/core/email/author/EmailAuthor?p3_lkid=a0bA0000000A6slIAC&template_id=00XA0000000OHXmMAO

 

As you can see, I am providing a whatId and a template id.

 

When I arrive at the EmailAuthor page, at first glance everything looks good.  I see text from my template in the body and I see data from my relatedTo record properly merged into the email.  Unfortunately though, the attachment does not appear.  If I then click on the button to "select a template" and then choose the template that was provided in the above url, the page refreshes and the attachement is now shown on the page.  Of course, the whole reason why I provided the template id in the url was so the user doesn't have to select it.

 

Has anyone encountered this problem before and found a way to resolve it?

 

My template looks like:

 

<messaging:emailTemplate subject="Past Due Balancexx" recipientType="Contact" relatedToType="DunningNoticeQueue__c">
  <messaging:htmlEmailBody >
     <br><apex:image value="{!relatedTo.Image_1_Web_Address__c}" />
     <br><br><br>Dear {!recipient.firstName}:

     <br><br>This is to inform you that you owe: {!relatedTo.AR_Summary_Unworked__r.Total_AR_Balance__c}
     <br><!apex:image value="{!relatedTo.Image_1_Web_Address__c}" />
  </messaging:htmlEmailBody>
  <messaging:attachment renderAs="application/vnd.ms-excel" filename="invoices" >  
     <c:DunningInvoiceAttachment dunningQueueId="{!relatedTo.Id}"/>  
  </messaging:attachment>
</messaging:emailTemplate>

 

 

Hey guys,

 

I'm having a basic issue with the <apex:selectradio> component and AJAX updates. I simply want a pagesection to render based upon whether a certain radio option has been selected. However, I'm encountering two problems:

 

1) The onchange event seems to fire at odd times (i.e. when I click an unrelated component on the screen, or not at all when I change the radio options

2) I can't get the section to render (which I'm sure is just a case of my not being very capable with the controller behind the scenes.

 

Visualforce Code

<apex:pageblock title="Additional Required Information"> <apex:outputtext value="Will the status last for a set period of time or covered by a set amount of revenue? (select one)" /> <apex:pageblocksection columns="2"> <apex:outputpanel id="ScopeOptions"> <apex:selectRadio layout="pageDirection" value="{!ScopeOption}"> <apex:actionSupport event="onchange" status="ScopePleaseWait" reRender="NumberOfMonths" /> <apex:selectOptions value="{!Scopes}" /> </apex:selectRadio> </apex:outputpanel> <apex:pageblocksectionitem /> </apex:pageblocksection> <apex:outputpanel id="NumberOfMonths"> <apex:actionstatus id="ScopePleaseWait" startText="Please Wait ..... Acquiring Additional Question..."> <apex:facet name="stop"> <apex:pageblocksection rendered="{!Scopes = 'Time'}"> <apex:outputlabel value="THIS RENDERED BECAUSE THE TIME OPTION WAS SELECTED!" /> </apex:pageblocksection> </apex:facet> </apex:actionstatus> </apex:outputpanel> </apex:pageblock>

Apex Code

 

public List<SelectOption> getScopes(){ List<SelectOption> scopes = new List<SelectOption>(); scopes.add(new SelectOption('Time','Time')); scopes.add(new SelectOption('Revenue','Revenue')); return scopes; } public string getScopeOption(){ return ScopeOption; } public void setScopeOption(string ScopeOption){ this.ScopeOption = ScopeOption; }

 

I'm sure that it's a case of incorrect coding, but would love a pointer. I'm no expert when it comes to coding, in general.

 

Thanks!

Message Edited by Big Ears on 04-30-2009 04:25 AM
Is there a way to track how many @future function calls made and when?
  • April 29, 2009
  • Like
  • 0

Hi:

   I have a javascript function in my Static Resource.. Now in my VF page I called it by:

 

<apex:page standardController="SFDC_520_Quote__c" extensions="salesQuotes" showHeader="false" sidebar="false" tabStyle="SFDC_520_Quote__c" renderAs="PDF"> <style> h2 {color: #dddddd; font-size: 24px; } .teststyle {color: #ff3300;} </style> <apex:includeScript value="{!URLFOR($Resource.Formatnum)}"/>

 Now The function insde the javascript.js is addCommas(nstr)

How do I call it now?

Thanks

 

 

I have following coding in my Visualforce Page, it is supposed to output the date using Date Data Type:

<apex:outputText value="Contract Date:" style="font-weight:bold"/>

<apex:outputText value="{!Greige_Order__c.Contract_Date__c}"/>

 

The output shows Day, Date and Time instead of the normal format of 23/04/2009-

 

Contract Date:              Wed Apr 23 00:00:00 GMT 2008

 

I have another coding on the same VF page also using the Date Data Type for the First_Del_Mth__c field:

<apex:outputText value="{!New_Order__c.First_Del_Mth__c} "/>

The output is as follows, which is what is needed:


31/05/2008

 

Does anyone has the same problem and if so, how could this be solved?.

Any pointer will be highly appreciated

Many thanks in advance 

SL

  • April 27, 2009
  • Like
  • 0

The document says the limit on a Set/List/Map is 1000 in all contexts.

 

I checked the Limits class here -- http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_limits.htm

 

There's no mention of a method for  Set/List/Map. Is this because it's hard-coded in all contexts to 1000?

 

I don't really want to hard-code 1000 but I guess I will have to if there is no method to get the limit.

 

 

Hi All,

 

I have  created a custom object say "A", and provide help text for each fields , but I am not able to display help text hover(orange color ? mark) in my Visualforce page.

 

I have created VF page for object "A". With using <Apex:inputField > , but I unable to display help hover.

 

Please let me know if anyone has any idea.

 

-- Deepak 

I have a Custom Object called 'Vessel'. In the custom object there is a lookup field to Accounts, so that vessels owned by that account are displayed on the Account page in a related list. I have another field on the Vessel object called Vessel Manager. What i want to do is create a cross-object formula field on the account page so that If the field Vessel Manager contains a certain value, the formula field on the account page is set to a value. I cant seem to create a cross-object formula that will work though.

Any suggestions??

 

Matt

Hi

 

We developed few VF pages in sandbox. 

When users in our org tries to access the pages in sandbox they are getting the below error

 

Insufficient privileges

You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

 

Do i need to enable any settings/options on the user profile?

 

Users access this page by clicking on the custom link on the Home Page.

 

This is the page and controller

 

I noticed one more thing. Users with Modify All Data rights are able to access the pages.

 

Please advise.....Thanks

<apex:page controller="Redirecting_user" action="{!init}" >
      <apex:form >
      </apex:form>
</apex:page>

public class Redirecting_user { List<customObject__c> cust; public PageReference init() { cust=[select fields__c from customObject__c where ID__c=:UserInfo.getUserId()]; Integer count=cust.size(); return redirectTest(count); } public PageReference redirectTest(Integer count) { PageReference myPR = null; if (count == 0) myPR = Page.ABC1; else myPR = Page.ABC2; if (myPR != null) myPR.setRedirect(true); return myPR; } static testMethod void results() { Redirecting_user test=new Redirecting_user(); test.init(); } }

 

  • April 08, 2009
  • Like
  • 0

Hi Forum members

 

I added a hoover to my visualforce page and the hoover appears on the mousover event of a label

 

onmouseover calls a javascript code which is following

 

    <script src="/soap/ajax/15.0/connection.js"></script>
    <script src="/soap/ajax/15.0/apex.js" type="text/javascript"></script
>

 

       function myHover()
       {  

 

             sforce.connection.sessionId = "{!$Api.Session_ID}

             var resultQuery = " Select ID,Name from ACCOUNT LIMIT 2";

              

                     try
                    {
                        result = sforce.connection.query(resultQuery);
                    }
                    catch(e)
                    {
                        alert(e);
                    }

 

 

           //Some Code to show hoover with result

 

       }

 

 

Now the problem is this code works fine in a DEVELOPER Org and shows data of above query on hoover

 

But when i run this same code in sandbox or any Trial org 

the line  sforce.connection.query(resultQuery); raise following excepion

 

 

 

 

{faultcode:'sf:INVALID_SESSION_ID', faultstring:'INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session', detail:{UnexpectedErrorFault:{exceptionCode:'INVALID_SESSION_ID', exceptionMessage:'Invalid Session ID found in SessionHeader: Illegal Session', }, }, }

 

 

 

 

 

Please comment if someone knows the solution of this problem

 

Thanks

 

Message Edited by Nikhil on 04-07-2009 02:46 AM
  • April 07, 2009
  • Like
  • 1

Hi friends

someone please help me to resolve the following.

Data is stored in the object Travelling__c as,

 

Place

userid

Lasvegas

0001

Florida

0001

California

0001

Florida

0001

Lasvegas

0001

 

trying to display the the total trips for the user ooo1. In the below format

 

Trips

Place

2

Lasvegas

2

Florida

1

California

 

  Basically here Trips is the count of the trips to each place the User has Travelled.

 

 

Here is my VF Page and controller. I am able to display the results for places. I need some help on how to display the Trips Value... Please help..

 

<apex:page controller="TravellingSummary" >
<apex:form >
<apex:pageBlock><br />
<font face="Arial" size="3"><b> Below summarizes your Total Trips:</b></font><br /><br /><br />
<apex:pageBlockTable value="{!Summary}" var="summ">
<!-- <apex:column headervalue="Trips">
<apex:outputtext value="1"></apex:outputtext>

</apex:Column> -->
<apex:column headervalue="Place">
<apex:outputtext value="{!summ.place__c}"></apex:outputtext>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockButtons location="Bottom" >
<apex:commandButton action="{!save}" value="Submit"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>

</apex:pageBlock>
</apex:form>

</apex:page>

public class TravellingSummary
{
public List<Travelling__c> tve;
public PageReference cancel() {
return null;
}
public PageReference save() {
return null;
}

public List<Travelling__c> getSummary()
{
tve=[Select Place from Travelling__c where user_ID__c=:UserInfo.getUserId()];
return tve;
}

}

 

 

 

 

 

Having alittle challenge in building multi dimensional lists and maps for a bulk processing class.  This is being designed to handle thousands of records, and given the limitations of 1000 members per list or per map I have chosen to handle by creating multiple lists and maps to address this.

 

Current code frag I am working on is indicating that I have a List Index out of Bounds:

 

List<List<OpportunityTeamMember>> otm = new List<List<OpportunityTeamMember>>();

List<Map<string,OpportunityTeamMember>> oppMap = new List<Map<string,OpportunityTeamMember>>();

 

j = 0; 

 

for(OpportunityTeamMember opt: [Select o.id, o.opportunityid, o.teammemberrole, o.opportunityaccesslevel, o.userid,

o.Opportunity.accountid From OpportunityTeamMember o where o.Opportunity.accountid in :accIds and isDeleted = False

and userid in :userIds])

  {

   j = setOffset(i);       //  sets the variable j up by 1 for each 1000 records read to move to next list array

   opplist[j].add(opt);  //  adds the record read to the list

 

   i++;                      //  increment the record count

 }

 

// Now, build maps from each list and construct a compound key

 for(j=0; j<10; j++)  {

    for(OpportunityTeamMember ox1: opplist[j])  {      oppMap[j].put(ox1.userid +

':' + ox1.Opportunity.accountid + ':' + ox1.opportunityid, ox1);

   }

In looking at the debug log it shows that the code fails on the first iteration through the for select loop after reading the record and that the setOffset(i) is returning a zero as expected.  The code doesn't make it to the map building phase, but I would assume that there will be a similar issue there as well.

 

I am assuming that I am not dereferencing the list properly, or that I am not creating it properly, or both.  Any assistance would be appreciated. 

Hi,

 

I want to create a trigger that fires after an opportunity will be updated.

First the trigger has to check, if specified fields in the opportunity has changed. If so, the trigger has to log this changes into a new simple custom object (text only).

I wrote my code and the first part works very well:

 

trigger HistoryOpportunityV001_test on Opportunity (after update) { // no bulk processing; will only run from the UI if (Trigger.new.size() == 1) { String strChanges = ''; //// Checking fields if the value has changed // 1. Field: Opportunity.Name if (Trigger.old[0].Name != Trigger.new[0].Name) { cnt++; strChanges += cnt + '. <Name>: "' + Trigger.old[0].Name + '" -> "' + Trigger.new[0].Name + '"\n'; } // 2. Field: Opportunity.Order_ID__c if (Trigger.old[0].Order_ID__c != Trigger.new[0].Order_ID__c) { cnt++; strChanges += cnt + '. <Order_ID__c>: "' + Trigger.old[0].Order_ID__c + '" -> "' + Trigger.new[0].Order_ID__c + '"\n'; } if (cnt > 0) { OpportunityLog__c oppLog = new OpportunityLog__c( OpportunityID__c = Trigger.old[0].Id, OpportunityName__c = 'oppName', OpportunityChangesUser__c = UserInfo.getUserId(), Changes__c = strChanges ); insert oppLog; } } }

 

 

 

Now I want to implement, that the trigger will check if the value of some specific fields of the updated opportunitys line items (products in the opportuity) has changed. If so, I want to log this lineitems field changes, too.

I know that I have to loop through all line items and have to check the field values.

- BUT HOW CAN I DO THIS?

 

Could anyone help me, please? It would be great if you post me your code or ideally complete the existing code ;)

 

Next... I want to log if the user adds a new product/lineitem or deletes a lineitem.

 

Any ideas?

 

Thanks a lot,

jup

 

 

 

Hi,
Can we update the value of text box field on the fly on any custom Visualforce page.
For example I have a form with two textbox   1. Prepaid voucher price 2. Talk time
When user put the value on prepaid voucher price 50 bucks then automatic in the Tal time field the value 20 buck will be populating.
 
I hope you understand my question
 
Please let me know if any one has any idea on Visualforce.
 
Thanks,
Deepak 

Hi...

 

I want to Hide Edit and Delete links from a Related List, How can I do that.

 

My basic  purpose is to ALLOW EDIT and DELETE ONLY through API calls in APEX or Triggers.I do not want Users to Edit any Child Related List record on there own for a Particualr Object's Related List.

 

How Can I do that?

  • March 18, 2009
  • Like
  • 0

I have 2 product line items

 

1) License Fee

2) Maintenance Fee which is 10% of the License Fee

 

I would to automate the process so that Sales Price of Item 2 to automatically calculate at 10% of the line item above.

 

Is this possible? If so, how?

 

I would love some help on this.

 

Thanks in advance

 

 

 

  • March 16, 2009
  • Like
  • 0

Hi there. On examining the schema explorer, I find that Opportunity has a child relationship called

Histories. Now, when I add the following line of code to my visualforce:

 

 

<apex:relatedList list="Histories" />

 I get an error when my visualforce page is loaded stating:

 

'Histories' is not a valid child relationship name for entity Opportunity

 

Any ideas what's going on here? I can make other related lists appear but not this one....

Thanks

 

 

  • January 29, 2009
  • Like
  • 0

Do we need a Portal license to use the force4facebook?.

 

In the setting it up, it walks through enabling portal on the objects as well as the Site.

 

Has any one successfully used this toolkit. 

 

Any comments would be appreciated.

 

Thanks,

 

Hi all,
 
I have defined a triiger on Attachment object to fire after insert, after delete, after update. It works and executes the code for everything except the after insert event.
 
Is this by design not to fire the trigger on insert on attachment ?
 
Thanks,
Venkat Polisetti
We are using emailauthor.jsp to send emails from a java process and it was working successfully till they recently upgraded our instance to Sprint 07.
 
Anybody seen this happen to them so far ? We are able to send emails using the same approach from S-Controls and it is working alright.
 
Regards,
Venkat Polisetti
I have written an s-control that clones the attachments of one opportunity to another.  When it reaches the statement that creates the attachement, it hangs indefinetly.
Here is the code:
 
<script language="javascript" src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script> <script> function initPage() { sforceClient.registerInitCallback(Setup); sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_70}", true); } function Setup() { debugger; var origOppId = "00660000008IkwJ"; var clonedOppId = "00660000008IkXC"; // clone attachements var attachmentFieldList = new Sforce.Dynabean("Attachment").getDefinition().fieldList; var queryResult = sforceClient.query("Select " + attachmentFieldList + " from attachment where parentId = '" + origOppId + "'"); if (queryResult.className == "Fault") { var output = "There was an error retrieving Attachments: " + queryResult.toString(); alert(output) SetReturnURL(); return; } var oppAttachments = queryResult.records; for ( var i in oppAttachments) { var att = new Sforce.Dynabean("Attachment"); att.set("Name", oppAttachments[i].get("Name")); att.set("Body", oppAttachments[i].get("Body")); att.set("OwnerId", oppAttachments[i].get("OwnerId")); att.set("id", null); att.set("parentId", clonedOppId); var saveResult = sforceClient.create([att]); if (saveResult[0].success == false) { alert("Rats! There was a problem creating Attachment and I think the problem is: " + saveResult[0].errors[0].message); } } /* // clone Notes var noteFieldList = new Sforce.Dynabean("Note").getDefinition().fieldList; var queryResult = sforceClient.query("Select " + NoteFieldList + " from Note where parentId = '{!Opportunity_ID}'"); if (queryResult.className == "Fault") { var output = "There was an error retrieving Notes: " + queryResult.toString(); alert(output) SetReturnURL(); return; } var oppNotes = queryResult.records; for ( var i in oppNotes) { var note = oppNotes[i]; note.set("id", null); note.set("parentId", clonedOppId); var saveResult = sforceClient.create([note]); if (saveResult[0].success == false) { alert("Rats! There was a problem creating Note and I think the problem is: " + saveResult[0].errors[0].message); } } */ SetReturnURL(); return; } function SetReturnURL() { var url = "{!API_Enterprise_Server_URL_70}"; var returnURL = url.replace(/services\/.*/, "{!Opportunity_ID}"); top.location = returnURL; } </script>

I am attempting to write a trigger that fires at a specific stage of a opportunity. I feel like this is really stupid but salesforcce isnt allowing me to refer to the current stage as Opportunity.stagename

What am I doing wrong

Hey all,

 

I'm new to apex coding and i'm have an incredibly hard time understanding something that should be really simple.

 

I have a custom object Reference_Request__c that has a field OftR__c - reference

 

OftR__c in turn is reference to Opportunity.

 

Basically, what i want to do is set Reference_Request__c 's OwnerId to OftR__c's OwnerId.

 

I know that OwnerId is a lookup for OftR__c, but i dont really know what that means or how i should approach something like that.

 

this is what i have so far, but it returns an Exception on line 5.

 

trigger Insert_RelatedOwnerID_as_RefReqOwnerID on Reference_Request__c (before update, before insert) {
	List<Reference_Request__c> l = new List<Reference_Request__c>();
	for(Reference_Request__c req: Trigger.new){
		l = [Select req.OftR__r.Owner_ID__c From Reference_Request__c req limit 1];
		req.OwnerId = l[0].OwnerId;

	
	}
}

 

 

 

 

 

 

While i'm here asking for help, could someone explain the child-parent, parent-child relationship i have here? I read the web api on relationships and i just cant seem to connect the dots.

 

Any help is appreciated

  • June 16, 2010
  • Like
  • 0

Hey all, 

 

I need your help with trying to create a function that sends emails on a recurring basis. I called support but they werent very clear on how I could do this, so I'm turning to you for help. 


My function should send an email to the assigned user every 2 hour if the case priority is high and the status is new

 

So far I've tried the following but I believe it will not work:

 

 

trigger alertUser on Case (after update, after insert) {
datetime now = datetime.now();
datetime created = case.Createddate;
If (math.mod(datetime.getTime(created)  -  datetime.getTime(now), 7200000) == 0){
//send email
}
} 

 Thanks in advance

 

Hello,

I've seen many related posts, but nothing that has pushed me over the top for this problem.  Basically, I need a Lead trigger that can cause a Lead record to be run through the Lead Assignment rules if certain criteria are met on update of the Lead record.

 

One of the criteria is whether the current Lead Owner is an active or inactive SFDC user.  I had written the code to capture the owner status field via a SOQL select statement, but unfortunately this logic causes the apparently common mistake of having too many SOQL queries because the select statement was inside the For loop in the trigger code.

 

Based on the other posts for that error, I know that I'll need to use Sets and Maps to get it to work, but has anyone written a similar trigger before?

 

Basically, I need to capture the value of the isActive flag on the user record that corresponds to the Lead owner for each Lead being evaluated by the trigger.

 

Any help is appreciated.

 

Hi All,

 

I'm new to Salesforce and have been looking over some apex code.  If someone could explain what this means I'd be very grateful..

 

 

<c:listjobs rendered="{!bWashdc}" jlocation="Washington, D.C.">

 

Thanks in advance

 

Hello,

 

I'm trying to reproduce the case hierarchy view to show parent and child cases on a single list. I have been able to write the controller to get the values for all the cases in the necessary order. However, I'm having a hard time indenting the case number column for the child cases.

 

Any suggestions?

 

Thanks,

 

Pedro

I have a visual force email template that uses a component to place an attachment into an email.  I also have code in my application that transitions to the the EmailAuthor.jsp page using a url that looks like this:

 

https://na7.salesforce.com/_ui/core/email/author/EmailAuthor?p3_lkid=a0bA0000000A6slIAC&template_id=00XA0000000OHXmMAO

 

As you can see, I am providing a whatId and a template id.

 

When I arrive at the EmailAuthor page, at first glance everything looks good.  I see text from my template in the body and I see data from my relatedTo record properly merged into the email.  Unfortunately though, the attachment does not appear.  If I then click on the button to "select a template" and then choose the template that was provided in the above url, the page refreshes and the attachement is now shown on the page.  Of course, the whole reason why I provided the template id in the url was so the user doesn't have to select it.

 

Has anyone encountered this problem before and found a way to resolve it?

 

My template looks like:

 

<messaging:emailTemplate subject="Past Due Balancexx" recipientType="Contact" relatedToType="DunningNoticeQueue__c">
  <messaging:htmlEmailBody >
     <br><apex:image value="{!relatedTo.Image_1_Web_Address__c}" />
     <br><br><br>Dear {!recipient.firstName}:

     <br><br>This is to inform you that you owe: {!relatedTo.AR_Summary_Unworked__r.Total_AR_Balance__c}
     <br><!apex:image value="{!relatedTo.Image_1_Web_Address__c}" />
  </messaging:htmlEmailBody>
  <messaging:attachment renderAs="application/vnd.ms-excel" filename="invoices" >  
     <c:DunningInvoiceAttachment dunningQueueId="{!relatedTo.Id}"/>  
  </messaging:attachment>
</messaging:emailTemplate>

 

 

Is there a document that exists that explains the different types of licenses that can be used with Sites for authentication?  

 

What are the limits of the new Authenticated Sites user?   Can you access standard objects?   

 

Thank you,

 

Jeremy

Hello, I have a query to get the Opportunity and associated opportunity line items via the following SOQL which works very well:

OldOpp = [Select Id, name, Probability, StageName, CloseDate, OwnerId, AccountId, Type, Sales_Contact__c, Type_2__c, Sector__c, CurrencyIsoCode, Payment_Terms__c,Lost_Reason__c,HPR_Pipeline_Category__c,HPR_Project_Type__c, OnLine_Order_del__c, Description, NextStep, ELN_Application__c, Quote_Good_Through__c,Quote_FormattedId__c,Additional_Conditions__c,Quote_CreatedDate__c , Quote_LastModifiedDate__c,RecordTypeId,Consortia_Name__c,Client_Legal_Contact__c, LeadSource,Bill_To__c,CampaignId,Winning_Competitor__c,Pilot_Start__c, Pilot_End_FQ__c,Phase__c, (Select Id, OpportunityId , Description, PriceBookEntryId, Quantity, TotalPrice, License_Type__c,Product_Type__c from OpportunityLineItems) from opportunity where id = :OppId ];

 

In another function, I DeepClone the Opportunity line items and set values in the newly created line items, however, I am having trouble setting a value in the new line item from the value in old line item ( OldOpp.OpportunityLineItems). See the APEX snippet below:

 

OpportunityLineItem[] products = OldOpp.OpportunityLineItems.DeepClone(false);
for (OpportunityLineItem each :products) {
each.OpportunityId = NewOpp.id;
each.TotalPrice = 0;
each.Description = '[CLONED]' + each.description;
each.Quantity = 1;
each.License_Type__c = OldOpp.OpportunityLineItem.License_Type__c;
/* I've tried the following to no avail....

each.License_Type__c = OldOpp.OpportunityLineITem__r.License_Type__c;

each.License_Type__c = products.License_Type__c;


  */

 

}
insert products;

 So, what I am trying to accomplish is setting the value of License_Type__c in the cloned Line item to thevalue I queried in the first query.  Any suggestions on how to accomplish this?

 

Regards,

 

 

 

Hi,

  I have a google visualization's data table(this is a visual force component) which consist of list of record,my task is if user select a row from the table ,I have to fetch the selected row values from visual force component to my visual force page's controller class (not a component controller).

 

Simply I want to make a communication from vf's custom component to my vf page's controller apex class.

 

Is it possible to make a such communication while selecting the row values?

 

please guide us.

 

<apex:page controller="ParentController"> <apex:form> <apec:pageblock id="pageId"> <c:googleTable jsondata="{!equipment}" barwidth="620" height="14em" Id="component"> <!-- I tried this action supprt to refresh the page,but it doesn't work <apex:actionSupport event="onclick" rerender="pageId" /> --> </c:googleTable> </apec:pageblock> </apex:form> <!-- I need communication from googleTable to ParentController class --> </apex:page>

 

 

 

Thanks in advance

 

Venki

Hi every one,

 

I want to find sum of different input fields from different objects and assign total sumto one field in main object using salesforce.All objects have one common field like SFN Number.In main object this SFN Number is input field.Remaing all other objects have SFN Number field look over to main object SFN Number.Main object have Total amount input field.Remaining all objects have amount inputfield.i want to find the sumof all amounts which have same SFN Numbers and assign it to the total amount field which is in main object corresponding SFN Number record.

 

Plz give me some guidance how to achieve this functionality.

 

Thanks in advance

 

 

Hi,

I am trying to find a way to lock an Opportunity and all child objects once the Opportunity is closed. I can restrict access by putting conditions on the standard buttons (to show an error message, etc), but a malicious user could bypass these. Also this does not protect detail objects, such as those from a 3rd party vendor.

I would like to force the restrictions using access rights, perhaps by setting them in a trigger as the Opportunity becomes closed. Ideally all users except Administrators should be denied access once the Opportunity has become closed.

Is this possible?

Many thanks.

-          Andy


Hi everybody,
 
I'm building an application on Google App Engine, using the web api. The application basically allows you to log in, query for some data and present it.
 
I started by using a developer salesforce account and all worked well: the login and the query.
But then I moved to a "real" salesforce account in a "real" environment.
I manage to login successfully, but when I query for data I get the following error:
 
com.sforce.ws.transport.GAEHttpTransport getContent: getContent: Timeout while fetching: https://na5-api.salesforce.com/services/Soap/u/15.0/00D200000000FyX 
 
I get this even if I narrow my query to a pretty small one.
Are there any timeout settings I should follow?
Is there any difference between a developer account and a "real" account that affects querying?
 
 
Thanks, Neuf. 
  • November 22, 2009
  • Like
  • 0

We're trying to send out ICS attachments for calendar requests, but we can't seem to get this new feature to work correctly.

 

Are there any examples in apex to use these changes?

Are there any special configuration changes necessary?

 

In the general declarations for a class I'm working on, I have:

Code:
 private set<Contact> RelatedCons = new set<Contact> ();

 
this gives me an error of:

    "Compilation error: Set of SOBJECT:Contact not allowed" when I attempt to save it in eclipse.

What's going on?
  • October 16, 2007
  • Like
  • 0
I have a custom object (visit) that is child record of another object(patient). The relationship is one to many, one patient can have many visits. Visit object has multiple record types.
I would like to prohibit duplicate visit types for any one patient. So each patient could have a preop, 1 month and 3 month visit. But I would like to stop a patient from having 2 preop visit types.
 
So the rule would look to see if there are any visit records pre-existing that already contain the master-detail value (this would reference the parent object) and new record type. I think that is the simplest way, but tell me if I am off base
 
thanks for any help
 
 
  • March 22, 2007
  • Like
  • 0