I have 1 custom field in Leads. I want number to restart from 1 everyday. Suppose there are 8 transactions on Day 1 no should be 1,2,3,4,5,6,7,8. Next day if there are 5 then number should be 1,2,3,4,5.
we are using SugarCrm community edition
Thanks
What do you count as a transaction? Do you mean a new case is opened?
It sounds like this would be best done from a logic hook...
Related
My task is to build a table in 4 columns and 6 lines of quick replies buttons. Messenger api allows display 11 quick replies in 1 line.
Is it possible to build answers in several rows?
You probably want to check the Quick Reply docs first: first of all it's 13 max not 11, but most importantly Quick Replies aren't permanent and disappear after the next message and therefore you cannot have multiple "rows" of Quick Replies.
I have three different delivery dates in my store and I want the user to choose from any of them (effects the price) on the (configurable) product page. I need these three to hold three different values:
4 days from now = "2017-09-04"
7 days from now = "2017-09-07"
10 days from now ="2017-09-10"
The Attribute 146 holds all three and presents the options to the customer in a dropdown menu. When the user makes his choice the product price changes.
My problem is that I dont want to update the values manually every day so I am looking for a way to automatize. First I tried to do it in configurable.phtml and change the value every time the page gets loaded. I am trying to use this line of code to be able to do it but I am having difficulties making it work.
<?php $this->action->updateAttributes([$product->getId()], ['deliverydate' > $newValue], $storeId); ?>
Now I am thinking of maybe I should set up a cron job to do it every night?
What do you think? Any suggestions?
I'm building an html table with dates as columns and hotel rooms as rows.
I'm fairly new to Meteor and have had headaches over this.
Because a html table is build by rows, I need to iterate over the rooms. So, if I am not mistaking this limits me to choosing the following file structure in MongoDB:
Room Collection:[
{Room1:[{"31/03/2015", "2/04/2015",....]},
{Room2:["22/03/2015",...]},
...]
Before this I had a reservation object where every reservation had the name of the room in it. Because there is no way I can group these dates over different collections, I changed it to the above structure.
So, okay, now I am able to move the cursor from room to room and build table rows.
Bigger problem now is that I then would iterate over 7 days (lets just say, for now I only retrieve queries for the current week). If I now get three days back from the database that are booked. I am only able to loop three times. Which is bad news because I need to fill 7 td elements. So somehow I should Identify which days of the week are taken by the reservation.
Is it a possibility to just store every date of the year in MongoDB and indicate wether there is a booking for that date? That seems far from elegant.
Or should I compare the dates of the week with the dates retrieved from the server, so on the client side?
I think I am looking at this problem the wrong way. I would love to here somebody else's opinion on this. :)
Kind regards
I always start off with an ER model of what I have & what I want.
How I think you currently have it: 1 Room has many Reservations. 1 Reservation has 1 datetime.
How you want to access it: 1 Day has many Reservations. 1 Reservation has 1 datetime & 1 room.
The Mongo way to do it: 1 Reservation has 1 room & 1 date.
So your original idea was correct (I'm not sure what you mean by not being able to group in other collections, we can tackle that in comments if you like):
Reservations = {
name: 'The Johnson Family Reunion',
room: 'Grand Ballroom',
datetime: new Date
}
For simplicity, we'll assume you aren't changing months in this example & I assume you've already got the code down to assign days to those squares.
Each square in the calendar should follow a dayofMonth template.
That will afford you a this that has the date in your helper, so you can write something like this:
Template.dayOfMonth.helpers({
reservations: function() {
return Reservations.find({datetime.getDate():
this.datetime.getDate()}).sort(datetime);
}
}
Then, your template is something simple like:
{{#each reservations}}
{{reservations.name}}
{{/each}}
Hope it helps!
I want to create a monthly report, calculating the % from the previous 2 month average from the previous 12 months average. Basically I want to see which shops have dropped in sales in the previous 2 months, and hopefully only show the shops that have decreased 20% in sales.
So i believe the columns need to be like this
Shop|Products|Avg of 12 months|Avg of 2 months| %
Since i have many entries for the sales, i also need to sum the previous 12 months and then average it... as well as sum the previous 2 months and average it
I have thought of some ways to do it, but it didnt seem to work and seems all too complicated and complex.
Im hoping if there is a simpler solution to this? Do i need to use pivot table?
I'm using PostGres 9.1 on Visual Studio 10
Thanks a bunch
When something seems too complicated to resolve with a single query, I create and populate a DataTable runtime and pass it to ReportViewer.
In this case you can:
create a DataTable with Shop and Product as a PK (if you want print the report for a period of months you can also add Month as PK). The other 2 columns will be Avg12Months and Avg2Months
insert a record for each combination of Shop/Product (and eventually Month)
for each record Shop/Product calculate and save the results for Avg12Months and Avg2Months
pass your DataTable to ReportViewer
use a single Tablix to display the results (sort, grouping and other operations can be done in the Tablix)
Some passages can be combined in order to speed up the process.
I have the following problem with MS Access:
Suppose I have a list of companies with monthly performance values. I can view the performance of a single company in a chart by hooking the chart into a query with a Month column and a Performance column.
Now suppose I want to display a chart for N companies. I could theoretically do this if I were to generate a query with a Month column and N Performance columns (one for each company). Is there any way to create a query with a variable column count like this? I have a SQL backend that I can use if necessary, and I'm fine with putting together any VBA code necessary to support it. The only impediment I'm seeing is that I'm stuck using MS Access, which I am not very familiar with.
So here are my main questions:
Is this even possible?
How would I go about tackling this issue? I'm trying to minimize research time, so it would be great if I could just get pointed in the right direction.
Thanks!
With this table:
company pmonth performance
1 1 10
2 1 8
3 1 15
1 2 15
2 2 5
3 2 25
1 3 5
2 3 4
3 3 20
I create this query:
SELECT p.company, p.pmonth, p.performance
FROM MonthlyPerformance AS p;
Then change the query to PivotChart View and drag company field to "Drop Series Fields Here", drag pmonth to "Drop Category Fields Here", and drag performance field to "Drop Data Fields Here".
If you prefer, you can create a form using the same query SQL as its data source, then set the form's Default View to PivotChart, and set up the chart the same way as I did for PivotChart view on the query.
If that's not what you want, give us some more information about the type of chart you want and the context in which you will display it.