• Pat McQueen
  • NEWBIE
  • 30 Points
  • Member since 2006

  • Chatter
    Feed
  • 1
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 47
    Replies
Hello - I am trying to do a multiple child record create with NGForce.  There is a validation rule on the object.  The problem I have is that when the validation rule stops the insert that I can't seem to capture the error and show the end user why the insert failed.  I tried a basic alert(error.message); and it gives me "Error object undefined"  The code works ... As long as the data entry is perfect.  How do I catch a failure and show the error message to the end user?  All I can show now is a generic "The insert has failed with an error"
 
$scope.createAttend = function(student, rowColor){

                var attendRecord = {Scholarship__c : student.Id ,Possible_Days_in_Attendance__c : this.possibleDays , Days_in_Attendance__c : student.totalAttendance, Excused_Absences__c : student.Excused, Check_in_Date__c : this.checkInDate, Notes__c : student.Notes}
              
               vfr.create("Scholarship_Student_Attendance__c",JSON.stringify(attendRecord)).then(
                
                function(response){
                     $filter('filter')($scope.students, {Id : student.Id})[0].wstate = rowColor;                             
                },
                function (error){
                    alert("The insert has failed with an error."); 
                    console.log(error);
                }
            )
           }

 

Salesforce1 has a great Today page which shows the users calendar mashed up with salesforce.com. It works well when the user is not using Salesforce as their primary calendar.  However many want to use Salesforce as the primary calendar.  So - How then do you display a calendar in Salesforce1?

 

This is a hack - but an easy one which works!  Here is how to add a Salesforce calendar to Salesforce1:

 

1) Create a visualforce page "My Calendar"  Be sure to make the page available for salesforce mobile apps.  The content of the page should be:

 

<apex:page showHeader="false" sidebar="false" >

<div style="overflow:scroll; width:100%; height:100%;">
    <object type="text/html" data="https://na2.salesforce.com/00U/c?isdtp=mn"
            style="overflow:scroll; width:1200px; height:2400px;">
    </object>
</div>

</apex:page>

 

2) Add a VisualForce tab for the visualforce page called my calendar.  Ensure the users can access the tab but make it hidden.  Does not need to be mobile ready as that setting is for the Classic Mobile app.

3) Under Mobile Administration / Moble Navigation add the "My Calendar" Visualforce tab to the selected Navigation menu item.

4) Login to Salesforce1 and celebrate your job well done!

 

I hope you find this as useful as I did.

 

 

 

I am trying to call my internal url , for these i am generating CA-certificate in salesforce.

My  question is do i need to get authorize by third party vendor while i was using only for my internal API.

My  question is do i need to get authorize by third party vendor while i was using only for my internal API.

I am trying to call my internal url , for these i am generating CA-certificate in salesforce.

I run multiple orgs and am centralized support in one org for the users of all the other orgs. Rather than burden them with signing into the Self-Service Portal to view their Cases, I'm considering how best to link them to it seamelessly after they have already signed into their home org. SSO is out, we have no network. oAuth might work if the SSP could sign them in using their User credentials, however I'm most inclined to pass their credentials via POST from within Salesforce.

 

Any better ideas? Any stringent objections?

Hi, I'm new to apex.  I was wondering if there is way to use an apex trigger to change the way Salesforce amortizes revenue.  For example, if an opportunity product revenue is entered for $6800 for a 12 month period, it will automatically allocate $566.00 for each month, and load the remainder in the 12th month.  However, what I would prefer is that its broken down evenly with decimals as $566.66 for the first 11 months, and the final month gets the extra change ($566.74).

 

Would this be possible to achieve with an apex trigger?  Any assistance on this matter is greatly appreciated.

Hi,

 

I am supposed to integrate salesforce with Oracle and i have no idea how this can be done, but reading through blogs i was able to figure out certain things, This is what i have thought about and i am doing presently. i am pushing in data from salesforce to SQL tables using a middleware called Apatar, this is wworking fine but later on i dont know how to get the data in Oracle application does any one know this who can help me out? or writing API's is only the method can any one help me out.  Any freelancer or on paid basis:

 

This is what is supposed to go into Oracle when the order is closed:

The following data should be pushed in from Salesforce to Oracle:

 

When the user changes an opportunity to “Order Won” the following details should be pushed in a sequential manner from Salesforce to Oracle:

1)      The Oracle system should check if the particular customer is present in Oracle or else create a new customer.

2)      The Oracle system should check if the particular contact is present in Oracle or else create a new one.

3)      The Quote/Opportunity details from salesforce (Information required in Oracle to process the Sales Order). Example: Branch, SalesOrder Number, Segment, Customer Profile, P.O Number Etc.

4)      The related line items (Products) with their respective basic price and tax structure.

5)      Post sending if there are any changes in the related Quote/Line Item then the same should be appended in Oracle system

 

Oracle To Salesforce:

Once the order is processed then the invoice number and date should be pushed from Oracle to salesforce.



 

Appreciate your help.

Hi Folks,

 

We're trying to intergrate SFDC with an external system via outbound message, as a security measure I have asked the external system team to lock down their client to only receive message from:

 

 204.14.232.0/21

 96.43.144.0/20

 

the security team on the external system requested a narrower range, as they don't normally open accesses to such broad range of IP addresses.

 

Is there a way to know the exact(or narrower range) IP address of my organization (both for sandbox and production)?  and secondly is there a risk that this IP range (if there is even a way to find that out in the first place) changes over time?

 

Thanks,

Sunny_Slp



Hello,

            I have some issues while building jstree with salesforce. i have attached following files in the the static resource.

 

 

<apex:stylesheet value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/themes/default/style.css')}"/>
     <apex:stylesheet value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/themes/apple/style.css')}"/>  
     <apex:stylesheet value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/themes/classic/style.css')}"/>  
     <apex:stylesheet value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/themes/default-rtl/style.css')}"/>       
     
    
     <apex:includeScript value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/jquery.cookie.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/jquery.hotkeys.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/jquery.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/jquery.jstree.js')}"/>
     <apex:includeScript value="{!$Resource.treejs}"/>

 

 

i have written following code for that but it is not working and giving me javascript error that jstree is not  a function.here is the javascript code given below.

 

  <!--  jquery for activity tree -->
        var selectedActivityName = '';
    	var $jq  = jQuery.noConflict();
    	
			function createRootActivity() {
				nd = $jq("#demo").jstree('get_selected');
				$jq("#demo").jstree("create",-1,false,"No rename",false,false);
			}
			
			//NOT USED AS OF NOW
			function createActivity(e) {
				$jq("#demo").jstree("create"); 
			}
			
			//NOT USED AS OF NOW
			function renameActivity(e) {
				$jq("#demo").jstree("rename"); 
			}
			
			function setSelectedActivity(selActivityName) {
				selectedActivityName = selActivityName;
			}
			
			var newActivitParentName = '';
			function setNewActivityParentName(parentActName) {
				newActivitParentName = parentActName;
			}
			
			var newActivityName = '';
			function setActivityNewName(newName) {
				//alert('newName:'+newName);
				newActivityName = newName;
			}
		
			$jq(function () {
				$jq("#create_1").click(createRootActivity);
				//$jq("#create_2").click(createActivity);
				//$jq("#rename").click(renameActivity);
				
			});
			
			var activityMoved = '';
			var newActivityPosition = '';
			var newActivityParent = '';
			var keepOriginalActivity = '';
			function changePositionOfActivity(activityName,newPosition,newParentAcitivityName, keepOrigNode) {
				//alert("activityName:"+activityName);
				//alert("newPosition:"+newPosition);
				//alert("newParentAcitivityName:"+newParentAcitivityName);
				//alert("keepOrigNode:"+keepOrigNode);
				
				activityMoved = activityName;
				newActivityPosition = newPosition;
				newActivityParent = newParentAcitivityName;
				keepOriginalActivity = keepOrigNode;
			}
		
			$jq(function () {
			    $jq("#demo")
			    .bind("open_node.jstree create_node.jstree close_node.jstree select_node.jstree move_node.jstree rename_node.jstree cut_node.jstree", function (e, data) {
					if(e.type == 'create_node') {
						movObject = data.args[0];
						setNewActivityParentName($jq("#demo").jstree("get_text",movObject));
					}
				    if(e.type == 'move_node') {
						movObject = data.args[0];
						var keepOrigNode = false;
						if(data.args[3]) {keepOrigNode=true;}
						changePositionOfActivity(movObject.o.text(),movObject.cp,$jq("#demo").jstree("get_text",movObject.np),keepOrigNode);
					}
					if(e.type == 'select_node') {
						setSelectedActivity($jq("#demo").jstree("get_text",data.inst.get_selected()));
					}
					if(e.type == 'rename_node') {
						alert("node renamed");
						movObject = data.args[0];
						setActivityNewName($("#demo").jstree("get_text",movObject));
					}
			    })
			        
			    .jstree({
			        "core" : { "initially_open" : [ "root" ] },
			        
			        "html_data" : {
			            "data" : "<ul><li id='rhtml_1'><a href='#'>Root node 1</a><ul><li id='rhtml_2'><a href='#'>Child node 1</a></li><li id='rhtml_3'><a href='#'>Child node 2</a></li><li id='rhtml_4'><a href='#'>Child node 3</a></li><li id='rhtml_5'><a href='#'>Child node 4</a></li></ul></li><li id='rhtml_6'><a href='#'>Root node 2</a></li><li id='rhtml_7'><a href='#'>Root node 3</a></li></ul>"
		
			    	},
			    	"dnd" : {
				    	"drop_finish" : function () {
			                alert("DROP");
			            },
			            "drag_finish" : function (data) {
			                alert("DRAG OK");
			                alert(data.r);
			            },
			    	},
			    	"ui" : {
			            "select_limit" : 1
			        },
			        "contextmenu" : {
				        	"select_node"		: true,
							"show_at_node"		: false,
							"rename" : {
								"label"				: "Rename",
								// The function to execute upon a click
								"action"			: function (obj) { alert('1');this.rename(obj); },
								// All below are optional 
								"_disabled"			: false,		// clicking the item won't do a thing
								"_class"			: "class",	// class is applied to the item LI node
								"separator_before"	: false,	// Insert a separator before the item
								"separator_after"	: true,		// Insert a separator after the item
								// false or string - if does not contain `/` - used as classname
								"icon"				: true,
								"submenu"			: { 
									/* Collection of objects (the same structure) */
								}
							}
						},
			        "plugins" : [ "themes", "html_data", "dnd", "ui", "crrm","contextmenu" ]
			    });
			});

 

 

