how to host application that pass context data to hosted application query string

Sep 1, 2010 at 5:45 PM
Hello experts, I am trying to pass a dynamics crm custom field value to my hosted web application via query string so that the application can reference the current contact detail in the Agent Destop. I know i can use CustomerID which return the ObjectID of the current contact, but how do i append a custom field. this is exactly what am trying to do: http:// myServer/Transfer.aspx?acctno= accountnumber; where account number is my custom field on the contact entity. Pls i need answers ASAP.
Sep 1, 2010 at 7:27 PM

Hi!

to do what you want, you will need to create an automation project that does this:

  • Get the value of custom field
    • you need to map your custom field using HAT
  • Using de activity navigate to go to your page with de paramaters that contains the value of your custom field

hope help you!

 

Sep 1, 2010 at 9:34 PM

Also, if the var is in the context, you can use the URL replacement feature of UII.
Lets say that you wanted to Navigate to the Contact form for ID 0000-0000-000-0000-00000, and that ID is in the CustomerID var in the context.

You can create an Action, where the URL = http://MyServer:5555/myOrg/sfa/conts/edit.aspx
and in the Query String you would put = id=%CustomerID

At run time… when you called this action, it would replace %CustomerID with the value in Context for Customer ID

MattB-MSFT

Sep 7, 2010 at 12:42 PM

Tanks Canikrause

I have been able to use the Inspect UI tool to map the custom field....

My problem now is how do I use the navigate activity in the workflow to dynamically set the url of the page i want to navigate to.

Is there a way i can do that in Code....

pls any suggestions...

 

 

Sep 16, 2010 at 5:55 PM

Below a example.
I´m using Code Activity to format the url and after this i set my public property in the navigation activity.
I created a  GetContext activity called GetCustomerID to get the information in the CCA context.
Hope help you.

public
sealed partial class Workflow1 : SequentialWorkflowActivity { private const string AccUrl = "http://server:5555/UNIMEDPOA/sfa/accts/edit.aspx?id={0}#"; private const string ContactUrl = "http://server:5555/UNIMEDPOA/sfa/conts/edit.aspx?id={0}#"; //this two public properties is that you'll set in the navigation activity public string UrlAccount = string.Empty; public string UrlContact = string.Empty; public Workflow1() { InitializeComponent(); }
        private void codeActivity1_ExecuteCode(object sender, EventArgs e) { if (this.getCustomerID != null) { this.UrlAccount = string.Format(AccUrl, "{" + this.getCustomerID.ContextValue + "}"); } } private void codeActivity2_ExecuteCode(object sender, EventArgs e) { if (this.getCustomerID != null) { this.UrlContact = string.Format(ContactUrl, "{" + this.getCustomerID.ContextValue + "}"); } } }