http://www.newton-inc.com/dev/techinfo/qa/qa.htm
OpenRoutingSlip
. Create a new item with the transport's NewItem
method and add routing information such as the recipient information in the toRef
slot. For the call slip, the transport symbol will be '|phoneHome:Newton|
, but this approach will work for other transports. (For transports other than the call transports, you will also provide the data to route in the item.body
slot.)toRef
slot in the item frame should contain an array of recipients in the form of nameRefs, which are the objects returned from protoPeoplePicker
and other protoListPicker
-based choosers. Each nameRef can be created from one of two forms: a cardfile soup entry, or just a frame of data with minimal slots. (The required slots vary depending on the transport. For instance, the current call transport requires only phone, name, and country.) entry := myCursor:Entry();
entry := { phone:"408 555 1234", name: {first: "Glagly", last: "Wigout"}, country: "UK", };
transport.addressingClass
slot. (Examples are '|nameRef.phone|
and '|nameRef.email|
).local class := '|nameRef.phone|;local nameRef := GetDataDefs(class):MakeNameRef(myData, class);
GetTargetInfo
view method should return a targetInfo
frame, consisting of target
and targetView
slots. Alternatively, you can create a frame consisting of these slots and pass it to OpenRoutingSlip
. As a workaround to a ROM bug, you must also supply an appSymbol
slot in the targetInfo
frame containing your appSymbol. Note that targetInfo.target
could be a multiple item target (see the CreateTargetCursor
documentation for more info.)OpenRoutingSlip
to open the slip after setting up slots such as toRef
and cc
within the item. You can use code such as the following:/* example using Call Transport */local item, entry, class, nameRef;// just for testing, get an Name...entry := GetUnionSoup("Names"):Query(nil):Entry();item := TransportNotify('|phoneHome:Newton|, 'NewItem, [nil]);if item = 'noTransport or not item then return 'noTransport; class := '|nameRef.phone|;nameRef := GetDataDefs(class):MakeNameRef(entry, class);item.toRef := [nameRef];targetInfo := { targetView: getroot(), target: {}/* for non-CALL transports, add your data here! */, appsymbol: kAppSymbol };// returns view (succeeded), or fails: nil or 'skipErrorMessageOpenRoutingSlip(item, targetInfo);