• xnerd00x
  • NEWBIE
  • 0 Points
  • Member since 2009

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

Hi - we currently do not like the fact we have to click through several screens just to add a product.  Therefore, what we have done is create a custom button that goes to a custom object, and the custom object does an insert into the real oppLineItem in the background.  However, the way we tie this custom opp line item back to the opportunity is by passing the opportunity name to the custom opp line item via the URLFOR function.  Unfortunately, it doesn't seem like you can use the opportunityId as one of the params for this function.  This causes a problem when there are two opps with the same name, or similar names (i.e., opp 01 vs. opp 011)

 

Has anyone overridden the adding of opp products in their org?  Any pointers on how it was done?

Hey all,

I have a VF page that has a pageBlockTable section that iterates over all the OpportunityLineItemSchedules for a given OpportunityLineItem.  I would figure that this would sort by the ScheduleDate, but that isn't happening.

 

I was just wondering what controls the sorting for a pageBlockTable section?

 

I got this from the VF developer's guide, but not sure what it means by "current view".  Can anyone enlighten me?

When you are using a standard list controller, the returned records sort on the frst column of data, as defned by the current view, even if that column is not rendered.When you use an extension or custom list controller, you can control the sort method.

 

Here's my very simple code:

 

<apex:pageBlock title="Schedule">
<apex:pageBlockTable value="{!OpportunityLineItem.OpportunityLineItemSchedules}" var="sch" rows="100">
<apex:column value="{!sch.ScheduleDate}"/>
<apex:column value="{!sch.Revenue}"/>
<apex:column value="{!sch.Description}"/>
</apex:pageBlockTable>
</apex:pageBlock>

 

 Oh, and in addition, the out of the box related list *does* show the sort order that I'm looking for.

 

Message Edited by xnerd00x on 04-02-2009 12:35 PM

Sorry for the x-post, but hopefully maybe I can get an answer here?

 

Hi all,

We have a requirement at our company to add a related list to the delivered user object. However,salesforce doesn't allow the user object to have a related list.  So we decided to create a new custom object called user_default that links back to the regular user object.

 

Things we've tried:

  • Creating a user_default record after insert into the user table.  However salesforce gives us an error saying that any change to the user set-up object cannot be accompanied by an insert/update to a non-setup object. 
  • Have a custom link on the page that would take the user to a 'new' user default page with their user id auto-filled in IF the row did not exist already.  If it did exist, we would like to take them to the already created page.

 

Being new to salesforce, I'm not quite sure how to do option 2.  I'm thinking I need a SOQL statement to query the user_default object to see whether that user_id exists, and if so, then build the link appropriately.  However, I don't see how you can execute a SOQL query within the link.  I know you can make an apex call, but according to what I've read, you can only return a success/failure from it (I would need the user_default Id returned).

 

Any ideas on how to do this?  Is my approach even viable?  Or is there a different approach I can take?

 

p.s. VisualForce pages are currently not in scope for our project, so non-VF solutions would be appreciated, but that doesn't mean to not respond if a VF solution is all that's available.

 

Thanks in advance.

Hi all,

We have a requirement at our company to add a related list to the delivered user object. However,salesforce doesn't allow the user object to have a related list.  So we decided to create a new custom object called user_default that link back to the regular user object.

 

However, when we tried to create the user_default object after insert into the user table, salesforce gave us an error saying that any change to the user set-up object cannot be accompanied by an insert/update to a non-setup object.  Soooo... we decided to have a link on the page that would take the user to a 'new' user default page with their user id auto-filled in IF the row did not exist already.  If it did exist, we would like to take them to the already created page.

 

Being new to salesforce, I'm not quite sure how to do this.  I'm thinking I need a SOQL statement to query the user_default object to see whether that user_id exists, and if so, then build the link appropriately.  However, I don't see how you can execute a SOQL query within the link.  I know you can make an apex call, but according to what I've read, you can only return a success/failure from it (I would need the user_default Id returned).

 

Any ideas on how to do this?  Is my approach even viable?  Or is there a different approach I can take?

 

p.s. VisualForce pages are currently not in scope for our project, so non-VF solutions would be appreciated, but that doesn't mean to not respond if a VF solution is all that's available.

 

Thanks in advance.

Hi,

 

I am trying to set the RecordType in a before insert trigger for web to case input. The trigger code is:      

trigger CaseSetupTrigger on Case (before insert){
for (Case c: Trigger.new) {
c.RecordType = [select Id from RecordType where Name = 'Canada' and SobjectType = 'Case'];
}
}

I know the code above works as I can see the correct RecordTypeID in the debug log for some workflow rules that use the RecordType. The problem is that when the case is finally saved the RecordType has been overwritten with the default RecordType for unassigned cases. There are no workflow rules that set the RecordType. The workflow rules also use $RecordType.Name which is the name of the default recordType and not Canada as would be expected.

 

I have tried changing the case setting for "Choose the desired behavior to use when applying assignment rules to manually created records:" to "Keep existing Record Type" but this has no effect. 

 

I'm guessing that this has something to do with the order that triggers web to case and workflow rules fire but I can't seem to pin it down.

 

Any suggestions on how to get the record type set in a before insert trigger to actually stick for a web to case and not get changed?

 

Thanks

 

Hey all,

I have a VF page that has a pageBlockTable section that iterates over all the OpportunityLineItemSchedules for a given OpportunityLineItem.  I would figure that this would sort by the ScheduleDate, but that isn't happening.

 

I was just wondering what controls the sorting for a pageBlockTable section?

 

I got this from the VF developer's guide, but not sure what it means by "current view".  Can anyone enlighten me?

When you are using a standard list controller, the returned records sort on the frst column of data, as defned by the current view, even if that column is not rendered.When you use an extension or custom list controller, you can control the sort method.

 

Here's my very simple code:

 

<apex:pageBlock title="Schedule">
<apex:pageBlockTable value="{!OpportunityLineItem.OpportunityLineItemSchedules}" var="sch" rows="100">
<apex:column value="{!sch.ScheduleDate}"/>
<apex:column value="{!sch.Revenue}"/>
<apex:column value="{!sch.Description}"/>
</apex:pageBlockTable>
</apex:pageBlock>

 

 Oh, and in addition, the out of the box related list *does* show the sort order that I'm looking for.

 

Message Edited by xnerd00x on 04-02-2009 12:35 PM
I'm adding a related list to custom VF page, but I want to remove the "New xyz" button from the list. I removed the button from the list on the standard page layout, but that had no impact.
  • April 02, 2009
  • Like
  • 0

Hi all,

 

I'm trying to select all the fields in salesforce for a given account and then put these into an array of strings so I can then send them to my web service, however, I cannot find any way of either doing a Select * from the database or putting the results into an Array.

 

Thanks

 

James

How could one write code to return the value of picklist?
  • March 16, 2009
  • Like
  • 0