Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Unanswered

Custom WorkFlow Action wiht field lookup

Posted on by 5

I'm doing a simple exercise, the objective is to create an action who receive inputs and then pass them to another entity. For example, i have an entity "Purchase" and there i have the client name, price, etc. I create a button "Pay" and with that i want to pass the ProductName and Price to other entity call it "invoice". The field ProductName is a lookup and its in this field that i don't know what to do.

So in the other field i just do:

[Input("Preco"), RequiredArgument]

public InArgument<decimal> Preco
{
get;
set;

}

and then i do :

Entity invoice = new Entity("train_invoice");


invoice["train_cost"] = Preco.Get(executionContext);

and when i try to do the same for the field who is a lookup : 

[Input("NomeP"), RequiredArgument]

public InArgument<EntityReference> Pessoa
{
get;
set;

}

and i call it this way : 

invoice["train_buyerin"] = Pessoa.Get(executionContext);



and obviously this won't work, can someone help me ?
I don't know how to call a lookup.

  • RE: Custom WorkFlow Action wiht field lookup

    Hello, here is a sample to create a custom workflow activity, with the prerequisites and requirements: docs.microsoft.com/.../sample-create-custom-workflow-activity.

    And here is an example with code that could be very helpful: github.com/.../SimpleActivities.cs.

    Thanks!

    Community Support Team - Esteban

    If this Post helps, then please consider Accept as solution to help the other members find it more quickly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans