TruxtonChildFileIO newcommunication

From truxwiki.com
Jump to navigation Jump to search

This create new communication object from a file in Truxton. It automatically associates the parent file and media identifiers used in the [Message] table.

Syntax

object newcommunication();

Return value

An communication object

Sample

def main():
  t = truxton.create()
  file = t.getfileid("5ec2a123-74d6-5da7-0653-4e6800000000")

  communication = file.newcommunication()

  communication.sent = ticks("2015-08-16T21:31:37-00:00");
  communication.received = communication.sent
  communication.subject = "Dinner at 8?"
  communication.type = truxton.MESSAGE_TYPE_SMS
  communication.save()

  communication.addparticipant("703.555.1212", truxton.MESSAGE_PARTICIPANT_FROM)
  communication.addparticipant("202.555.1212", truxton.MESSAGE_PARTICIPANT_TO)

  communication.finished()

if __name__ == "__main__":
  sys.exit(main())