Upvise Client Library: Job Class (.NET)
Base Fields string id string name string owner string note int status int priority DateTime duedate int duration | Address Properties string street string city string zipcode string state string country string geo | Client Properties string contactid string companyid |
Job Completion Fields DateTime checkin DateTime checkout string checkoutnote string checkoutgeo | Constants static const OPEN static const CHECKEDIN static const PAUSED static const COMPLETED static const HIGHPRIORITY | Custom Fields void setCustomField(key, value) string getCustomField(key) |
Parsing & Serialization static Job fromJson(JSONObject obj) JSONObject toJson() | Archiving static void archive(string id, Query query) |
Overview
The Job class of the Upvise Client Library represent a record in the Jobs.jobs Upvise table of the Jobs Application
Job Sample on GithubUsage
Insert a new Jobusing UpviseClient; ... Query query = new Query(token); Job newjob = new Job(); newjob.id = "ID1"; newjob.status = Job.OPEN; newjob.name = "Maintain Air Conditining"; newjob.note = "Verify gaz pressure"; newjob.duedate = DateTime.Now.AddHours(2); newjob.owner = "John"; // if you want to assign a Job, set the Upvise user Display name here newjob.priority = Job.HIGHPRIORITY; newjob.street = "1 infinite Loop"; newjob.city = "Cupertino"; newjob.zipcode = ""; newjob.country = "USA"; newjob.geo = "12,3.444"; // set the coordinates for the job // set some custom fields values newjob.setCustomField("F1", "WATER"); newjob.setCustomField("F2", "12"); // Perform insert query.insert(Job.TABLE, newjob.toJson());Insert multiple Jobs in Batch
using UpviseClient; ... Query query = new Query(token); query.beginBatch(); for (var i = 0; i < 10; i++) { Job newjob = new Job(); newjob.id = "ID" + i; newjob.status = Job.OPEN; newjob.name = "Maintain Air Conditining " + i; newjob.duedate = DateTime.Now.AddDays(2); ... query.insert(Job.TABLE, newjob.toJson()); } query.commitBatch();
static void archive(string id, Query query)
Archives one job and its linked notes, tasks, products, forms, and photos / files. It does NOT ARCHIVE linked quotes or invoices.- id is the job id to be archived
- query is the query object used to connect to the target account