emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to set a property defaults in a capture template.
@ 2011-12-13 21:56 dlc
  2011-12-20 23:05 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: dlc @ 2011-12-13 21:56 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 2233 bytes --]

I am trying to set up a capture template to record personal contact  
information for sales lead management. I want to have some properties  
preset to defaults in the capture template

I have created an org file with each person as a top level entry.   
Below is a shortened example.

* Last Name, First Name
	:SCHEDULED:  <2012-01-01 .+2w>
	:PROPERTIES:
	:Spouse:  Spouse Name
	:Status:  New
	:Group:  Prospect
	:STYLE:  habit
	:END:
** Organization
*** Name
	:PROPERTIES:
	:Organization-Name:  True Homes, Inc.
	:END
**** Title
	:PROPERTIES:
	:Title: Owner
	:end:
** Phone Numbers
*** cell
	:PROPERTIES:
	:Number: 222-222-2222
	:end:
*** home
*** fax
** Email Addresses
*** Primary
	:PROPERTIES:
	:Email:  John@gmail.com
	:end:
** Addresses
*** home
*** work
*** condo
	:PROPERTIES:
	:Street1:  2833 Beach Blvd.
	:City:  Orange Beach
	:State:  AL
	:Zip-Code:  36561
	:end:
** Activities
**** <2011-12-13 Tue> Called in with a referral to sell his property.

I want to use org-capture to create this entry with it's subtree and  
all the properties.  The capture template expansion mechanism supports  
using %^{Property}p .  I want some properties to be created with a  
default without prompting the user. (e.g. :STYLE: habits).
I would also like to support completion on some of the properties  
while creating a new contact. {e.g.  the file people.org already  
exist  and is the target for capture to file to and (#+PROPERTY:    
Status_ALL New Incubating Active Purchased Dead) is at the top of the  
file.}

I have attempted to use the expansion %(SEXP) along with the property  
api as in the following but it does not work because Emacs-Lisp  
doesn't support nested strings (right?) I am just learning emacs-lisp,  
so I'm am sure my lack of knowledge is at work here.

	(setq org-capture-templates
		'(
		  ("t" "Test adding property" entry (file "~/people.org")
		    "* Test Entry %(org-entry-put (point) "STYLE" "habit")"
	           )
		   ( another template
		   )
	          ))


David Coate
"Coate Connection"
www.coateconnection.com
Re/Max Paradise
www.AlabamaParadise.com
Licensed in AL and FL
23525 Perdido Beach Blvd.
Orange Beach, Al 36561
251-213-8811 cell
251-948-8888 fax
1-800-339-2836 direct toll free


[-- Attachment #2: Type: text/html, Size: 7305 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to set a property defaults in a capture template.
  2011-12-13 21:56 How to set a property defaults in a capture template dlc
@ 2011-12-20 23:05 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2011-12-20 23:05 UTC (permalink / raw)
  To: dlc; +Cc: Org Mode

dlc <dlc@coateconnection.com> writes:

> I have attempted to use the expansion %(SEXP) along with the property
> api as in the following but it does not work because Emacs-Lisp
> doesn't support nested strings (right?) I am just learning
> emacs-lisp, so I'm am sure my lack of knowledge is at work here.
>
> (setq org-capture-templates
> '(
>   ("t" "Test adding property" entry (file "~/people.org")
>     "* Test Entry %(org-entry-put (point) "STYLE" "habit")"
>            )
>    ( another template
>    )
>           ))  

Shooting in the dark: if this is just a matter of "nested strings",
you can try to simply escape the double-quotes in your template.

  "* Test Entry %(org-entry-put (point) \"STYLE\" \"habit\")"

(Caveat: I didn't check the whole syntax of your setq above...
hope that helps anyway.)

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-20 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13 21:56 How to set a property defaults in a capture template dlc
2011-12-20 23:05 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).