on 06-05-2018 8:45 PM
Hi Experts,
We want to show Opportunity ID field in activity task header screen. So the scenario is Opportunity ID should be stored in a extension field created in Task header screen.
So this is like passing the standard field value from one business object to another.
I tried doing this with the help of process extension scenario but no such scenario exists.
In our case we are creating Opportunity and then a new task as follow up.
How can I do this ? Request you to kindly help .
Regards,
Saurabh Sharma
Hi Saurabh,
If you are creating task from Opportunity then you will get Opportunity ID under Activity.BusinessTransactionDocumentReference.BusinessTransactionDocumentReference.ID
You can use below script in BeforeSave of Activity Extension BO.
foreach(var i in this.BusinessTransactionDocumentReference)
{
//TypeCode 72 is for opportunity
if(i.BusinessTransactionDocumentReference.TypeCode.Matches("72") && i.BusinessTransactionDocumentRelationshipRoleCode.Matches("1"))
{
//ID is your extension field created on Task header screen
this.ID = i.BusinessTransactionDocumentReference.ID;
}
}
Regards,
Sujata
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
While creating Task we are checking whether task is creating from Opportunity or not.
Here, BusinessTransactionDocumentReference.TypeCode is checking document type (72 is for Opportunity) and
BusinessTransactionDocumentRelationshipRoleCode is checking relationship between Task and Opportunity(1 denotes Predecessor)
You can find these Type codes under Data Types in Repository Explorer.
Hope this will help you 🙂
Regards,
Sujata
Hi Saurabh Sharma,
You can add link to navigate to Opportunity using ID stored in your extension field.
here is the reference to create link:
https://www.youtube.com/watch?v=bhjPsXnGWNw
Regards,
Sujata
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.