Any tips - Task Model, Who Id (Assigned To) field should render User, Partner User as pick list

edited February 10, 2017 in Questions
Want to make Assigned To field on Task, should point Partner User, User instead of Lead, Contact.

We have followed the reference

"https://community.skuidify.com/skuid/topics/can_i_limit_which_objects_are_possible_targets_of_polymo..."  _ as well followed the given proceedures such as

1) creating inline snippet
2) using that snippet for custom field renderer

But it doesn help us the way we expect.  Any help with this asap will be appreciated.  Thanks.

Comments

  • Matt SonesMatt Sones 💎💎💎
    edited February 10, 2017
    Vijay,

    Can you post your snippet so we can take a look?
  • edited June 26, 2015
    Hi Matt,

    Thanks for your reply.  Please find the below snippet which i tried for custom field renderer.
    -----------------------------------------------------------------------------------------------------------------------------

    //// CONFIGURATION 
    // 
    // Define the possible target objects 
    var targetObjects = ['Account', 'Opportunity']; 
    // Render as a Picklist instead of an Autocomplete? 
    var renderAsPicklist = false; 
    var field = arguments[0], 
        value = skuid.utils.decodeHTML(arguments[1]), 
        metadata = field.metadata, 
        $ = skuid.$; 
    if (field.mode == 'edit') { 
        // Limit the set of target objects 
        var targets = [], 
           uniqueTargets = {}; 
        $.each(metadata.referenceTo,function(i,r){ 
           if (($.inArray(r.objectName,targetObjects) != -1) && (!uniqueTargets[r.objectName])) { 
              targets.push(r); 
              uniqueTargets[r.objectName] = 1; 
              if (targets.length == targetObjects.length) return false; 
            } 
        }); 
        if (targets.length) { 
           // Make this field render as a picklist? 
           if (renderAsPicklist) field.options.type = 'REFPICK'; 
           // Override the current referenceTo 
           metadata.referenceTo.length = 0; 
           metadata.ref = $.map(targets,function(targ){return targ.objectName;}).join();
           metadata.referenceTo = targets; 
        } 

    // Run the standard renderer 
    skuid.ui.fieldRenderers[metadata.displaytype][field.mode](field,value); 
  • Rob HatchRob Hatch 💎💎💎
    edited September 1, 2016
    Very first line.  You have not defined appropriate TargetObjects.  I think you need to use PartnerUser and User.  

    What I don't know is whether those two objects are allowed for the Assigned To polymorphic field. 
  • edited July 2, 2015
    Rob Hatch Just for testing i gave TargetObjects as Account, Opportunity.  Still even it is not changing from Contacts, Leads.  Thats what the problem.  I should have put in already, it s my mistake.

    Any help would be appreciated.
  • edited July 2, 2015
    Rob Hatch Just for testing i gave TargetObjects as Account, Opportunity.  Still even it is not changing from Contacts, Leads.  Thats what the problem.  I should have put in already, it s my mistake.

    Any help would be appreciated.
  • edited July 2, 2015
    @Rob Hatch  in usual salesforce Task Assigned to would be users only, means users, partner users like that.  But in skuid task assigned to is challenge facing.  Thats where i required help
  • Rob HatchRob Hatch 💎💎💎
    edited September 1, 2016
    I'm now very confused.  You are correct that Assigned to field usually only allows you to assign users.  Is this a custom relationship field or just the standard one?  Does this specific field work correctly in a standard layout?  I think there is somthing more fundamental going on than what can be solved with the custom renderer. 
  • edited September 1, 2016
    @Rob Hatch, yes you are right, it works fine with standard salesforce layout.  To get you more clarity in this.  Salesforce Set Up-> Activities -> Task Fields -> Assigned To (Who Id) look up with Contact. Lead.  This is what shows in the Skuid.  To Solve this, we have used above given skuid js script to render in Assigned To field.  But it wasnt wrk.

    Could you please help me.
  • Rob HatchRob Hatch 💎💎💎
    edited September 1, 2016
    If the base configuration binds the Who Id to Contact and Lead,  Skuid will NOT be able to change that binding using Javascript.  You will have to change that in the core setup.  All Skuid can do is limit the options that have been detailed in setup. 
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!