who changed a field last?

Hello

   what i'm trying to achieve here is some sort of tracking/audit of a checkbox and display that on the campaign layouts. To be more specific i would like to know right next to the checkbox who was the one that enabled/disabled that checkbox. This value should only change if the checkbox was 'ticked' if the campaign changed it shouldn't change the modified by on the checkbox

Modified by next to checkbox

   When i created the field i checked the 'audit' option, does that keep track of those events? can we pull it from there? tried the documentation but couldn't find much about audit fields.

Thank you

Sergio

Parents
  • Hi Sergio Barrios 

    It can be accomplished without big deal. The implementation depends on your SugarCRM version.

    Let us know it so we can properly guide you.

    Cheers

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hello André

       I have version 7.9.2

    Sergio

  • Is that PRO or ENT?

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • You can do that by a combination of news custom fields, formulas and processes.

    • Create a custom field varchar (Text) which will be populated by latest change log on field "Pricing Discussed";
    • Create a process which will listen for change on the field "Pricing Discussed", follow this article to understand what to do;
    • In this same Process update the new custom field with this formula: "Modified by : {::Campaigns::modified_by_name::} on {::Campaigns::date_modified::}"

    Kind regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hello André Lopes

       sorry for late response i was a bit busy but the direction you sent me worked just fine, i did have to learn about Advanced Workflows but and the end it did work. One last question, i notice it is a Text Field and well that can be edited manually. Is there a way to make that field read-only?

  • Certainly!

    You just need to create an extended vardefs for Campaigns and add the following attribute into field defs of Pricing Discussed:

    'readonly' => true,

    So the code may looks like that:

    $dictionary['Campaign']['fields']['pricing_discussed_c']['readonly'] = true;

    Go to Admin -> Repair -> Quick Repair and Rebuild.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hello André Lopes

       question, i went to ./custom/Extension/modules/Campaigns/Ext/Vardefs and found a sugarfield_pricing_discussed_c.php which is the automated file generated when i created the custom field (at least that's my guess) is it ok to use that file and add the code you provided me to it or do i need to create a new file?

     

       What you provided me looks exactly the same as what it has right now, i just added your line to it which contains the 'readonly' = true part but it didn't do anything that's why i'm asking if i need to create a separate file

Reply
  • Hello André Lopes

       question, i went to ./custom/Extension/modules/Campaigns/Ext/Vardefs and found a sugarfield_pricing_discussed_c.php which is the automated file generated when i created the custom field (at least that's my guess) is it ok to use that file and add the code you provided me to it or do i need to create a new file?

     

       What you provided me looks exactly the same as what it has right now, i just added your line to it which contains the 'readonly' = true part but it didn't do anything that's why i'm asking if i need to create a separate file

Children