Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: emailid not coming in logichook

  1. #1
    ashokinsugar is offline Sugar Community Member
    Join Date
    Apr 2011
    Location
    INDIA
    Posts
    198

    Default emailid not coming in logichook

    Hi Friends,

    How do we get the email field of type link in accounts module in logichook file after_retrieve??

    Eg. Email is a field in account module which is default sugarcrm field. I am trying to get the field name in bean under accounts logichook.

    Regards,
    Ashok

  2. #2
    hats Guest

    Default Re: emailid not coming in logichook

    Hi ashokinsugar,

    You need to fetch the email field seperately based on the account id. It cannot come with accounts by default. Only available in contacts module.

    Correct me if I am wrong. Please let us know the outcome.

    Cheers.

  3. #3
    ashokinsugar is offline Sugar Community Member
    Join Date
    Apr 2011
    Location
    INDIA
    Posts
    198

    Default Re: emailid not coming in logichook

    Hi Hats,

    Yes, you are correct, you will get the email id based on account id.

    Once you get the email id, how to we assign it to the email field of account module which is a default?


    Regards,
    Ashok

  4. #4
    hats Guest

    Default Re: emailid not coming in logichook

    Hi Ashok,

    Do you want to update the email field ? If so, then every email has one bean id associated with it.

    Update the email based on that bean Id and it will be reflected there. Please let me know if you are up to something else.

    Cheers.

  5. #5
    ashokinsugar is offline Sugar Community Member
    Join Date
    Apr 2011
    Location
    INDIA
    Posts
    198

    Default Re: emailid not coming in logichook

    Hi Hats,

    For the accounts module, email bean id i am not getting . Can you please check?

    actually in the email field the value display as "ashok@test.com" i just want to assign hardcode as "hats@test.com" .

  6. #6
    ashokinsugar is offline Sugar Community Member
    Join Date
    Apr 2011
    Location
    INDIA
    Posts
    198

    Default Re: emailid not coming in logichook

    Hi Hats,

    Do you have any example codes?


    Quote Originally Posted by hats View Post
    Hi Ashok,

    Do you want to update the email field ? If so, then every email has one bean id associated with it.

    Update the email based on that bean Id and it will be reflected there. Please let me know if you are up to something else.

    Cheers.

  7. #7
    hats Guest

    Default Re: emailid not coming in logichook

    Hi Ashok,

    Try this in after_save logic hook.

    function updateEmail(&$bean=null, $event=null, $arguments=null) {
    global $db;
    $acc_id = $this->bean->id;
    $email_id = "email@test.com";
    $email_id_caps = strtoupper($email_id);

    $query = "UPDATE email_addresses ea join email_addr_bean_rel er on ea.id = er.email_address_id set ea.email_address='".$email_id."' and ea.email_address_caps='".$email_id_caps."' where er.bean_id='".$acc_id."' and ea.deleted=0 and er.deleted=0 and er.primary_address=1";

    $db->query($query);
    }
    Please let me know if that helps.

    Cheers.

  8. #8
    ashokinsugar is offline Sugar Community Member
    Join Date
    Apr 2011
    Location
    INDIA
    Posts
    198

    Default Re: emailid not coming in logichook

    Hi Hats,

    Thanks for your reply , the thing is in database(email@test.com) its fine, but on display i wanted (ashok@test.com)

  9. #9
    hats Guest

    Default Re: emailid not coming in logichook

    Hi Ashok,

    If I am getting it right, are you asking for displaying the fake value in detail view ?

    If so, then you can do $this->ss->assign("fakeEmail", $your_value) and use it in email1 field under detailview defs of your module.

    It will replace the original value and show this instead. If you want something else, then please let me know.

    Cheers.

  10. #10
    ashokinsugar is offline Sugar Community Member
    Join Date
    Apr 2011
    Location
    INDIA
    Posts
    198

    Default Re: emailid not coming in logichook

    Hi Hats,

    Yes, you are correct , but the fake value i want in edit view and not in deatil view. Deatil view I am geting and its working fine.

    In Edit view, since the email1 field is a relate type (link type) field , that is why I am facing the problem. I am unable to assign in editview.


    Regards,
    Ashok
    Last edited by ashokinsugar; 2013-09-19 at 12:04 PM.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. LogicHook
    By Joshbels in forum Developer Help
    Replies: 4
    Last Post: 2012-09-24, 09:49 AM
  2. LogicHook Order
    By z3r0 in forum Developer Help
    Replies: 2
    Last Post: 2010-08-21, 11:07 AM
  3. logichook seems fine, but no results
    By danrweki in forum Developer Help
    Replies: 20
    Last Post: 2008-09-11, 01:39 PM
  4. Help with LogicHook class
    By moschap in forum Help
    Replies: 2
    Last Post: 2008-07-23, 04:03 PM
  5. Help with LogicHook class
    By moschap in forum Installation and Upgrade Help
    Replies: 1
    Last Post: 2008-07-23, 04:01 PM

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
  •