Points System

Hi there,

Iā€™m quite a novice in SuiteCRM and javascript, and my question was how can I achieve a points system for the products that calculate itself, like discount or taxes.
I already tried creating the custom fields in line items and products, but i cannot make them show up. I was thinking about doing it with workflow, but I am not sure it will work.
What I am trying to do is to have certain points for every product, and everytime i make a contract with someone, sum all the points of the products and give them to the client.
Now i know itĀ“s a bit complicated, but with the right answer i think i can solve it.

Hope for a little bit more experienced people than me,
Thanks in advance.

Have you tried Logic Hooks? Please read about them, i think they will help you.

1 Like

Ok, Iā€™ve looked it but I donā€™t find any good tut to start understanding it. Iā€™m trying to learn SuiteCRM, and iā€™ve been starting to develop a CRM based on SuiteCRM over 2 months ago. So far, i understood pretty much things, but I have a hard time to find any good explanations on creating a new logic hook on the internet.
Would you be so kind to help me out a little, or point me a webpage that would help me on this task?

Thanks a lot for your answer,
Kind regards.

Hi,
http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.8/Architecture/Logic_Hooks/Examples/Comparing_Bean_Properties_Between_Logic_Hooks/

This is sample.

Then you can do a workflow to SUM value

Maybe directly by ā€œcalculated field functionalityā€ in new SuiteCRM, but i have no knowledge about that

1 Like

Hi there,

Another minor problem I have is that I have ā€œundefinedā€ in a lot of fields. I looked up the permissions, and I assume thatā€™s not the problem. Iā€™ve been looking in all forum about this problem. and havenā€™t found a solution yet.

Thanks a lot, I will look to the link u gave me , maybe with a bit of luck I can solve the previous problem out.
Kind Regards

Daniel,

having ā€œundefinedā€ in a lot of places is not ā€œa minor problemā€. Itā€™s only the tip of the iceberg, it means your system isnā€™t able to load random files.

It probably is related to permissions issues. Sometimes these are very tricky to get right, Iā€™ve had posts here in the forums where it takes me 30 posts to get someoneā€™s permissions working. So you should really check that and donā€™t assume itā€™s working

  • find out which user your web server is running under
  • examine the ownership of files in your entire tree, to see if it matches that
  • examine permissions on your whole tree

Tell us if you need help.

You can start by going into Admin / Upgrade Wizard, and running the first step, that will check some permissions (but not all). Donā€™t worry, it wonā€™t upgrade anything unti lyou give it an upgrade package, and you can just cancel before that.

Hi there pgr,

First thank you all very much for your great help.

I did 3 updates until now from the upgrade wizard and i had no problem, in fact it says that the files are fully editable and all the privileges are satisfied. Iā€™m sorry, but I donā€™t know how i should ckeck the 3 things you point me up, I would appreciate a lot any steps to get it right, because I really want to learn more about this awesome software.

PD: iā€™m running suitecrm in 1&1 Hosting, so is a webspace.

Thanks again,
Kind regards.

Ok, go into Admin / Schedulers and tell me what is written there at the bottom (instructions to set up cron jobs). With this we can find out your web server user (if you have at least v7.8.3, do you?).

Then post the results of this command given from the root of your SuiteCRM installation:

ls -al
1 Like

Hi PGR,

These are the lines that i have in Schedulers at the bottom of the page.

QUOTE

Para ejecutar los planificadores de SuiteCRM, editar el archivo crontab de los usuarios del servido web con este comando:
sudo crontab -e -u u88269097
ā€¦ y aƱadir la siguiente lĆ­nea al fichero crontab:

          • cd /homepages/40/d669063229/htdocs/app; php -f cron.php > /dev/null 2>&1 
            

EXITQUOTE

The second step you gave me Iā€™m not sure where i have to enter it, since i have no console for the web server.

Thanks for your answer.
Kind Regards.

Without shell access (like SSH) itā€™s all much more difficultā€¦

Maybe look in CPanel to see if your files are owned by user ā€œu88269097ā€, and if they have the necessary permissionsā€¦

Or ask your hosting to run these commands:


    chown -R u88269097:u88269097 .
    chmod -R 755 .
    chmod -R 775 cache custom modules themes data upload config_override.php 
1 Like

Hi pgr,

