• Leonard
  • NEWBIE
  • -1 Points
  • Member since 2008

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

I have two Sharing Reasons on a custom object in a recruiting app.

 

If the candidate goes to "employee" status, i want to only share with the management group.

 

If the candidate goes to any other status, I will share with the employee group.

 

I have an after insert, update trigger on my candidate object. In the trigger I pull the existing shares like this:

 

 

	List <T7Candidate__Share> candidateShares = [SELECT Id, ParentId, UserOrGroupId,AccessLevel,RowCause FROM T7Candidate__Share];

Then I remove any exisitng Sharing Reasons (except for 'Owner'). To bring the sharing rules back down to Owner.

 

Then I generate a new Sharing Reason and append it to the share list and push it back up with:

 

 

		Database.Saveresult[] canShareInsertResult = Database.insert(candidateShares,false);

I'm debugging the entire process and here's what I see:

 

 

1. Step one: I change the candidate status to a non-employee status and the Employee Share Reason is generated fine.

2. Step two: I change the candidate status to employee and the Management Share Reason replaces the Employee Share Reason when I inspect the Debug Logs

3. Step three: When I inspect the sharing directly on the object from the salesforce site, it shows me that both reasons are now attached to the object

 

Is my problem inserting and not upserting?

 

 

I have a custom object with Apex Sharing Reasons attached to them. When I click to inspect an object instance, I don't see any sharing reasons in the view. How can I see the sharing rules for that object in salesforce?

I'm trying to setup a Sharing Reason and I'm having some issues.

 

Here are the steps and conditions I'm working with.

 

1. I'm working in the sandbox.

2. I have a custom object with a default sharing setting of "Private"

3. On my custom object, I created an Apex Sharing Reason. I created it by going to Setup > Create > Objects > My_Object__c and then adding a new Apex Sharing Reason

 

Now, I'm getting an "invalid share row cause" when I try the following in a Trigger

 

 

Candidate__Share managementShare = new Candidate__Share();
			managementShare.ParentId = can.Id;
			managementShare.UserOrGroupId = managementGroup.Id;
			managementShare.AccessLevel = 'edit';
			managementShare.RowCause = Schema.Candidate__Share.rowCause.Employee_Sharing_Reason;
			

 

 

What am I doing wrong? If I change the RowCause to:

 

 

Schema.Candidate__Share.RowCause.Owner

The error is gone but I'm not getting the share I want.

 

I don't see Notes in the Customize menu and I need to add a trigger to a Note object. How can I do it?

All of my mac browsers (ff, chrome, safari and opera) show this site with missing images and the page body is cramped into a width that's smaller than the page layout.

 

Is everyone having that experience? The site is really hard to use.

I want to write a trigger on a Note that fires only if the Note is being created on a certain custom object. What's the best way to do that?

 

Is there a way to determine the type of object represented by the Note's OwnerId value?

I have a custom object. When users are editing the object, I'd like to have the ability to c.r.u.d the Attachments, but not add Notes. By default, this doesn't seem possible. Am I wrong?

I have a visualforce page in a tab and I want to hide the salesforce side panel. I understand that web tabs have this capability but i need it for a visualforce page (with an embedded static resource).

I have a flex based static resource that I'd like to take the full width and height of the visualforce page. Setting 100% values in apex doesn't do the trick.

If I write a standalone app, let's say a desktop or web-based app with a Front End that lives on its own but uses a SF backend, can I distribute and promote that app through the App Exchange?

I have a recruiting app and what I'd like to do is mark candidates as "employees" and have the records for employees be limited to certain user profiles for my organization. Can I set those types of conditional entitlements? If so, how?

Is there any way to create a full screen experience for my visualforce page while still being hosted on Salesforce? I don't want to migrate the front end to my site unless I have to.

The user doesn't see a new button in the "Triggers" area when viewing a custom object. How do I activate permissions to allow that?

