Dynamically change captions possible?

Currently on CRM7.3 SP1.1 - I love the new Client-Side API and know how to change field and caption appearance using crm.fields() commands but now I'd like to override the normal caption of a field based on the Opportunity Team (if oppo_channelid==8 change caption to "Contract Rec'd Date"). Is this even possible, and if so what is the proper syntax? Thanks.

  • 0

    Got it -- not explicitly stated in Help files, it was deceptively simple. Posted here for reference, placed in Custom Content of screen:

    var vTeam = crm.fields("oppo_channelid").value();

    if(vTeam==8){

    crm.fields("oppo_aaipodate").caption('Contract Recd Date');

    }

  • 0

    I was also wondering if we can override the normal caption of a field based on the Opportunity Team. Thanks for sharing, Julie! Will try it out and let you know if it works,

  • 0

    I think I've found a bug in CRM 2018 R1 or else this client-side script does not work under the following conditions:

    1. Search screen for a custom primary entity

    2. the data source is a view that does a LEFT JOIN to a secondary table

    3. the field suffix for the secondary table is "uarct"

    4. the field in question is from that joined table: uarct_totalbillings

    5. the field has a caption defined ("Total Billings")

    6. the field is a currency field

    The bug is that the caption displays in this format

    i.e.:

    uarct Total Billings:

    Here's my full CustomContent script.

    crm.ready(function(){crm.fields("uarct_totalbillings").caption('Total Billings');})