web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Suggested answer

Lead entity bpf missing

(0) ShareShare
ReportReport
Posted on by 180
When I create lead entity manually, I see bpf
 
When I create using below code from console app i don’t see it
Entity lead = new Entity("lead");
lead["subject"] = "Sample Lead";
lead["firstname"] = "John";
lead["lastname"] = "Doe";
lead["companyname"] = "Sample Company";
lead["emailaddress1"] = "johndoe@example.com";
 

How to create lead record with bpf using above code?

Thanks

 

Categories:
I have the same question (0)
  • KBpwr Profile Picture
    55 on at
    Lead entity bpf missing
    Hmmm, not sure of the entire context here, but seems to me like you aren't saving the lead to the database so it won't be visible in Dynamics.


    Try adding this:
     
    Guid leadId = service.Create(lead);

    This line saves the lead to the database and returns a unique identifier for the lead. Without it, the lead exists only in your application's memory and isn't stored in Dynamics.

    Maybe something like this for the full code:
     
    // Create a new lead entity and set its attributes
    Entity lead = new Entity("lead");
    lead["subject"] = "Sample Lead";
    lead["firstname"] = "John";
    lead["lastname"] = "Doe";
    lead["companyname"] = "Sample Company";
    lead["emailaddress1"] = "johndoe@example.com";
    
    // Save the lead to the database and get its unique ID
    Guid leadId = service.Create(lead);
    
    // Print the lead's unique identifier
    Console.WriteLine($"Lead created successfully with ID: {leadId}");
    
    // Retrieve the lead using its ID
    Entity retrievedLead = service.Retrieve("lead", leadId, new ColumnSet(true));
    
    // Optionally, print out some details of the retrieved lead
    Console.WriteLine($"Retrieved Lead: {retrievedLead["firstname"]} {retrievedLead["lastname"]}");
    
     
     
  • CrmUser101 Profile Picture
    180 on at
    Lead entity bpf missing

     
    I Mean to say business process flow is missing on top of the from when I create lead entity from c# code
    works perfectly when creating manually.
     

     
    How to create lead record from c# code with business process code on top of the form?
     
     
     
     
    Thanks,
  • Suggested answer
    Parvez Ghumra Profile Picture
    1,579 Moderator on at
    Lead entity bpf missing
    @CrmUser101

    Progress along a Business Process Flow is stored in a record that in a table that gets created when you create the Business Profile Flow. You should be able to find the metadata for this table using the Metadata Browser in the XrmToolBox or via the Maker Portal.

    You basically need to create a record in this BPF specific table too and relate it to your Lead for the BPF to be applied to the Lead record

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 663 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 398 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 235

Last 30 days Overall leaderboard

Featured topics