• SaintMichael
  • NEWBIE
  • 325 Points
  • Member since 2010

  • Chatter
    Feed
  • 13
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 69
    Questions
  • 91
    Replies
JQuery mobile is not filtering my list. The list change with the select box works.
I cannot get the text filter to work.

The same code works elsewhere, but not on this project.

I tried updated the libraries to no avail.

Here is the Visualforce page:

<apex:page controller="OnlineStoreOrderController" showHeader="false"
sidebar="false">
<head>

<meta name="viewport"
  content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<apex:includeScript value="{!$Resource.jquery191}" />
<apex:includeScript value="{!URLFOR($Resource.jquerymobile130, 'jquery.mobile-1.3.0.min.js')}" />
<apex:stylesheet value="{!URLFOR($Resource.jquerymobile130, 'jquery.mobile-1.3.0.min.css')}" />


<script>

        $(document).ready(function() {

             $("#conference").on("change", function(){
                //$.mobile.showPageLoadingMsg();
               OnlineStoreOrderController.getSessions(this.value,handleGetSessions)
              //$.mobile.hidePageLoadingMsg();
              });

        });

  function handleGetSessions(result, event) {
      $("#sessionList").empty();
      $.each(result, function(index, value){
         $('#sessionList').
         append('<li data-filtertext="value.Name value.Session_Name__c" data-role=\"list-divider\">'+value.Name+' - ' + value.Session_Name__c+'</li>');

    });
    $("#sessionList").listview("refresh");
}

</script>
</head>
<select name="conference" id="conference">
  <option value="All">select a conference</option>
  <apex:repeat value="{!conferences}" var="conference">
   <option value="{!conference.Id}">{!conference.Name}</option>
  </apex:repeat>
</select>

<!-- page content -->
<div id="#content" data-role="content">
<ul id="sessionList" data-role="listview" data-filter="true"
  data-inset="true">
  <apex:repeat value="{!sessions}" var="session">
   <li data-theme="d"
    data-filtertext="{!session.Name} {!session.Session_Name__c}">
   {!session.Name} - {!session.Session_Name__c}</li>

  </apex:repeat>
</ul>
</div>
</apex:page>
Does Amazon EC2 using PHP use up salesforce API requests?
I have a Controller with a remote action.

I would like to move that remote action to a nested apex class.

Controller1.controller2.remoteAction

