I retrieve fullcalendar events from a database whose fields names for standard fullcalendar key names 'start' and 'end' are not 'start' and 'end'.
Is there a way to change those standard key names? It would be much simpler than manipulating the original data I receive from the database.
If you mean the "start" and "end" parameters which are sent to the server to tell the server the correct date range for which is should return events, then yes you can set https://fullcalendar.io/docs/startParam and https://fullcalendar.io/docs/endParam .
But if you mean the fields in the events which you output and send to fullCalendar, then no, you have to comply with the field names given at https://fullcalendar.io/docs/event-object so that the calendar knows what each field represents when reading the event data. Presumably you have some server-side code which reads the fields from the database and turns them into JSON? At that point it shouldn't be too difficult to just read your database date fields into object fields named "start" and "end" respectively. It's perhaps a bit of a chore, but you have to comply with the fullCalendar spec in this instance.
I solved this with alias in the query and works perfect. In my case:
$sentenciaSQL = $conn->prepare("SELECT name as title, start_date as start, end_date as end, color as color FROM project_list");
where conn is the DB connection.
Related
I've added a formula(date/time) column to a saved search in NetSuite, to return a system notes' date.
My CASE formula is returning all the system notes row's, and I would like a specific row's date i.e. 'POP Host Int ID' date.
How can I specify the row to return the date from, or remove the rows with no date that are not relevant?
CASE
WHEN {systemnotes.field} = 'POP Host Int ID' AND {systemnotes.type} = 'Set'
THEN {systemnotes.date}
ELSE NULL
END
It appears that my WHEN logic works to identify the record's system notes do contain an entry for 'POP Host Int ID' but in THEN I'm not specifying which row to get the date from so it returns all rows. And I could be wrong on this part.
Example results
Example System Notes for 1 record
Thank you for your assistance.
The CASE statement doesn't determine which rows are returned, only what data is returned for that field. On the other hand, the reference to the systemnotes table creates a join that causes each record result to be repeated for every system note entry.
To avoid this, add {systemnotes.field} = 'POP Host Int ID' and {systemnotes.type} = 'Set' as Filters in the Criteria tab instead of in the WHEN conditions. You can then just add the field under results instead of needing a formula.
Edit in response to comment below:
In cases where you need one result per base record (user), but they don't all have valid values from the joined table (system notes), I'd suggest grouping the results by user, and using aggregation functions for all the columns. EG: For the column in question I'm assuming you are getting one valid result and a lot of blanks per user. If you group by user and set the Summarize function to MAX, you should just get one result where the valid value is returned. If no valid value exists from the system notes, you would still get a result from the user and that field will be blank.
If you are creating a saved search the place to do this is in the criteria section.
The views you've shared are for the System Notes pertaining to a single record.
For those views you could just use the Field selector in the Filters section to select your POP Host Ing ID field.
For a saved search you would use the Advanced view and scroll down the criteria field list. Near the bottom are the System Notes. You can filter on Field, Date etc
I have a DDB table, 4 attributes, key (PK - a string), date (sort/range key), status, frequency.
I have multiple clients that will write to this table based on the 'key' and date value
I want to increment frequency every time a client makes a write.
Can I just use DynamoDBVersionAttribute on an int field and use this as a proxy for frequency?
I understand this is not meant for this use case, but I want to avoid having to first read and then write the item. Any thoughts?
Since you're already doing an update expression, just add an ADD action to increment the frequency by 1. The ADD action doesn't need to know the original value to increment it.
See the example from the docs here:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.SET.IncrementAndDecrement
I have many date values in CSV which is sent to logic app. In example:
date1;date2;date3;date4;date5;date6;date7
2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30
2011-12-30;;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30
It is possible that there is empty date in the CSV. I need to insert those dates to Dynamics 365. As I insert those values if I insert the empty date it goes as "", which returns an error: "Cannot convert the literal '' to the expected type 'Edm.DateTimeOffset'.". Same happens if I try to pass null when date2 is empty ("").
Is there way to skip inserting anything with logic app? Or is there some other solution to this?
Most likely, you will need to stop sending CRM empty fields.
However, you're transforming the data from the CSV shape to the D356 shape, you need to check the data and not emit the field when the source also does not exist is otherwise invalid.
It seems you're using a Foreach over the input, then creating the D365 message with a Compose Action. The thing is, the Compose Action doesn't give you much control over the output.
Instead, you should use a Liquid Transform where you can test the input before emitting any field.
Liquid - Control Flow
Problem:
I am working on asp.net application and my Intention is to confirm that a table row is updating only when it is not updated in between a user's request and submit.
Scenario
User X and Y open same invoice(invoiceid=12) in different browser
User X changed invoice date to 1-july-2014 in UI.
User Y changed invoice date to 5-july-2014 in UI
User X press submit button.-- Invoice date changed to 1-july-2014
User Y press submit button.-- Invoice date changed to 5-july-2014.
X and Y both did not know whether invoice data are not altered in between.
Solution-1
We added a column LastModifyOn(DateTime) in invoice table
When retrieve the invoice data for edit also getting LastModifyOn column data
Keeping the encrypted LastModifiedOn data in hidden field in UI
When user submitting the invoice data changes, we also sending LastModifiedOn to compare.
Showing appropriate message.
Solution-2
We added a column version(rowversion) in invoice table
When retrieve the invoice data for edit also getting version column data
Keeping the encrypted version data in hidden field in UI
When user submitting the invoice data changes, we also sending version to compare.
Showing appropriate message.
X and Y knows whether invoice data are altered in between or not.
Question:
Now my question is what benefit we will get by using version(rowversion) column over LastModifyOn(DateTime)...
Point:
We are audit trailing in invoice table so last updated on data is already available.
Please mention strong points in reason not like we do not need to update rowversion column explicitly or definition of timestamp ..
It looks as if you have decided (I might add, correctly) that timestamp/rowversion is better than datetime. IMO it is up to you and the purpose. I will try to list down the differences between these two.
timestamp range is from 1970-01-01 00:00:01 to 2038-01-19 03:14:07; where as datetime range is from 1000-01-01 00:00:00 to 9999-12-31 23:59:59
timestamp supports timezones where as datetime doesn't
timestamp is guaranteed to be unique (provided you use it properly) where as datetime is just a datatype and can be manipulated (specified in an insert for example)
PS: From v2008 onwards 'timestamp' is deprecated, so use rownumber (they are synonyms)*.
*Source: http://msdn.microsoft.com/en-us/library/ms182776.aspx
I have a table that contains three columns.
"UserId" type-nvarchar
"PostAuthorId" type-nvarchar
"Post" type-text
This table will contain "wall" posts like in facebook for each user's page. I am going to use a gridview on each user's page to display the posts. The issue is I want to display them with the latest(most current) post being first and the earliest post being last.
I have never used autoincrement before and I am not sure if that is the answer. If it is, I do not know how to use it. I thought about adding a date posted column and then ordering by date.
If I end up using the date column, I could also display the date on the post. Is there a way to convert the date to a readable format?
What is the best way of implementing this type of ordering?
If you use AutoIcrement the first record will start with 1 and each record will increment from there. (default setting)
If you want to sort them by newest first do an ORDER BY ID DESC
I would suggest making a column called wallPostID then setting that to AutoIncrement and also your Primary Key
Date Formating:
If you are displaying this data in a gridView
Go to Edit Columns on your grid view
CLick on the Date field under "Selected Fields" on the bottom left
Under "BoundField properties" on the right Go to Data -> DataFormatString
{0:d} will display as 1/1/2010
This site has more info in string formatting
http://msdn.microsoft.com/en-us/library/fht0f5be.aspx
A datetime column would definitely work for something like this. Assuming you are using MS-SQL, you can also attach a default value to the column using a built-in function like GETDATE(). That way, you only have to input the data that matters and the database will take care of adding the datetime column.
For converting a datetime to a readable format try:
DateTime postDate;
string value = postDate.ToShortDateString();
You should always use an ID field that auto increments. Can also be used as your PK
I would suggest the DateTime field rather than the autoincrement simply because it will not only serve as an effective Sort field, it also preserves information that you may well want to display. If you want the most recent first you'll sort using the Date and a "DESC" modifier:
Select ... Order By [Date] DESC;
When you retrieve the data, you can retrieve it as a DateTime and modify it using C#. You can use "ToShortDateString()" as suggested by mdresser if you just wish to show the date or ToString("...") if you wish to show the time as well. You can also use SQL to convert it into a string before retrieving it:
convert(Varchar(10), #mydatetime, 101)
If you look in MSDN you'll see the various conversion codes (101 is the code used above) that can be used to translate the date in various ways.
UPDATE: You may want to use an autoincrementing field for your application for reasons other than your expressed need to sort wall entries. They are easy to use - just mark the field as an Identity if using SQL Server (other DBs are similar). As far as using them in your program, just think of the field as an Int field that you never have to set.
Now, why would you use a auto-incrementing field? Perhaps the most straightforward reason is so that they give you have an easy way to identify each record. For example, if you permit people to alter or delete their wall entries, the auto-incrementing field is ideal as it gives you a way to easily look up each record (each record will be assigned its own, unique value). You might put an "x" next to the record like StackOverflow does and make it a call back with the UID (auto-increment) value. Note that you should set up your primary key on the UID field if you'll be doing this.
Now, if you find them useful for this reason then you could also sort by the UID. I would still store the date so that you can provide Date and Time feedback as to when an entry was made on the wall but this would no longer be your indexed or sorted field.