I followed this example for downloading Attachments from Flex

 

 http://blog.nitrogenlabs.com/2008/10/flex-getting-attachments-from.html

 

And I'm getting a Sandbox error.

 

 

*** Security Sandbox Violation *** Connection to https://na2.salesforce.com/servlet/servlet.FileDownload?file=MyFile halted - not permitted from https://c.na2.visual.force.com/resource/1266428442000/MyResource Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: https://c.na2.visual.force.com/resource/1266428442000/MyResource cannot load data from https://na2.salesforce.com/servlet/servlet.FileDownload?file=MyFile. at x at x Error: Request for resource at https://na2.salesforce.com/servlet/servlet.FileDownload?file=MyFile by requestor from https://c.na2.visual.force.com/resource/1266428442000/MyResource is denied due to lack of policy file permissions.

 

If I grab the url of the attachment and paste it directly into the browser, I can download the file with no authentication challenge or errors.

 

 

 

How do I query Opportunities, OpportunityLineItems and OpportunityLineItemSchedules in the same query when they don't have a parent / child relationship.
I want a trigger to send an email when a new custom object has been upserted.
I can't capture the binary data of a local file to pass to an Attachment SObject in flex. There doesn't seem to be anything in the swc to handle file uploads.

I'm having trouble getting running a query for attachments on my custom object.

 

 

SELECT Custom__c.Last_Name__c, (SELECT Attachments.Id, Attachments.Name, Attachments.ParentId, Attachments.ContentType FROM Attachments) FROM Custom__c

 

 

 

I'm trying an upsert on a custom SObject and I'm getting an InvalidSObjectFault with an "INVALID_TYPE" exceptionCode.

 

 

var obj:SObject = new SObject("T7_Candidate__c"); obj.Id = idNum; obj.First_Name__c = this.firstname.text; obj.Last_Name__c = this.lastname.text; var arr:Array = new Array(); arr.push(obj); connection.upsert("Id",arr,new AsyncResponder(upsertResult,upsertFault));

 

 

 

When I go to Setup/Create/Objects/MyCustomObject I don't see

 

1. The api names for the various properties

2. external id fields

3. The id # for the object

 

How can i inspect the custom object?

I don't see Notes in the Customize menu and I need to add a trigger to a Note object. How can I do it?

I have a flex based static resource that I'd like to take the full width and height of the visualforce page. Setting 100% values in apex doesn't do the trick.

I have a recruiting app and what I'd like to do is mark candidates as "employees" and have the records for employees be limited to certain user profiles for my organization. Can I set those types of conditional entitlements? If so, how?

How do I query Opportunities, OpportunityLineItems and OpportunityLineItemSchedules in the same query when they don't have a parent / child relationship.
I can't capture the binary data of a local file to pass to an Attachment SObject in flex. There doesn't seem to be anything in the swc to handle file uploads.

How can I get / set an attachment to a Custom Object? When I inspect my Custom Object, I don't see an Attachment property. I've tried multiple queries with no success.

I'm having trouble getting a basic hello-world level Flex app to integrate with a SalesForce Page.

Not sure what the issue is.

 

Here's the SF page. I have the .swf as a Static Resource and I'm passing in the session Id and server url.

 

<apex:page > <!-- Begin Default Content REMOVE THIS --> <h1>Congratulations</h1> This is your new Page <apex:pageBlock title="Active Opportunities"> <apex:flash src="{!$Resource.Factored_Forecast_Control}" width="500" height="300" flashvars="sid={!$Api.Session_ID}&surl={!$Api.Partner_Server_URL_90}"/> </apex:pageBlock> <!-- End Default Content REMOVE THIS --> </apex:page>

 

 ...and here's the Flex piece. It fires a basic LoginRequest. It results in an error and I'm not clear why.

 

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:salesforce="http://www.salesforce.com/" creationComplete="init()"> <mx:Script> <![CDATA[ import com.salesforce.objects.LoginRequest; import com.salesforce.AsyncResponder; import com.salesforce.results.LoginResult; import mx.controls.Alert; public var lr:LoginRequest; public var lar:AsyncResponder = new AsyncResponder(loginSuccess,faultHandler); private function init():void{ lr = new LoginRequest(); lr.session_id = parameters.sid; lr.server_url = parameters.surl; lr.callback = lar; force.login(lr); } private function faultHandler(result:Object):void { for(var i in result){ Alert.show(i + " is " + result[i]); } } private function loginSuccess(result:LoginResult):void{ } ]]> </mx:Script> <salesforce:Connection id="force"/> </mx:Application>

 

 

 

 