Iā€™ve managed to run the previous command u asked me about ā€œls -alā€. The result is:

(uiserver):u88269097:~$ ls -al
total 16
drwxā€”r-t 5 u88269097 ftpusers 85 Jul 9 19:48 .
drwxr-xr-t 7 root root 4096 Jul 25 18:44 ā€¦
drwxr-xr-x 20 u88269097 ftpusers 4096 Jul 25 17:20 app
drwxr-xr-x 3 u88269097 ftpusers 39 Feb 10 08:14 clickandbuilds
-rw----r-- 1 u88269097 ftpusers 229 Feb 10 07:36 index.html
drwxr-xr-x 3 root root 4096 Jul 25 18:44 logs

2Āŗ

(uiserver):u88269097:~$ chown -R u88269097:u88269097
chown: missing operand after ā€˜u88269097:u88269097ā€™
Try ā€˜chown --helpā€™ for more information.

3Āŗ

(uiserver):u88269097:~$ chmod -R 755
chmod: missing operand after ā€˜755ā€™
Try ā€˜chmod --helpā€™ for more information.

4Āŗ

(uiserver):u88269097:~$ chmod -R 775 cache custom modules themes data upload config_override.php
chmod: cannot access ā€˜cacheā€™: No such file or directory
chmod: cannot access ā€˜customā€™: No such file or directory
chmod: cannot access ā€˜modulesā€™: No such file or directory
chmod: cannot access ā€˜themesā€™: No such file or directory
chmod: cannot access ā€˜dataā€™: No such file or directory
chmod: cannot access ā€˜uploadā€™: No such file or directory
chmod: cannot access ā€˜config_override.phpā€™: No such file or directory

Sorry I didnā€™t mention it before, i have the crm installed on a subdomain called app.lateletienda.online. The files are in a subdirectory of root called ā€œappā€.

Thanks for your quick answers,
Kind regards.

All of those commands need to be executed from the SuiteCRM root direcotry, so first you need to ā€œcdā€ into app, and then that subdirectory, and then to the crm. Only when you are there, you should give those commands.

Also, pay attention because two of those commands end with a space followed by a dot (" ."). You arenā€™t including that, so they give errors.

1 Like

Ok great, wow I donā€™t have any ā€œundefinedā€ anyomore. Thank you so much.

The other question i had itā€™s about the ā€œbeansā€, in the logic hooks problem, would you be a little bit more specific about the way to accomplish the points system? Iā€™ve been trying to get a fix for it, but i donā€™t manage to get it working with workflow and custom fields.

Thank you, your help is very much appreciated.

Kind regards.

You can start by getting Jim Mackinā€™s eBook ā€œSuiteCRM for Developersā€, thatā€™s a real good help.

You probably need an after_save logic_hook to perform calculations when any value is changed. There are plenty of examples of this online.

1 Like

First of all thank you for your time and explanations, they have been very usefull to me.

This is my last question, i would like to put a button in ā€œactionsā€ tab in ā€œEmployeesā€, that would get a list of the sales of that employee in a specific time, or something similar. How could I do that?

Thanks in advance.
Kind regards.

Which action menu do you mean?

  • the one in each row in a list view
  • the one in each row in a subpanel
  • the one on the top right menu with ā€œcreateā€ items
  • the one in the left-hand menu, above the recently used and favorites items

Any of these I think it would be enough. How should i start doing it?

Thanks,
Kind Regards.

I canā€™t give you much guidance there, I donā€™t know.

But they are two different things, so you need to work on them separately.

Once you know the terms, you can get good results from Google:
suitecrm add action menu item in list view
suitecrm add action menu item in subpanel

and then if you still need more, repeat that with ā€œsugacrmā€ in place of ā€œsuitecrmā€, but then make sure you only follow instructions that are meant for version 6.5 or earlier.

This one is a good start, https://www.suitecrm.com/forum/suitecrm-7-0-discussion/1809-new-action-menu-in-quotes

Good luck!

1 Like

Thank you for all your help PGR!

But now when I try to create a user i canā€™t push ā€œsaveā€, it doesnā€™t do anything. Same thing happens when I try to change a user email or password, the ā€œsaveā€ button doesnā€™t work. Itā€™s there, but when i push it nothing happens. Any idea why?

Thank you very much.
Kind regards.