Please follow the instructions below to set up theworkflow.
1. Create a TransactionBody custom field Sales Person of type Text Area.
2. Navigate to Customization > Workflow> Workflows > New. Click New.
3. In the workflow, underBasic Information set below mentioned fields,
- Name = Employee PO(NOTE - You can change it as per your desire)
- Record Type =Transaction
- Sub Type = PurchaseOrder
- Owner = Yourself
- Execute as Admin = True
- Released Status =Released
- Enable Logging = True
4. Under Initiation setbelow mentioned fields,
- Tick "EventBased"
5. Under Event Definition setbelow mentioned fields,
- On Create = True
- On Update = True
- Trigger Type = All
6. Click Save.
7. Click State 1, Name ="State 1 : Add Employee Details" and click Save.
8. Add an action "SetField Value" to the state "State 1 : Add Employee Details".
- Trigger On = After FieldEdit
- Client Field = Employee
- Under Parameters setbelow mentioned fields,
Field = Sales Person
In the "Value" group, tick "Formula" and putthis code under the field,
nlapiLookupField('employee' ,nlapiGetFieldValue('employee'), 'firstname') + ' ' + nlapiLookupField('employee' , nlapiGetFieldValue('employee'),'lastname') + '\n' + nlapiLookupField('employee' ,nlapiGetFieldValue('employee'), 'email') + '\n'+ nlapiLookupField('employee' ,nlapiGetFieldValue('employee'), 'phone')
9. Click Save.
Now create a Purchase Order, on selection/change of the"Employee" field the workflow will auto populate the "SalesPerson" field with that Employee's name, email and phone number.
No comments:
Post a Comment