Results 1 to 3 of 3

Thread: Workflow Module - Incrementing the existing field value

  1. #1
    ac1982 is offline Sugar Community Member
    Join Date
    Nov 2007
    Posts
    34

    Default Workflow Module - Incrementing the existing field value

    Hi,

    It seems that there is a bug in Sugar Crm 4.5.1 Professional Edition, I could not find anywhere if this is solved in any of the latest editions.
    When I create a workflow I set as an action the following 'Set Threats Counter as existing value(+) Plus by 1' but for the existing field is not updated. I tried to find out what is the problem and I found that when the addition is done the current value of the field 'threat_c' is not retrieved and I always have one. The current value of my field is return through the $focus->$fieldname which is empty. Any suggestions would be very helpful.

    Thank you.


    » Operating system type and version Windows XP
    » Sugar version and edition 4.5.1 Professional Edition
    » Webserver type and version Apache
    » PHP version 5.3.0

  2. #2
    mapm's Avatar
    mapm is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Portugal
    Posts
    239

    Default Re: Workflow Module - Incrementing the existing field value

    $focus->$fieldname shouldn't be $focus->fieldname ??
    --
    Mário Pereira Martins

    Javali - Administração e Desenvolvimento de Sistemas Informáticos, Lda.
    Madan Parque Edifício VI Campus da FCT/UNL
    Quinta da Torre 2829-516 Caparica Portugal
    Phone: +351 212949666 Fax: +351 212948313
    http://www.javali.pt

  3. #3
    ac1982 is offline Sugar Community Member
    Join Date
    Nov 2007
    Posts
    34

    Default Re: Workflow Module - Incrementing the existing field value

    this is how it is inside sugar files is not something that i made:

    PHP Code:

    //include/workflow/field_utils.php     line.759

    if($meta_array['adv_type']=='value_calc'){

            
    $jang get_expression($meta_array['ext1'], [B]$focus->$field[/B], $meta_array['value']);
            echo 
    $jang;
            return 
    $jang;
    }

    //include/workflow/expressions_utils.php

    function get_expression($express_type$first$second){
        
        if(
    $express_type=="+"){
            return 
    express_add($first$second);
        }    
        if(
    $express_type=="-"){
            return 
    express_subtract($first$second);
        }        
        if(
    $express_type=="*"){
            return 
    express_multiple($first$second);
        }        
        if(
    $express_type=="/"){
            return 
    express_divide($first$second);
        }            
    //end function get_expression
    }

    function 
    express_add($first$second){
        return 
    $first $second;
    }    

    function 
    express_subtract($first$second){
        return 
    $first $second;
    }

    function 
    express_mulitple($first$second){
        return 
    $first $second;
    }

    function 
    express_divide($first$second){
        return 
    $first $second;

    * $focus->$field which comes from the bean file, its current value in database and it is not return, so when the addition is made i always get 1 which is the incremented value that I specified.
    I also check the custom field that I created, its type is int of length 11 (increamenting is not working). I also changed my custom field type to a drop down and i use the values 1,2,3,4,5...and in my workflow i use the following action for the specified custom field "Move dropdowns forward by" and value "1". Still is not working. What kind of professional edition is this, this is not working, that is not working... Please advice how to fix this bug!!!!!!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 2010-07-25, 03:08 PM
  2. Replies: 1
    Last Post: 2007-10-10, 10:13 AM
  3. Replies: 7
    Last Post: 2007-07-13, 01:38 PM
  4. Replies: 0
    Last Post: 2007-04-25, 06:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •