emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: dlc <dlc@coateconnection.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: How to set a property defaults in a capture template.
Date: Tue, 13 Dec 2011 15:56:53 -0600	[thread overview]
Message-ID: <912E1A11-FBCA-4D6C-9DC1-401FD0DE0780@coateconnection.com> (raw)

[-- 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 --]

             reply	other threads:[~2011-12-13 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 21:56 dlc [this message]
2011-12-20 23:05 ` How to set a property defaults in a capture template Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=912E1A11-FBCA-4D6C-9DC1-401FD0DE0780@coateconnection.com \
    --to=dlc@coateconnection.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).