Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
1. I have created a custom entity and i have added a field called linenum(extends tradelinenum) . I want this field to incremented each time a new record is imported. How can I achieve it.
Some facts about my data entity
1. It's a set based entity. I have overridden copystaging to target method
2. I can set the auto increment property on linenum . Reason linenum is a part of the index on entity and staging table and linenum is set as noneditable and mandatory. Noneditable fields can't be set as autogenerated in the entity mapping.
3. I tried to override the insert method on the staging table but it dint work.
Please advise how can I achieve this.
What logic you wrote in copystatingtoTarget method ? Are you inserting data in table through insert_recordset statements ?
In postgetstagingdata method I am doing some data mapping like item I receive in file I update it with item in d365(update staging table) using insertrecordset and updaterecordset. In copyTargettostaging I am using while to loop through staging table and create some orders. Why while loop in copytargettostaging ? Because I receive flat file(header and line in one row) and also I have to do some logic before I insert data in target .
Writing while loop with in copytargettostaging method does not make sense because you are not doing set based operation. Anyways you said this is custom entity then what if you make this field editable and set autogenerated ? Did you try that ?
So the field is non-editable and mandatory on table? A quick work around will be to change mandatory to "no".
Then I do not think what you are trying to achieve is possible with a Data Entity that supports set-based sql operations.
I haven't overridden methods on the staging table - I am quite sure that logic is meant to be on the Data Entity.
I can assist with exactly where you need to place the LineNum generation code - but first please confirm the Allow Edit, Allow Edit on Create and Mandatory properties on the table as well as the Data Entity.
Hi allowwdit and allowedit on create are set as yes on staging and on dataentity its auto
Yes I tried and it works and I am aware of it. However i am finding ways to generate linenum via code.
Firstly - forget about the staging table. Don't edit anything there. You should only update the staging table from the data entity (that option when you right click on the data entity top node).
You did not mention the properties on the actual table. I assume it is AllowEdit-No, AllowEditOnCreate-Yes and Mandatory-Yes.
Then do the following:
Business Applications communities