and page code is given below.

 

 

<apex:outputPanel id="outPanel" >
                                            	<div id="demo" class="demo"></div>   
                                            </apex:outputPanel>

 

if anyone has any idea pleas tell me.

 

 

Hi, we're looking to build a native application on iOS that links to sfdc to centralize all the data, do analytics, etc...

 

However, I'm not sure whether we should build the native app first and then link it to sfdc through api.  The advantage here is that I have complete control over the app and my own company branding on top of it, but negative is losing a lot of the effort sfdc has put into the sfdc mobile app such as developing all the scripts, managing the interface mapping the 2 systems together, dashboards, report, etc.. that's all already there and we'd need to build from scratch.

 

The other alternative is buidling visualforce pages on top of the current sfdc mobile but there seems to be some offline limitations there, while also not being able to control certain parts of the app like camera access and other iphone functions, and most importantly the customer has to download "Salesforcce Mobile" from appstore which just doesn't make a lot of sense if it's our own custom built application.

 

Both sides have obvious beneifts and drawbacks and I was hoping somebody here has some experience or guidance in this area which would be very helpful.  I can see there are some tracks at Dreamforce that address this but I was hoping to get some more clarity before then. Thanks.

 

Derek

We are building a Visualforce page that will work with Salesforce.com mobile on the iPhone.  Our users are going to be in rural and remote areas so we need a VERY light visualforce page.  Right now when we build a VF page with this code it produces includes to three or more JavaScript files and makes the download of the page REALLY slow over low bandwidth.  

 

 

<apex:page controller="CreateOrder" showheader="false" sidebar="false" standardStylesheets="false" action="{!checkPermission}">
<!DOCTYPE HTML>
<meta content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>

 What can I do to eliminate much of the JavaScript to make the page lighter?  Here is what results from the pages above.

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
<!DOCTYPE HTML>
<html><head><script src="/faces/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.AjaxScript" type="text/javascript"></script><script src="/static/060710/js/functions.js" type="text/javascript"></script><script src="/jslibrary/1281554859000/main.js"></script><script src="/jslibrary/labels/1284058836000/en_US.js" type="text/javascript"></script><script src="/static/060710/desktop/desktopAjax.js" type="text/javascript"></script></head>
<meta content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>

 

 

Thanks for any ideas!

 

Pat

 

 

We are looking for creating applications in salesforce that shows GIS maps of ESRI by passing salesforce object data/query, wonders if anyone has ever done this earlier, and is 'feasible'.

Appreciate any samples of projects/code.

 

Thanks

 

Mel