This topic contains 3 replies, has 0 voices, and was last updated by k_dunc 8 years, 4 months ago.

  • Author
    Posts
  • #6363

    Ben H

    I have a custom record with the Include Name field checked, I need this so that this record set appears on another record as a name, what I want to do is set the NAME field with values from other fields on the record before it is submitted.

    So I have Fields

    First name = Me

    Last Name = Me

    And I want that to set the NAME field to = Me Me.

    Is this possible? I’ve tried as a save record form script but the mandatory requirement for NAME kicks in before the script, My only other thought is on a field changed but as it requires 2 fields data to populate it how would I get this to work properly.

    I also have an online form which creates this record, the NAME field is not on the form and when it submits it sets to a ID number automatically which I can then change on a On create workflow but I am not able to use this for a UI submission.
    This is a cached copy. Click here to see the original post.

  • #6364

    k_dunc

    Hi Ben,

    Yes, this is achievable. I’ve done something similar. I wrote a function that sets my NAME field based on other fields populated on the form. The set field value line looks like this:

    Code:
    nlapiSetFieldValue(‘name’, meetingName);
    I saved this script and uploaded it to my client’s site. From within my Custom Entry Form (i.e., where you set up how the entry form looks), and within the Custom Code subtab, I linked my script in the “Script File” field, and entered my function name in the “Save Record Function” field.

    So how this works, is upon pressing save, my NAME field is automatically updated with my ‘meetingName’ string.

    Hope that helps. Cheers,

    Kirk.

  • #6365

    Ben H

    Originally posted by k_dunc

    View Post

    Hi Ben,

    Yes, this is achievable. I’ve done something similar. I wrote a function that sets my NAME field based on other fields populated on the form. The set field value line looks like this:

    Code:
    nlapiSetFieldValue(‘name’, meetingName);
    I saved this script and uploaded it to my client’s site. From within my Custom Entry Form (i.e., where you set up how the entry form looks), and within the Custom Code subtab, I linked my script in the “Script File” field, and entered my function name in the “Save Record Function” field.

    So how this works, is upon pressing save, my NAME field is automatically updated with my ‘meetingName’ string.

    Hope that helps. Cheers,

    Kirk.

    Thanks for the reply, Can I check you say the field is updated, does this mean your NAME field already contains a value?

    When I try this with a blank NAME field I still get the mandatory field notification pop up to say it needs a value before it can be saved. So they Save Record function does not even start due to that blank field?

    IGNORE this I had an error on my code, it is now working, thanks

  • #6366

    k_dunc

    Hi Ben,

    I’ve just tested this again now, and I can confirm that I have nothing in the NAME field at the time of pressing Save. Upon saving, the Name field is then populated with my string.

    If for whatever reason, this isn’t working for you, can you not maybe try setting the NAME field with some default value (just for now), only to then have it overwritten upon saving? You could even set the field to INLINE perhaps, such that no one can edit the field. Anyway, just some thoughts.

    Cheers,

    K.

You must be logged in to reply to this topic.