• oski1993
  • 0 Points
  • Member since 2010

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 7



I am trying to develop a trigger on a custom object ("Order"), that will automatically share the object with the current user's "Portal Role and Subordinates" on insert/update.

I am able to add the user itself to the "sharing" list via APEX, but have been unable to find a way to instead add the user's "Portal Role and Subordinates" to the sharing list via the APEX trigger.

Is it even possible to access the portal roles in this way via APEX triggers? If not, does anyone know of any workaround?




Thanks in advance. 

We're in the process of evaluating the Force.com PaaS.  We've happily used Perforce as our SCM tool for many, many years, and of course Eclipse (and most other tools) offer extremely robust support for Perforce.  While I've found that the Force.com IDE plug-in and the Perforce plug-in can co-exist, it doesn't exactly seem to be a harmonious pairing.  Operations in Perforce are much more explicit than in other SCM systems, in particular SVN.


For example, by default files synced to the client from Perforce are read-only until explicitly opened for edit, and files added to the filesystem are unknown to Perforce until they are explicitly added.  Files can be added or updated via the Force.com IDE plug-in as a result of changes made through the Web system menu, e.g., in-browser editing of VisualForce pages, changes to custom objects and attributes, etc.  These changes are brought to the client by doing a Refresh from Server or Synchronize with Server.  When this happens, if the files are read-only the Force.com IDE complains that it can't overwrite a read-only file.  I would hope/expect that it would instead engage any active Team plug-in to ask the user whether it should be checked out for edit.  Similar with any added files.  Instead I have to go to the top of the tree and explicitly check out everything for edit, mark everything for add, and then revert all unchanged files to see my "real" changelist.  Alternatively I can set my Perforce client spec to be "allwrite", but it still doesn't really know which files have been edited or added, so while I don't get the complaints about read-only files, I still have to edit/add the files explicitly.
Hopefully I'm just missing something in the Force.com IDE plug-in, the Perforce plug-in, or Eclipse in general.  I'm very concerned about the potential for human error with the current process...enough so that we're discussing whether perhaps a stateless SCM system like SVN might be better, at least for the Force.com portion of the product.
Thanks in advance for any advice!  I may send the same thing to Perforce support to see if I can make progress on a solution.


We are working on working solution, which will build a connection between SFDC sandbox (org) with a local version controlling system such as Perforce, then we can:

  • Setup a reocurrence cron job to automatically retrieve all meta data, even several kind of customer data from SFDC cloud, then check into version controlling.  All meta data type are supported.  Meta data folder structure are auto subscribed.  This is very useful for development team and administration team to control the whole copy of code.  With powerful feature on Perforce we can easily tracky, compare, merge revision on Perforce.
  • We setup multiple code streams on version controlling system to support parallel development.  With our tool we can support code stream setup, new branch, integrate and propagate process in a semi-auto approach with manually resolve conflicts.
  • We have a tool which is leverage SFDC Migration Tool (ant based) to deploy user selected list of meta data from Perfoce repository to SFDC cloud with just one click.  We develop a user code selection set describing format, build_manifest which will enable the code set by development team or projects.

Drop me an email for detail at lycenway@gmail.com if you are interested in.


We will post more detail soon.   Stay tuned.

I've been experiencing some strange behavior.


This code in a Visualforce page:



	          <option value="{!v.so.value}" {!IF(v.selected == TRUE,'selected="selected"','')}>{!v.so.label}, {!IF(v.selected == TRUE,'selected','not selected')}</option>



Results in this HTML:



           <option selected="selected" value="Option 5" >Option 5, not selected</option>


Note two very bizarre things:


(1) The order of the elements in the option (selected and value) is reversed.



(2) It always renders the if true condition even when the condition is false (this happens only inside the element tag, not for HTML).



Ideas as to why either of these is happening?



I have an unusual problem. I  have developed an Apex class which implments schedulable.  I go into Setup -> Develop -> Apex Classes -> Schedule Apex and fill in the form. Now, when I'm selecting the class I just press the icon to give me a list and it only returns the one class which implements schedulable, which would appear the smart way of letting you select the class.


However, I get the following error -

Error: You must select an Apex class that implements the Schedulable interface.


I'm really baffled by this, see code below.


global class TimesheetWeeklyJob implements Schedulable{
    global void execute( SchedulableContext SC ) {


I've just started working in the Force development platform and need to have a Workflow rule run on all contact records once a day to send an email reminder to sales people when a date matches the frequency they want to re-contact the prospect.


I want to have this date field checked daily on all prospects and if it matches today's date send the salesperson an email with basic conact info and then update the date field by adding the number of days specified in the frequency field to todays date.

I can get all of that done in the Force platform if I change the date field manually to today's date, but I want it to check all the Prospect records automatically and compare the Trigger date to Today().

I downloaded Cronkit but I don't have any experience with Apex (I have done some programming in ASP in the past) and don't know how to construct the custom batch job that Cronkit requires.

If someone has a sample of code that works in a similar way, or can tell me how it might be done without an add on like CronKit, I would really appreciate, I would really appreciate the info.



  • August 18, 2009
  • Like
  • 0