You cannot use the same database field name for the index ('Id') field and the UserId ('SMSOutUserId') field. As you already noticed, this results in an SQL error. Instead, you should create a new field in the MessageOut table of your database and set the SMSOutUserId property to the name of this field. You can then add your unique ID to the UserId field when you add a new message to the database and this unique ID will be transferred to the MessageLog table.
If you want to use the same ID in the UserId field as the Id field then you could create a trigger in your database that copies the value of the Id field to the UserId field every time a record is added to the MessageOut table. This is of course only possible if your database supports triggers.
This is great info! This will be useful if I add records into the MessageOut table from another database.
But If I use the MessageOut table as my primary table for adding records, it makes more sense to use the Id-column (index-column) as the userID. Since the column Id is allready used by difaan sms server as the index (to keep track of which record to update as "sent = -1"), then its not possible at the moment to use the same column as userid.
I would like to use the Id-column as the userid, and that is the same column as difaansms server uses for message index. Because of the "duplicated" use of the column id, it throws an error.
Is it possible to use the column Id (the index column of my smsout table) as userid also?
The record ID numbers of the MessageLog table is auto-generated by the SQL database and cannot be transferred from the MessageOut table.
You can use the UserId and/or UserInfo fields of the MessageOut table to transfer information to the MessageLog table. These two fields are not used by the SQL Connector in Diafaan SMS Server and you can fill them with any information you want.
Diafaan SMS Server only matches the delivery report with the original message if the number format is exactly the same. Usually delivery reports use International number format and you should also use that format when you generate the message. You can use the NumberTemplate property in the advanced settings of each connector to change the format of the destination numbers to International number format. In your example the 'NumberTemplate' property should be set to '[+47]########'.
I'm adding records to an sqlserver database into a table MessageOut, with a primary key in the field ID
WHen those records are sent, diafaan sms server changes a field IsSent to -1.
When records are sent, they are also added to a table MessageLog. Delivery notifications etc are written to the table MessageLog.
Is it possible for Diafaan SMS Server to add the ID-number of MessageOut into the table MessageLog? It would make it a lot easier to join two fields in a query with an ID-number to keep track of the status-updates.
Is it also possible to receive delivery confirmations when I dont use the full +4791234567, I only use 91234567 in the "to"-field.
Somehow that "not international" number is not recognized when updating delivery confirmation.
Most Users Ever Online: 494
Currently Browsing this Page:
Guest Posters: 490
Newest Members:, Henk Helmantel
Administrators: Henk Helmantel: 913