Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans