Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Derived field from Picklist

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
sdibben
926 Views, 7 Replies

Derived field from Picklist

I have created a pick list with the pick list option as USER, ALL by name.  This allows me to assign an individual as a resource.  After creating this I need to have the selected USER's email address for a script to send him an email.  It is not allowing me to make a derived field from that picklist.  

If this isn't possible what are my options for assigning different people as a resource and emailing only that individual at certain transitions.  Thanks.

7 REPLIES 7
Message 2 of 8
jpiggee
in reply to: sdibben

Hello and Welcome.

Correct what you are trying to achieve cannot be done by derived fields, however a on creation or on edit script can pull the information from the user (by using the userid), and populate a given field with in the workspace with that users given email.

 

This will then allow you to call upon the email field and use that as the address to send the email in question.

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 3 of 8
sdibben
in reply to: sdibben

Thanks Joe,  That gets me part of the way.  From the USER, ALL by Name pick list it will grab lastname and first name (Doe, John).  I see no way of getting the email address from the last and first name.  The Security.loaduser (userID) requires the login for Doe, John.  How will I get the UserID for the All by Name pick list item?  I see nothing in the script reference that shows this can be done.  Thanks again

Message 4 of 8
dkeeley
in reply to: sdibben

Hi,

 

I had the same problem. See the following post;

 

http://forums.autodesk.com/t5/Autodesk-PLM-360/User-email-address-in-scripting/td-p/.UN_7wXwgGSM

 

I had to use a work-around. All of our system user names have the following format;

 

Example username: dkeeley

Example name: Keeley: David

Example email: dkeeley@company.com

 

As you have pointed out the only value that can be extracted from the pick list is the 'name' value. There's currently no way to get the associated email address by scripting. So instead I used some string scripting to convert the 'name' to the 'username' and then add a '@company.com' to the end of it. It seems to work well but has some limitations. For example the 'admin' user will not receive emails using this method (but some conditions can be built into the script to overcome this if necessary)

 

Hope this helps,

 

David. 

Message 5 of 8
jpiggee
in reply to: sdibben

David,

 

Thank is an excellent option, one I haven’t thought of.

 

As to the original concept, a script could create a userid from the first name and last name, if you uses a standardized userid, with would then give you access to everything. 

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 6 of 8
sdibben
in reply to: sdibben

Thanks for the help.  That is the direction I will go.

 

Scott

Message 7 of 8
dkeeley
in reply to: sdibben

Hi Joe,

 

Yes you are correct. As soon as you have created the use rid from the username then the email address can be extracted automatically. 

 

Glad this helped. i've given the script for converting the username to user I'd in my original post. 

 

david. 

Message 8 of 8
dkeeley
in reply to: dkeeley

    var user_name_length = user_name.length;

    var char_position = user_name.indexOf(',');

    var letter = user_name.charAt(char_position + 2);

    var user_surname = user_name.substring(0,char_position);

    var user_id_temp = letter + user_surname;

    var user_id = user_id_temp.toLowerCase();

    var user_details = Security.loadUser(user_id);

    email.to = user_details.email;

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report