This topic contains 3 replies, has 0 voices, and was last updated by k_dunc 8 years, 4 months ago.
-
AuthorPosts
-
June 30, 2016 at 3:30 am #6363
Ben HI 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. -
June 30, 2016 at 5:25 am #6364
k_duncHi 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.
-
June 30, 2016 at 5:55 am #6365
Ben HOriginally 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
-
June 30, 2016 at 5:43 pm #6366
k_duncHi 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.
-
AuthorPosts
You must be logged in to reply to this topic.