Hi,

 

I'm developing a sample application in flex. I'm trying to store the records from flex to salesforce.com, can anyone tell how to do this in flex.

 

I had tried this code to insert records from flex but its not working.Is anything wrong in my code pls check it and reply.

 

 

private function sampleinsert(lr:Object):void { force.query("SELECT Id,Department FROM Contact " + "WHERE Contact.Email='bond_john@grandhotels.com'" , new AsyncResponder(function(result:QueryResult):void { opps = result.records; })); var temp:String; //opps.Department="Medicare"; var newItems:Array= new Array(); newItem=new SObject("Contact"); //Alert.show(opps.getItemAt(0,0).Id.toString()); newItem.Id=opps.getItemAt(0,0).Id; //newItem.Name=textinput.text; //temp=opps.getItemAt(0,1).Department; newItem.Department="ssssss"; Alert.show(newItem.Department.tostring()); newItems.push(newItem); force.upsert("Id",[newItems], new AsyncResponder( function ():void{ Alert.show("ok seems like authors are saved"); } )); }

 

Thank You.
Message Edited by Coder on 10-22-2009 11:28 PM
  • October 23, 2009
  • Like
  • 0

has anyone successfully integrated a flex upload control with force.com or salesforce.com, I am trying to implement a flex control for file upload (case attachment), please let me know 

 

thanks for your help

 

url to swfupload: http://swfupload.org/ 

Here is part of the subroutine:

        my $self       = shift;
        my $changelist = shift;
        my $sObject_type = 'ADM_Work__c';

        if( $self->{_p4status} eq $GUS::OPEN_ONCE ) {

            print "\n\n ----------------------------------------------------------------------\n";
            print "$sObject_type, id => " . $self->{_id} . ", Perforce_Status__c => $GUS::NONE)";
            print "\n\n ----------------------------------------------------------------------\n";

            my $result = $self->{_sfdc}->update(type => $sObject_type, id => $self->{_id}, Perforce_Status__c => $GUS::NONE);
           
            if ($result->valueof("//updateResponse/result/success") ne 'true') {
                # log problem here
                print "unable to update p4 status";
            } else {
                $self->{_p4status} = $GUS::NONE;
            }
       
Here is the output:
 ----------------------------------------------------------------------
ADM_Work__c, id => a0HT0000000KIZbMAO, Perforce_Status__c => --None--)

 ----------------------------------------------------------------------

Type looks to be getting set from the print statement output??
I'm trying to get a simple HelloWorld application working on my local machine using the FlexBuilder v3 Beta and the most recent SFC Flex Toolkit. I've followed the code exactly as documented in the samples found online,  various screencasts, and even in downloaded the samples. Now matter what I do, I get the following error in the login step:

[FaultEvent fault=[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] messageId="274B3986-6992-1A79-1276-D7DF53D645C3" type="fault" bubbles=false cancelable=true eventPhase=2]

The login function I'm using is below:
    private function doLogin():void
    {
     var lr:LoginRequest = new LoginRequest();
     lr.username = "devlogin@blablabla.com";
     lr.password = "devloginpassword";
     lr.server_url = "http://www.salesforce.com/services/Soap/u/9.0";
     lr.callback = new AsyncResponder(loginResult, loginFault);
     conn.login(lr);
    }
What am I doing wrong?

Thanks for any help,

Mike