Results 1 to 5 of 5

Thread: Listview - post request variable content

  1. #1
    roberti is offline Junior Member
    Join Date
    Nov 2010
    Location
    Bavaria
    Posts
    6

    Default Listview - post request variable content

    Hi,

    following John Mertic's HowTo "Adding your own ListView action items", I am trying to write a custom Controller
    that does some further processing on the data which is submitted by listviews Massupdate POST.

    As outlined in the example code, I am retrieving selected records by the uids submitted in the uid request variable. The problem occurs when I try to submit "all" records from the form. Only the uids of the records visible in the listview are submitted in the request variable. This behaviour is common for all modules. Obviously I missed something as this functionality seems to be there (see: listview export)

    Any help would be greatly appreciated.

    Thanks, Robert

  2. #2
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Listview - post request variable content

    You will see a variable in the request that is base64 encoded. Decode it and you will find all the information you need.
    CRM Software Engineer
    Eontek - www.eontek.rs

  3. #3
    roberti is offline Junior Member
    Join Date
    Nov 2010
    Location
    Bavaria
    Posts
    6

    Default Re: Listview - post request variable content

    Thanks for the hint. I decoded $_REQUEST['current_query_by_page'], put the format is a bit irritating. Is there any description available?

    Cheers, Robert

  4. #4
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Listview - post request variable content

    don't think so
    CRM Software Engineer
    Eontek - www.eontek.rs

  5. #5
    roberti is offline Junior Member
    Join Date
    Nov 2010
    Location
    Bavaria
    Posts
    6

    Default Re: Listview - post request variable content

    Well, I got it ... "unserialize()" helps. Sorry for bothering ...

    Nevertheless, this didn't fix my problem. I am now using this workaround to retrieve the uids, selected by the listview query form (n this case "Notes"):

    $where = $_SESSION['export_where']; // I feel this should be provided by $_REQUEST..

    if ($_REQUEST['select_entire_list'] == 1 ) {

    $sql = "select id from notes ".$where;
    $notes = SugarModule::get($_REQUEST['module'])->loadBean();
    $result = $notes->db->query($sql, true);

    while($note = $notes->db->fetchByAssoc($result)) {
    $recordIds[] = $note[id];
    }
    } else {
    $recordIds = explode(',',$_REQUEST['uid']);
    }

    Quick and dirty but works. Any suggestions welcome.


    Cheers, Robert

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 28
    Last Post: 2012-01-04, 06:12 AM
  2. Replies: 2
    Last Post: 2009-09-13, 11:22 AM
  3. Replies: 0
    Last Post: 2008-11-11, 03:03 PM
  4. HOWTO post a request for help that will most likely get a response
    By andrewhsu in forum Installation and Upgrade Help
    Replies: 5
    Last Post: 2007-11-06, 10:19 AM
  5. HTTP Post or XML Post...?
    By senaTTor in forum Help
    Replies: 0
    Last Post: 2007-06-04, 02:31 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
  •