Currently, I have the remote action in Controller1:
MemberProfileController.saveMPUPhoto('{!memberProfileUpdateController.account.Id}', function(result, event)

but I want to move it to the nested controller:
MemberProfileController.nestedContrller.saveMPUPhoto('{!memberProfileUpdateController.account.Id}', function(result, event)



How can I access the method, as a remote action, inside the nested class?
This does not work:
MemberProfileController.nestedController.saveMPUPhoto('{!memberProfileUpdateController.account.Id}', function(result, event)

nor does trying to get an instance of it in javascript.

I am able to show images, with no file extension, in my force site.

 

However, I am not able to show that same image inside of salesforce on a record detail page.

 

Any one ever get around, or experience this?

I successfully integrated the Amazon toolkit.

 

  1. staff can login into salesforce to upload a photo to amazon and create a salesforce S3 Object record too. The S3 Object record allows me to connect the S3 Object to the external users' accounts in salesforce.
  2. My external force site users can upload their photo as well, no record created, just a file lands in a S3 bucket.

I am trying to decide between the 2 options.

 

If I use option 1, how should I get the photos from external users to my staff to perform the upload and approval? Email is possible, but kinda crude??

 

If I use option 2, I need a way to approve or disapprove the photo before it becomes public?

 

I guess the biggest issue is properly tying the photo back to the record if I let external users upload photos. Also, Should I just download the images from the bucket and let staff re-upload into salesforce?

I have an online store selling Sessions.

Each Session has multiple presentations.

A Session Package is made up of multiple sessions.

 

A session looks up to it's parent, which is a conference object, since we have yearly conferences.

 

I need a way to associate multiple sessions with multiple packages.

Package1 = Session1, Session2,Session18

Package2 = Session1,Session12,Session14

Package3 = Session12,Session14,Sesson2

 

I cannot use the master/detail or lookup, that forces me to use too many objects, also, I already have relationships on those objects.

 

Any ideas on how you would create this package builder?

Im thinking of using salesforce as the admin/CRUD portion for my online store.

I think I want to use salesforce as the product maker.

 

My problem is: I am worried about how cumbersome creating a product can be.

 

Here are the imaginary steps:

  1. I have to make a Product Object.
  2. make a price object
  3. attach the product and price objects
  4. create a Product_Attribute object
  5. make a Store Attribute (color, size, dimension based attributes), then connect that to the Product_Attribute
  6. connect the Product_Attribute to the Product Object

The point is, If I want to create a product 'Mug' with different sizes, I would have to create 3 objects, and an object for each color.

Product

-Price

-Product Attribute

-----Attribute(red)

-----Attribute(blue)

-----Attribute(Green)

 

Keep in mind that we would have an hourly job that copies the products from salesforce to mysql, for use by the online store, existing outside of salesforce.

 

Do you think this is ridiculous?

Should I go with something more user friendly?

Any opinions?

 

 

 

 

I am using JQuery Mobile for an Apex/Visualforce page.

The problem is I am trying to section off 2 separate repeat tags, but when I adjust my repeat tags to certain divs,

 

I get the error message:

Description	Resource	Path	Location	Type
Save error: Unknown property 'InventoryExtension.product'	

 

Here is what I am trying:

 

<div data-role="page" data-theme="b" id="detailpage{!product.Id}">
		
		<!-- page header -->
		<div data-role="header"><!-- button for going back to mainpage -->
			<a href='#mainpage' id="backInventory" class='ui-btn-left'
			data-icon='home'> Home </a> <!-- page title -->
			<h1>Edit</h1>
		</div>
		
		<!-- page content -->
		<apex:repeat value="{!products}" var="product">
			<div id="#content" data-role="content">
				<h2 id="name"><label for="model{!product.Id}">
				<h2>Model</h2>
				</label> <input type="text" value="{!product.Model__c}"
				id="model{!product.Id}" /></h2>



			<div data-role="fieldcontain">
				<fieldset data-role="controlgroup">
					<apex:outputPanel rendered="{!product.checked_out__c}">
						<input checked="checked" data-mini="true" type="checkbox"
						name="checked_out" id="checked_out{!product.Id}"
						value="{!product.checked_out__c}" />
					</apex:outputPanel> 
					
					<apex:outputPanel rendered="{!!product.checked_out__c}">
						<input data-mini="true" type="checkbox" name="checked_out"
						id="checked_out{!product.Id}" value="{!product.checked_out__c}" />
					</apex:outputPanel> 
					<label for="checked_out{!product.Id}" data-inline="true">CheckedOut:</label>
				</fieldset>
			</div>



		<div data-role="fieldcontain"><label
			for="asset_tag{!product.Id}">Asset tag:</label> <input type="text"
			id="asset_tag{!product.Id}" value="{!product.Asset_Tag__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="operating_system{!product.Id}">Operating System:</label> <input
			type="text" id="operating_system{!product.Id}"
			value="{!product.Operating_System__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="serial_number{!product.Id}">Serial #:</label> <input type="text"
			id="serial_number{!product.Id}" value="{!product.Serial_Number__c}" />
		</div>

		<div data-role="fieldcontain"><label for="notes{!product.Id}">Notes:</label>
		<textarea id="notes{!product.Id}" value="{!product.Notes__c}">{!product.Notes__c}</textarea>
		</div>

		<div data-role="fieldcontain"><label for="hostname{!product.Id}">Host
		Name:</label> <input type="text" id="hostname{!product.Id}"
			value="{!product.Hostname__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="memory_size{!product.Id}">Memory Size:</label> <input
			type="text" id="memory_size{!product.Id}"
			value="{!product.Memory_Size__c}" />
		</div>



		<a href="#" data-role="button" data-id="{!product.Id}"
			class="updateButton" data-theme="b"> Update </a>
	
	</div>
</apex:repeat>
	</div>

 

I don't get any errors if I wrap the repeat tags around the entire div like so:

<apex:repeat value="{!products}" var="product">
	<div data-role="page" data-theme="b" id="detailpage{!product.Id}">
		
		<!-- page header -->
		<div data-role="header"><!-- button for going back to mainpage -->
			<a href='#mainpage' id="backInventory" class='ui-btn-left'
			data-icon='home'> Home </a> <!-- page title -->
			<h1>Edit</h1>
		</div>
		
		<!-- page content -->
		
			<div id="#content" data-role="content">
				<h2 id="name"><label for="model{!product.Id}">
				<h2>Model</h2>
				</label> <input type="text" value="{!product.Model__c}"
				id="model{!product.Id}" /></h2>



			<div data-role="fieldcontain">
				<fieldset data-role="controlgroup">
					<apex:outputPanel rendered="{!product.checked_out__c}">
						<input checked="checked" data-mini="true" type="checkbox"
						name="checked_out" id="checked_out{!product.Id}"
						value="{!product.checked_out__c}" />
					</apex:outputPanel> 
					
					<apex:outputPanel rendered="{!!product.checked_out__c}">
						<input data-mini="true" type="checkbox" name="checked_out"
						id="checked_out{!product.Id}" value="{!product.checked_out__c}" />
					</apex:outputPanel> 
					<label for="checked_out{!product.Id}" data-inline="true">CheckedOut:</label>
				</fieldset>
			</div>



		<div data-role="fieldcontain"><label
			for="asset_tag{!product.Id}">Asset tag:</label> <input type="text"
			id="asset_tag{!product.Id}" value="{!product.Asset_Tag__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="operating_system{!product.Id}">Operating System:</label> <input
			type="text" id="operating_system{!product.Id}"
			value="{!product.Operating_System__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="serial_number{!product.Id}">Serial #:</label> <input type="text"
			id="serial_number{!product.Id}" value="{!product.Serial_Number__c}" />
		</div>

		<div data-role="fieldcontain"><label for="notes{!product.Id}">Notes:</label>
		<textarea id="notes{!product.Id}" value="{!product.Notes__c}">{!product.Notes__c}</textarea>
		</div>

		<div data-role="fieldcontain"><label for="hostname{!product.Id}">Host
		Name:</label> <input type="text" id="hostname{!product.Id}"
			value="{!product.Hostname__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="memory_size{!product.Id}">Memory Size:</label> <input
			type="text" id="memory_size{!product.Id}"
			value="{!product.Memory_Size__c}" />
		</div>



		<a href="#" data-role="button" data-id="{!product.Id}"
			class="updateButton" data-theme="b"> Update </a>
	
	</div>

	</div>

</apex:repeat>

 

Any ideas? I really would like to have to separate sections within the same page-section.

I have an equipment inventory app.

I'd like to use a select list to change the 'Category':

 

 $("#categories").on("change", function(){
                alert(this.value);
                InventoryExtension.getEquipment(this.value,handleUpdate );
               //$("#equipmentList").listview('refresh');
               $("#equipmentList").trigger('create');
                
});

 The Apex method is getting called, the parameter 'this.value' from the click shows in the Apex method as well.

It comes in as 'Laptop' or 'desktop', fine.

 

Here is the Apex method:

 public static List<Equipment__c> getEquipment(String myCategory){
             
             
                if(myCategory== null){
                    products = [SELECT Id, Model__c,checked_out__c,Operating_System__c,Serial_Number__c,
                    Asset_Tag__c,Hostname__c,Notes__c,Memory_Size__c  from Equipment__c];   
                }else{
                	System.debug('My Category: '+myCategory);
                 	products = [SELECT Id, Model__c,checked_out__c,Operating_System__c,Serial_Number__c,
                    Asset_Tag__c,Hostname__c,Notes__c,Memory_Size__c  from Equipment__c 
                                    where RecordType.Name =: myCategory];      
                }
                
                return products;
               
            }

 

 

I can see that the data is coming back from the post correctly. If I choose 'Laptop' I am getting laptop data.

 

I don't understand how to update the view of the listview??

Can someone shed some light on this?

 

 Here is the server plain text response:

Response from server: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

 

 

Using JQuery to mobilize some pages in salesforce.

I am trying to use a checkbox, but I cannot get the checkbox value into my object.

 

Here is my code for the checkbox in the viauslforce page:

<div data-role="fieldcontain">
    <fieldset data-role="controlgroup">
	  
	   <input data-mini="true" type="checkbox" name="checked_out" id="checked_out" value="1"/>
	   <label for="checked_out" data-inline="true">Checked Out:</label>
    </fieldset>
</div> 

 

 

Here is the javascript remoting part.

 $(".insertButton").click(function() {
               alert($("#checked_out").val());
                var merchRecord = {
                   
                    Operating_System__c: $("#operating_system").val(),
                    Model__c: $("#model").val(),
                    Asset_Tag__c:$("#asset_tag").val(),
                    checked_out__c:$("#checked_out").val(),
                    Hostname__c: "Hostname"
                };
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem(merchRecord, handleUpdate);
            });

 In the above code, the alert proves to me that the value is a 1 or 0, when I set it so.

Using True, False, 0, 1 does not work.

 

Here is my error:

Insert failed. First exception on row 0; first error: INVALID_TYPE_ON_FIELD_IN_RECORD, 
Checked Out: value not of required type: 1: [checked_out__c]

 Not sure why I cannot get a 0 or a 1 into the object.

Any ideas?

Im trying perform an Insert from my JQUERY mobile page.

 

Ive tried this:

 $(".insertButton").click(function() {
  
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem($("#model").val(),$("#asset_tag").val(),("#operating_system").val(), handleUpdate);
            });

 

Above s no good.

 

I tried this too:

 $(".insertButton").click(function() {
               
                var merchRecord = {
                   
                    Operating_System__c: $("#operating_system").val(),
                    Model__c: $("#model").val(),
                    Asset_Tag__c:$("#asset_tag").val()
                };
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem(merchRecord, handleUpdate);
            });

 

 

Problem is i get this error:

Visualforce Remoting: Parameter length does not match remote action parameters: expected 3 parameters, got

Line 115

 

 

Not quite sure how to perform the insert.

 

Any ideas?

I tried installing the Mobile Components into my dev org, but I always get success: false

 

If I try to access the sample app, I get: Page MobilePage does not exist

 

Anyone experience this?

when viewing my force site pages on iPad, each select list is labled with this text:

 

"0 items"

 

These are actually multi-select list, but they render as select list on mobile/tablet.

When I select 1 item, it properly populates the other list of selected items.

But, each select list is default-labeled with "0 items".

 

Anyone come across this, with a solution?

 

 

I have a force site where I expose some custom and standard objects.

 

In the past I did this without any problems. But I keep getting this error.

I have an update button which calls and update to to account, causing the error.

 

I removed all of the update/upsert statements and I still get the error?

So, I have an update button, linking to a method that has no updates in it,

but I still get the error.

 

Any ideas?

Hey folks,

 

I have a college degree designation object in salesforce, with the choices like so:

MBA, BA, B.S.

 

Currently, we have a trigger that will update another field on the contact object that consists of a string representation of those degrees:

Each degree is concatenated to make the string:

MBA, BS, BA

 

Can this be done with a worlflow instead?

 

I want to change because the trigger is causing problems when I am deploying a rather big application.

Instead of tussling with the trigger and tweaking my test class to no end, I'd like an alternative,namely a workflow, if possibe?

 

 

Is there any way to force apex:inputText to keep the id that I give it?

 

This:

<input id="tags" />

 becomes this:

<input id="j_id0:j_id2:j_id3:j_id4:tags" type="text" name="j_id0:j_id2:j_id3:j_id4:tags" />

 Any way to get the ids to stick?

My autocomplete is getting sabotaged by the id issue.

I have component:

<apex:component >
	<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-1.8.1.min.js')}" />
	<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-ui-1.8.23.custom.min.js')}" />
	
	<link rel="stylesheet" type="text/css"
		href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/smoothness/jquery-ui.css" />


	<!-- Attributes Required for Component -->
	<apex:attribute name="datalist" description="JSON String. the script below turns this intoan auto complete list/type suggest list." type="String" required="true" />
	
	
	
	<script>

	$(function() {

		var availableTags = new Array();
		availableTags = {!datalist};
		//alert(availableTags);
		
		$( "#tags" ).autocomplete({
			source: availableTags
		});
	});

</script>


<div class="demo">

<div class="ui-widget">
	<label for="tags">Tags: </label>
	<input id="tags" />
</div>

</div> 
	
	
</apex:component>

 

The input with id="tags" is an autocomplete, drop down list.

I need to get the value from that input into my controller.

 

I tried using what was mentioned in the forums:

inputHidden

actionFunction

 

I have not been able to get either method working.

 

Here is my current page testing the component:

<apex:page controller="AutoCompleteData">
    
    <script>
    
    function setCurrent(){
    	var currentValue = document.getElementById('tags').value;
    	document.getElementById('inptHdn');
    	
    	
    }
    </script>
    


 
       <c:AutoCompleteComponent datalist="{!JSONString}"/>
		<apex:form >
			<apex:inputHidden value="{!currentValue}" id="inptHdn"/>
			<apex:commandButton onclick="setCurrent();" action="{!log}"></apex:commandButton>
		</apex:form>
		
</apex:page>

 

 And here is the log function in the controller:

public PageReference log(){
	System.debug('Log method: '+currentValue);
	return null;
}

 The autocomplete list shows up properly, I just cannot get it back into my controller.

Any ideas?

 

If you are recommending the inputHidden or actionFunction, please show a good example, please.

 

 

I have a component that provides an autocomplete/type suggest list.

It's currently a component, but the object to search and the fields are hard-coded.

 

How can I get this to become a component where I can pass in the object name and the fields I want searched.

 

I have seen examples using Javascript Remoting, But that is causing me too many issues so far.

 

Can I achieve my goal without using Javascript Remoting?

 

Here is the Class:

global class AutoComplete {


public static String JSONString {get;set;}
public static sObject obj{get;set;}

public AutoComplete(){
	getDesignations();
}


global static String getDesignations(){
	List<Designation_Abbreviation__c> abbs = [Select Id,Name, Designation__r.Name from Designation_Abbreviation__c];
	List<String> designations = new List<String>();
	
	
	for(Designation_Abbreviation__c d: abbs){
		designations.add(d.Name +' - '+d.Designation__r.Name);
	}
	
	JSONString = JSON.serialize(designations);
	
	return JSONString;
}


}

 

Here is the component:

<apex:component controller="AutoComplete">
	<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-1.8.1.min.js')}" />
	<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-ui-1.8.23.custom.min.js')}" />
	<link rel="stylesheet" type="text/css"
		href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/smoothness/jquery-ui.css" />


	<!-- Attributes Required for Component -->
	<apex:attribute name="objectname" description="The object to search and build autocomplete for." type="String" required="false" />
	<apex:attribute name="additionalfields" description="fields to search" type="String" required="false" />
	
	
	<script>

	$(function() {

		var availableTags = new Array();
		availableTags = {!JSONString};
		//alert(availableTags);
		
		$( "#tags" ).autocomplete({
			source: availableTags
		});
	});

</script>




<div class="demo">

<div class="ui-widget">
	<label for="tags">Tags: </label>
	<input id="tags" size="50"/>
</div>

</div> 
	
	
</apex:component>

 

Here is a page testing the component:

<apex:page >
    <apex:form >
       <c:AutoCompleteComponent />
    </apex:form>
</apex:page>

 

Do I need to activate Remote JavaScripting?

 

Here is my controller and visualforce:

 

Controller:

global with sharing class AutoComplete {

public static List<String> designations{get;set;}




public AutoComplete(){
	
}


@RemoteAction
global static List<String> getDesignations(){
	List<Designation_Abbreviation__c> abbs = [Select Name, Designation__r.Name from Designation_Abbreviation__c];
	designations = new List<String>();
	
	Integer x = 0;
	for(Designation_Abbreviation__c d: abbs){
		designations.add(d.Name +' '+d.Designation__r.Name);
		
		
	}
	
	return designations;
}


}

 

VisualForce:

<apex:page controller="AutoComplete">
<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-1.8.1.min.js')}" />

  <apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-ui-1.8.23.custom.min.js')}" />
  <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/smoothness/jquery-ui.css" />

<script type="text/javascript">

	$(function() {
	var availableTags;
	        Visualforce.remoting.Manager.invokeAction(
            '{!$RemoteAction.AutoComplete.getDesignations}',
            function(result, event){
                if (event.status) {
                 	
                 	availableTags = result.designations;
                }else if(event.type == 'exception'){
                	alert (event.message);
                }
            }, 
            {escape: true}
        );
		
		
		
		$( "#tags" ).autocomplete({
			source: availableTags
		});
	});
	
	
	
	
	
	
</script>




<div class="demo">

<div class="ui-widget">
	<label for="tags">Tags: </label>
	<input id="tags"/>
</div>

</div> 





</apex:page>

 

 

In my visualforce page, I have an array:

var availableTags = [
			"ActionScript",
			"AppleScript",
			"Asp",
			"BASIC",
			"C",
			"C++",
			"Clojure",
			"COBOL",
			"ColdFusion",
			"Erlang",
			"Fortran",
			"Groovy",
			"Haskell",
			"Java",
			"JavaScript",
			"Lisp",
			"Perl",
			"PHP",
			"Python",
			"Ruby",
			"Scala",
			"Scheme"
		];
		

 How can I populate this array with data from salesforce?

 

 

I read on the boards that this would work:

availableTags = "{!designations}";

 But it doesnt work. My data is not getting into the javascript array.

I tried this with the repeat tag as mentioned Here

but still no good.

 

Shouldn't this be simple?

 

 

Im thinking of using salesforce as the admin/CRUD portion for my online store.

I think I want to use salesforce as the product maker.

 

My problem is: I am worried about how cumbersome creating a product can be.

 

Here are the imaginary steps:

  1. I have to make a Product Object.
  2. make a price object
  3. attach the product and price objects
  4. create a Product_Attribute object
  5. make a Store Attribute (color, size, dimension based attributes), then connect that to the Product_Attribute
  6. connect the Product_Attribute to the Product Object

The point is, If I want to create a product 'Mug' with different sizes, I would have to create 3 objects, and an object for each color.

Product

-Price

-Product Attribute

-----Attribute(red)

-----Attribute(blue)

-----Attribute(Green)

 

Keep in mind that we would have an hourly job that copies the products from salesforce to mysql, for use by the online store, existing outside of salesforce.

 

Do you think this is ridiculous?

Should I go with something more user friendly?

Any opinions?

 

 

 

 

is anyone missing licenses for Chatter External?

 

When I add external customers to a private customer group, those external customers can see my internal staff Chatter Profiles.

I don't want them to be able to see those.

 

My account exec keeps sending my the same B.S. directions that I have already followed.

 

Is anyone else experiencing this?

JQuery mobile is not filtering my list. The list change with the select box works.
I cannot get the text filter to work.

The same code works elsewhere, but not on this project.

I tried updated the libraries to no avail.

Here is the Visualforce page:

<apex:page controller="OnlineStoreOrderController" showHeader="false"
sidebar="false">
<head>

<meta name="viewport"
  content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<apex:includeScript value="{!$Resource.jquery191}" />
<apex:includeScript value="{!URLFOR($Resource.jquerymobile130, 'jquery.mobile-1.3.0.min.js')}" />
<apex:stylesheet value="{!URLFOR($Resource.jquerymobile130, 'jquery.mobile-1.3.0.min.css')}" />


<script>

        $(document).ready(function() {

             $("#conference").on("change", function(){
                //$.mobile.showPageLoadingMsg();
               OnlineStoreOrderController.getSessions(this.value,handleGetSessions)
              //$.mobile.hidePageLoadingMsg();
              });

        });

  function handleGetSessions(result, event) {
      $("#sessionList").empty();
      $.each(result, function(index, value){
         $('#sessionList').
         append('<li data-filtertext="value.Name value.Session_Name__c" data-role=\"list-divider\">'+value.Name+' - ' + value.Session_Name__c+'</li>');

    });
    $("#sessionList").listview("refresh");
}

</script>
</head>
<select name="conference" id="conference">
  <option value="All">select a conference</option>
  <apex:repeat value="{!conferences}" var="conference">
   <option value="{!conference.Id}">{!conference.Name}</option>
  </apex:repeat>
</select>

<!-- page content -->
<div id="#content" data-role="content">
<ul id="sessionList" data-role="listview" data-filter="true"
  data-inset="true">
  <apex:repeat value="{!sessions}" var="session">
   <li data-theme="d"
    data-filtertext="{!session.Name} {!session.Session_Name__c}">
   {!session.Name} - {!session.Session_Name__c}</li>

  </apex:repeat>
</ul>
</div>
</apex:page>

I am able to show images, with no file extension, in my force site.

 

However, I am not able to show that same image inside of salesforce on a record detail page.

 

Any one ever get around, or experience this?

I successfully integrated the Amazon toolkit.

 

  1. staff can login into salesforce to upload a photo to amazon and create a salesforce S3 Object record too. The S3 Object record allows me to connect the S3 Object to the external users' accounts in salesforce.
  2. My external force site users can upload their photo as well, no record created, just a file lands in a S3 bucket.

I am trying to decide between the 2 options.

 

If I use option 1, how should I get the photos from external users to my staff to perform the upload and approval? Email is possible, but kinda crude??

 

If I use option 2, I need a way to approve or disapprove the photo before it becomes public?

 

I guess the biggest issue is properly tying the photo back to the record if I let external users upload photos. Also, Should I just download the images from the bucket and let staff re-upload into salesforce?

I have an online store selling Sessions.

Each Session has multiple presentations.

A Session Package is made up of multiple sessions.

 

A session looks up to it's parent, which is a conference object, since we have yearly conferences.

 

I need a way to associate multiple sessions with multiple packages.

Package1 = Session1, Session2,Session18

Package2 = Session1,Session12,Session14

Package3 = Session12,Session14,Sesson2

 

I cannot use the master/detail or lookup, that forces me to use too many objects, also, I already have relationships on those objects.

 

Any ideas on how you would create this package builder?

I am using JQuery Mobile for an Apex/Visualforce page.

The problem is I am trying to section off 2 separate repeat tags, but when I adjust my repeat tags to certain divs,

 

I get the error message:

Description	Resource	Path	Location	Type
Save error: Unknown property 'InventoryExtension.product'	

 

Here is what I am trying:

 

<div data-role="page" data-theme="b" id="detailpage{!product.Id}">
		
		<!-- page header -->
		<div data-role="header"><!-- button for going back to mainpage -->
			<a href='#mainpage' id="backInventory" class='ui-btn-left'
			data-icon='home'> Home </a> <!-- page title -->
			<h1>Edit</h1>
		</div>
		
		<!-- page content -->
		<apex:repeat value="{!products}" var="product">
			<div id="#content" data-role="content">
				<h2 id="name"><label for="model{!product.Id}">
				<h2>Model</h2>
				</label> <input type="text" value="{!product.Model__c}"
				id="model{!product.Id}" /></h2>



			<div data-role="fieldcontain">
				<fieldset data-role="controlgroup">
					<apex:outputPanel rendered="{!product.checked_out__c}">
						<input checked="checked" data-mini="true" type="checkbox"
						name="checked_out" id="checked_out{!product.Id}"
						value="{!product.checked_out__c}" />
					</apex:outputPanel> 
					
					<apex:outputPanel rendered="{!!product.checked_out__c}">
						<input data-mini="true" type="checkbox" name="checked_out"
						id="checked_out{!product.Id}" value="{!product.checked_out__c}" />
					</apex:outputPanel> 
					<label for="checked_out{!product.Id}" data-inline="true">CheckedOut:</label>
				</fieldset>
			</div>



		<div data-role="fieldcontain"><label
			for="asset_tag{!product.Id}">Asset tag:</label> <input type="text"
			id="asset_tag{!product.Id}" value="{!product.Asset_Tag__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="operating_system{!product.Id}">Operating System:</label> <input
			type="text" id="operating_system{!product.Id}"
			value="{!product.Operating_System__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="serial_number{!product.Id}">Serial #:</label> <input type="text"
			id="serial_number{!product.Id}" value="{!product.Serial_Number__c}" />
		</div>

		<div data-role="fieldcontain"><label for="notes{!product.Id}">Notes:</label>
		<textarea id="notes{!product.Id}" value="{!product.Notes__c}">{!product.Notes__c}</textarea>
		</div>

		<div data-role="fieldcontain"><label for="hostname{!product.Id}">Host
		Name:</label> <input type="text" id="hostname{!product.Id}"
			value="{!product.Hostname__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="memory_size{!product.Id}">Memory Size:</label> <input
			type="text" id="memory_size{!product.Id}"
			value="{!product.Memory_Size__c}" />
		</div>



		<a href="#" data-role="button" data-id="{!product.Id}"
			class="updateButton" data-theme="b"> Update </a>
	
	</div>
</apex:repeat>
	</div>

 

I don't get any errors if I wrap the repeat tags around the entire div like so:

<apex:repeat value="{!products}" var="product">
	<div data-role="page" data-theme="b" id="detailpage{!product.Id}">
		
		<!-- page header -->
		<div data-role="header"><!-- button for going back to mainpage -->
			<a href='#mainpage' id="backInventory" class='ui-btn-left'
			data-icon='home'> Home </a> <!-- page title -->
			<h1>Edit</h1>
		</div>
		
		<!-- page content -->
		
			<div id="#content" data-role="content">
				<h2 id="name"><label for="model{!product.Id}">
				<h2>Model</h2>
				</label> <input type="text" value="{!product.Model__c}"
				id="model{!product.Id}" /></h2>



			<div data-role="fieldcontain">
				<fieldset data-role="controlgroup">
					<apex:outputPanel rendered="{!product.checked_out__c}">
						<input checked="checked" data-mini="true" type="checkbox"
						name="checked_out" id="checked_out{!product.Id}"
						value="{!product.checked_out__c}" />
					</apex:outputPanel> 
					
					<apex:outputPanel rendered="{!!product.checked_out__c}">
						<input data-mini="true" type="checkbox" name="checked_out"
						id="checked_out{!product.Id}" value="{!product.checked_out__c}" />
					</apex:outputPanel> 
					<label for="checked_out{!product.Id}" data-inline="true">CheckedOut:</label>
				</fieldset>
			</div>



		<div data-role="fieldcontain"><label
			for="asset_tag{!product.Id}">Asset tag:</label> <input type="text"
			id="asset_tag{!product.Id}" value="{!product.Asset_Tag__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="operating_system{!product.Id}">Operating System:</label> <input
			type="text" id="operating_system{!product.Id}"
			value="{!product.Operating_System__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="serial_number{!product.Id}">Serial #:</label> <input type="text"
			id="serial_number{!product.Id}" value="{!product.Serial_Number__c}" />
		</div>

		<div data-role="fieldcontain"><label for="notes{!product.Id}">Notes:</label>
		<textarea id="notes{!product.Id}" value="{!product.Notes__c}">{!product.Notes__c}</textarea>
		</div>

		<div data-role="fieldcontain"><label for="hostname{!product.Id}">Host
		Name:</label> <input type="text" id="hostname{!product.Id}"
			value="{!product.Hostname__c}" />
		</div>

		<div data-role="fieldcontain"><label
			for="memory_size{!product.Id}">Memory Size:</label> <input
			type="text" id="memory_size{!product.Id}"
			value="{!product.Memory_Size__c}" />
		</div>



		<a href="#" data-role="button" data-id="{!product.Id}"
			class="updateButton" data-theme="b"> Update </a>
	
	</div>

	</div>

</apex:repeat>

 

Any ideas? I really would like to have to separate sections within the same page-section.

I have an equipment inventory app.

I'd like to use a select list to change the 'Category':

 

 $("#categories").on("change", function(){
                alert(this.value);
                InventoryExtension.getEquipment(this.value,handleUpdate );
               //$("#equipmentList").listview('refresh');
               $("#equipmentList").trigger('create');
                
});

 The Apex method is getting called, the parameter 'this.value' from the click shows in the Apex method as well.

It comes in as 'Laptop' or 'desktop', fine.

 

Here is the Apex method:

 public static List<Equipment__c> getEquipment(String myCategory){
             
             
                if(myCategory== null){
                    products = [SELECT Id, Model__c,checked_out__c,Operating_System__c,Serial_Number__c,
                    Asset_Tag__c,Hostname__c,Notes__c,Memory_Size__c  from Equipment__c];   
                }else{
                	System.debug('My Category: '+myCategory);
                 	products = [SELECT Id, Model__c,checked_out__c,Operating_System__c,Serial_Number__c,
                    Asset_Tag__c,Hostname__c,Notes__c,Memory_Size__c  from Equipment__c 
                                    where RecordType.Name =: myCategory];      
                }
                
                return products;
               
            }

 

 

I can see that the data is coming back from the post correctly. If I choose 'Laptop' I am getting laptop data.

 

I don't understand how to update the view of the listview??

Can someone shed some light on this?

 

 Here is the server plain text response:

Response from server: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

 

 

Using JQuery to mobilize some pages in salesforce.

I am trying to use a checkbox, but I cannot get the checkbox value into my object.

 

Here is my code for the checkbox in the viauslforce page:

<div data-role="fieldcontain">
    <fieldset data-role="controlgroup">
	  
	   <input data-mini="true" type="checkbox" name="checked_out" id="checked_out" value="1"/>
	   <label for="checked_out" data-inline="true">Checked Out:</label>
    </fieldset>
</div> 

 

 

Here is the javascript remoting part.

 $(".insertButton").click(function() {
               alert($("#checked_out").val());
                var merchRecord = {
                   
                    Operating_System__c: $("#operating_system").val(),
                    Model__c: $("#model").val(),
                    Asset_Tag__c:$("#asset_tag").val(),
                    checked_out__c:$("#checked_out").val(),
                    Hostname__c: "Hostname"
                };
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem(merchRecord, handleUpdate);
            });

 In the above code, the alert proves to me that the value is a 1 or 0, when I set it so.

Using True, False, 0, 1 does not work.

 

Here is my error:

Insert failed. First exception on row 0; first error: INVALID_TYPE_ON_FIELD_IN_RECORD, 
Checked Out: value not of required type: 1: [checked_out__c]

 Not sure why I cannot get a 0 or a 1 into the object.

Any ideas?

Im trying perform an Insert from my JQUERY mobile page.

 

Ive tried this:

 $(".insertButton").click(function() {
  
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem($("#model").val(),$("#asset_tag").val(),("#operating_system").val(), handleUpdate);
            });

 

Above s no good.

 

I tried this too:

 $(".insertButton").click(function() {
               
                var merchRecord = {
                   
                    Operating_System__c: $("#operating_system").val(),
                    Model__c: $("#model").val(),
                    Asset_Tag__c:$("#asset_tag").val()
                };
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem(merchRecord, handleUpdate);
            });

 

 

Problem is i get this error:

Visualforce Remoting: Parameter length does not match remote action parameters: expected 3 parameters, got

Line 115

 

 

Not quite sure how to perform the insert.

 

Any ideas?

I tried installing the Mobile Components into my dev org, but I always get success: false

 

If I try to access the sample app, I get: Page MobilePage does not exist

 

Anyone experience this?

Hi all,

 

I implemented a method to upload an Attachment to Amazon S3 but I'm having this issue : AWS authentication requires a valid Date or x-amz-date header

 

Any help is appreciated.

 

Attachment attachment = [Select Id, ContentType, Body, BodyLength from Attachment limit 1];
      //Set<Id> ids = new Map<Id,Attachment>(attachments).keySet();
      AWSKeys credentials = new AWSKeys('Keys');
      S3.AmazonS3 as3 = new S3.AmazonS3(credentials.key,credentials.secret);
      
      Datetime now = DateTime.now();
      String formattednow = now.formatGmt('yyyy-MM-dd')+'T'+now.formatGmt('HH:mm:ss')+'.'+now.formatGMT('SSS')+'Z';
      
      String stringtosign = 'PUT \n\n';
      stringtosign += attachment.ContentType + '\n';
      stringtosign += formattednow + '\n';
      stringtosign += '/mybucket/' + attachment.Id;
      Blob mac = Crypto.generateMac('HMacSHA1', blob.valueof(stringtosign),blob.valueof(as3.secret)); 
      String signature = EncodingUtil.base64Encode(mac);
      
      HttpRequest req = new HttpRequest(); 
 
     //Set HTTPRequest Method
     req.setMethod('PUT');
   
     //Set HTTPRequest header properties
     req.setHeader('content-type', attachment.ContentType);
     req.setHeader('Content-Length',String.valueOf(attachment.BodyLength));
     req.setHeader('Date', formattednow);
     req.setHeader('Authorization', 'AWS ' + as3.key + ':' + signature);
     req.setEndpoint('http://s3.amazonaws.com');
     
      try {
            Http http = new Http();
           //Execute web service call here      
           HTTPResponse res = http.send(req);
         
   } catch(System.CalloutException e) {
      System.debug('===================EXCEPTION ' + e.getMessage() + e.getStackTraceString());
   }  

 

  • December 12, 2012
  • Like
  • 0

Hey folks,

 

I have a college degree designation object in salesforce, with the choices like so:

MBA, BA, B.S.

 

Currently, we have a trigger that will update another field on the contact object that consists of a string representation of those degrees:

Each degree is concatenated to make the string:

MBA, BS, BA

 

Can this be done with a worlflow instead?

 

I want to change because the trigger is causing problems when I am deploying a rather big application.

Instead of tussling with the trigger and tweaking my test class to no end, I'd like an alternative,namely a workflow, if possibe?

 

 

I have component:

<apex:component >
	<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-1.8.1.min.js')}" />
	<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-ui-1.8.23.custom.min.js')}" />
	
	<link rel="stylesheet" type="text/css"
		href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/smoothness/jquery-ui.css" />


	<!-- Attributes Required for Component -->
	<apex:attribute name="datalist" description="JSON String. the script below turns this intoan auto complete list/type suggest list." type="String" required="true" />
	
	
	
	<script>

	$(function() {

		var availableTags = new Array();
		availableTags = {!datalist};
		//alert(availableTags);
		
		$( "#tags" ).autocomplete({
			source: availableTags
		});
	});

</script>


<div class="demo">

<div class="ui-widget">
	<label for="tags">Tags: </label>
	<input id="tags" />
</div>

</div> 
	
	
</apex:component>

 

The input with id="tags" is an autocomplete, drop down list.

I need to get the value from that input into my controller.

 

I tried using what was mentioned in the forums:

inputHidden

actionFunction

 

I have not been able to get either method working.

 

Here is my current page testing the component:

<apex:page controller="AutoCompleteData">
    
    <script>
    
    function setCurrent(){
    	var currentValue = document.getElementById('tags').value;
    	document.getElementById('inptHdn');
    	
    	
    }
    </script>
    


 
       <c:AutoCompleteComponent datalist="{!JSONString}"/>
		<apex:form >
			<apex:inputHidden value="{!currentValue}" id="inptHdn"/>
			<apex:commandButton onclick="setCurrent();" action="{!log}"></apex:commandButton>
		</apex:form>
		
</apex:page>

 

 And here is the log function in the controller:

public PageReference log(){
	System.debug('Log method: '+currentValue);
	return null;
}

 The autocomplete list shows up properly, I just cannot get it back into my controller.

Any ideas?

 

If you are recommending the inputHidden or actionFunction, please show a good example, please.

 

 

I have a component that provides an autocomplete/type suggest list.

It's currently a component, but the object to search and the fields are hard-coded.

 

How can I get this to become a component where I can pass in the object name and the fields I want searched.

 

I have seen examples using Javascript Remoting, But that is causing me too many issues so far.

 

Can I achieve my goal without using Javascript Remoting?

 

Here is the Class:

global class AutoComplete {


public static String JSONString {get;set;}
public static sObject obj{get;set;}

public AutoComplete(){
	getDesignations();
}


global static String getDesignations(){
	List<Designation_Abbreviation__c> abbs = [Select Id,Name, Designation__r.Name from Designation_Abbreviation__c];
	List<String> designations = new List<String>();
	
	
	for(Designation_Abbreviation__c d: abbs){
		designations.add(d.Name +' - '+d.Designation__r.Name);
	}
	
	JSONString = JSON.serialize(designations);
	
	return JSONString;
}


}

 

Here is the component:

<apex:component controller="AutoComplete">
	<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-1.8.1.min.js')}" />
	<apex:includeScript value="{!URLFOR($Resource.AutoCompleteJQuery, 'AutoCompleteJQuery/jquery-ui-1.8.23.custom.min.js')}" />
	<link rel="stylesheet" type="text/css"
		href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/smoothness/jquery-ui.css" />


	<!-- Attributes Required for Component -->
	<apex:attribute name="objectname" description="The object to search and build autocomplete for." type="String" required="false" />
	<apex:attribute name="additionalfields" description="fields to search" type="String" required="false" />
	
	
	<script>

	$(function() {

		var availableTags = new Array();
		availableTags = {!JSONString};
		//alert(availableTags);
		
		$( "#tags" ).autocomplete({
			source: availableTags
		});
	});

</script>




<div class="demo">

<div class="ui-widget">
	<label for="tags">Tags: </label>
	<input id="tags" size="50"/>
</div>

</div> 
	
	
</apex:component>

 

Here is a page testing the component:

<apex:page >
    <apex:form >
       <c:AutoCompleteComponent />
    </apex:form>
</apex:page>

 

Hi All,

 

I am getting the following error from the apex code.

System.DmlException: Insert failed. First exception on row 0; first error: INVALID_TYPE_ON_FIELD_IN_RECORD, Currently employed: value not of required type: :

 

private boolean Experience;

 

controller.setExperience(true);

 

Construction_experience__c = ConExperience;

 

Construction_experience__c  is a checkbox datatype custom field.I want to assign a value to it in Apex code.I am setting the value of the Experience checkbox to true using setExperience method. Could anyone please let me know what is the wrong with the declared boolean data type? How to assign value to checkbox data type in Apex code? Your help is greatly appreciated.

  • October 07, 2010
  • Like
  • 0