Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Read Only Time Stamp

  1. #1
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Read Only Time Stamp

    Hi,

    This is what I want to achieve. When the status of an Account is set to complete I when the Date it was set to complete filled into the custom date field automatically and only once and the User who set the Account to complete is also added to another custom field that will be read only.

    For example, when the Account is edited and set to complete that the date is then filled in, but if another user logs in and edit the Account Again the date will not change..

    Is this a job for Workflow or a custom Hook.

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  2. #2
    ros.vol is offline Sugar Community Member
    Join Date
    Dec 2008
    Location
    Eastern Europe / Ukraine / Chernivtsi
    Posts
    114

    Smile Re: Read Only Time Stamp

    Hi,

    It seems that you can use customCode for this.

    So when status is set "Copmlited" nobody cant edit the date?
    Rostyslav Volonchuk

    SugarCRM development and customizations

  3. #3
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: Read Only Time Stamp

    Yeah.

    I have a custom date field that I am only showing in the detail view? Same as the last modified date. I have a custom relate field to user, that I will also set read only nad have the user that set it to complete in there.

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  4. #4
    ros.vol is offline Sugar Community Member
    Join Date
    Dec 2008
    Location
    Eastern Europe / Ukraine / Chernivtsi
    Posts
    114

    Smile Re: Read Only Time Stamp

    try to use in field definition:

    'customCode' => " {if $fields.your_status_field.value = 'you_value' } call javascript function that will set needed fields as ReadOnly {/if}"
    Rostyslav Volonchuk

    SugarCRM development and customizations

  5. #5
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: Read Only Time Stamp

    Maybe I should have mentioned I have the Pro version so I can set the fields to read-only via Fields Level Security.

    I think it will be safer and easier to do with the Workflow.

    When status from any other the other options to Complete.
    Set date in customfield to Now
    Set User to logged in User.

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  6. #6
    ros.vol is offline Sugar Community Member
    Join Date
    Dec 2008
    Location
    Eastern Europe / Ukraine / Chernivtsi
    Posts
    114

    Smile Re: Read Only Time Stamp

    Ahh, sure it would be better.
    Rostyslav Volonchuk

    SugarCRM development and customizations

  7. #7
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: Read Only Time Stamp

    Taking this one step further how can I create it so instead of having two fields, I can show it the same way the modified date is show by default.

    (date_time) by (user)

    Where is the code that set this field up. NEVER MIND FOUND IT.

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  8. #8
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: Read Only Time Stamp

    Ok.

    Looks like I cannot do this via Workflow as I am unable to set the date of the datefield and I am unable to get the user that edited the Account when it was set to Complete

    How can I do the following in Logic Hook. Only run code if Account Status changed from (defined values) to Complete, as I would with a workflow???


    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  9. #9
    heta's Avatar
    heta is offline Sugar Community Member
    Join Date
    Nov 2007
    Location
    Ahmedabad,India
    Posts
    214

    Default Re: Read Only Time Stamp

    print $bean->fetched_row['status']; // this gives u the status saved earlier
    print $bean->status; // this is the status which has been selected this time

    ur condition depends on these values.

    hope this helps.
    Best Regards
    ---------------------------------------
    Heta Shah - iNET PROCESS
    heta.shah@inetprocess.com
    http://www.inetprocess.co.in
    Projects :
    iNETDocs -Project of the month(Dec-2008)
    iNETGoogleMap

  10. #10
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: Read Only Time Stamp

    Thats perfect, thank you very much.

    I was able to define old values and the new one....

    But I am unable to get the user name of the currently logged in User who is editing the file.

    I am using the following

    $current_user = $bean->user_name; but it doesn't get the user name of the user who is currently editing.
    Rgds
    Chris
    Last edited by chrislynch8; 2009-07-21 at 09:18 AM.
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. STAMP in url
    By elvinjoe in forum Developer Help
    Replies: 1
    Last Post: 2008-04-17, 05:22 AM
  2. Threads being marked as 'read' before I read them...
    By tbivans in forum Site feedback
    Replies: 0
    Last Post: 2008-03-17, 02:51 PM
  3. For how long time the eamil has been read
    By VeonConsulting in forum Developer Help
    Replies: 2
    Last Post: 2008-02-06, 06:31 AM
  4. stamp in url
    By concordia in forum Help
    Replies: 0
    Last Post: 2007-09-19, 07:12 PM
  5. Time stamp messed up for users
    By sugarcare in forum Developer Help
    Replies: 0
    Last Post: 2006-10-11, 09:14 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
  •