Help!! Not able to render a field based on the option selected in the picklist while in edit mode

edited January 7, 2019 in Questions
I'm using the below custom snippet for a field. 

I'm not able to render the field when I select a value from the picklist value while i'm in edit mode. What I want is when the user selects Full or Partial from the picklist, I want to auto populate another field. I know how to update a value to another field but my problem is I'm not able to trigger this action when I select Full or Partial.

var $ = skuid.$;
var field = arguments[0],
    value = arguments[1],
    model = field.model,
    row = field.row;
var totalsize;

switch(field.mode)
        {
            case 'read':
                skuid.ui.getFieldRenderer(field.metadata.displaytype).read( field, value );
                switch (value)
                {
                    case 'Partial':
                   
                    break;

                    case 'Full':
                       
                        var totalsize=model.getFieldValue(row,'Program__r.Survey_Size__c');
                        
                        model.updateRow(row,'Total_Project_Size__c',totalsize);

                    break;
                        
                }
            break;


            case 'edit':
                
                skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value);
               
switch (value)
                {
                    case 'Partial':
                        
                    break;
                    case 'Full':
                       
                        totalsize=model.getFieldValue(row,'Program__r.Survey_Size__c');
                        model.updateRow(row,'Total_Project_Size__c',totalsize);
                    break;
                        
                }
            break;
            
            case 'readonly':
        }










Comments

  • edited January 7, 2019
    Any help or guidance appreciated..  
  • Matt SonesMatt Sones 💎💎💎
    edited January 7, 2019
    I believe you can just use a declarative model action with a 'field on a row changes' trigger to start an action sequence with a Branch and a Update field on Row action to get what you're after.
  • edited August 2, 2018
    Sorry for my ignorance. Where can I find 'Field on a row changes' trigger
  • edited August 3, 2018
    The user and all related content has been deleted.
  • edited August 6, 2018
    Thank you. It worked like charm. I didn't know about Branch. a great logic.
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!