Tuesday, August 13, 2019

How to add an Entity in Data Project through code (X++)

         DMFDefinitionGroupEntity   addEntity;

        if (DMFQuickImportExportFormHelper::validateEntity(_entityName, _sourceName, DMFOperationType::Export))
        {
            ttsbegin;
            addEntity.clear();
            addEntity.initValue();
            addEntity.DefaultRefreshType = DMFRefreshType::IncrementalPush;
            addEntity.DefinitionGroup = _definitionGroup;
            addEntity.Entity = _entityName;
            addEntity.EntityXMLName = _targetEntity;
            addEntity.SkipStaging = NoYes::Yes;
            addEntity.source = _sourceName;
            addEntity.validationStatus = NoYesError::Yes;
            addEntity.ExecutionUnit = NoYes::Yes;
            addEntity.LevelInExecutionUnit = NoYes::Yes;
            addEntity.insert();

            //Generate mapping
            DMFXmlGeneration::generateMappingV2(addEntity);
            ttscommit;
                       
           
        }

Variables -

  1. _entityName - Name of the Entity
  2. _SourceName - Source Data Format (like BYOD, Excel)
  3. _definitionGroup - Definition Group Name (or Data Project Name)

#DataEntities #X++ #D365F&O #DMF

6 comments:



  1. Really appreciate this wonderful post that you have provided for us.Great site and a great topic as well I really get amazed to read this. It's really good.
    I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!.
    mobile phone repair in Fredericksburg
    iphone repair in Fredericksburg
    cell phone repair in Fredericksburg
    phone repair in Fredericksburg
    tablet repair in Fredericksburg
    mobile phone repair in Fredericksburg
    mobile phone repair Fredericksburg
    iphone repair Fredericksburg
    cell phone repair Fredericksburg
    phone repair Fredericksburg

    ReplyDelete
  2. I was diagnosed as HEPATITIS B carrier in 2013 with fibrosis of the
    liver already present. I started on antiviral medications which
    reduced the viral load initially. After a couple of years the virus
    became resistant. I started on HEPATITIS B Herbal treatment from
    ULTIMATE LIFE CLINIC (www.ultimatelifeclinic.com) in March, 2020. Their
    treatment totally reversed the virus. I did another blood test after
    the 6 months long treatment and tested negative to the virus. Amazing
    treatment! This treatment is a breakthrough for all HBV carriers.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. My name is Olisa Blessing, I am so happy. I never believe I will be this happy again in life. I have worked as an air hostess ( cabin crew ) for 3years but early this year, I lost my job because of this deadly disease called Herpes virus (HSV). I never felt sick or notice any symptoms. Not until the day all workers were asked to bring their doctors report card, that was how I got tested and I found out that I'm HSV positive and that made me lose my job because it was considered as an STD and is an incurable disease. I was so depressed that I started thinking of suicide.
    I explained my situation to an older friend of mine, who often said to me 'a problem shared is a problem half solved. She felt so pity for me that she referred me to Dr. Utu Herbal Cure, that was how I contacted Dr. Utu and got the medication from him and was cured for real.
    I went back to my work a month later with another HSV negative test result and they carried out another test to be very sure and they found out I am herpes negative.
    Finally, the initial result was replaced with the new HSV negative test results and my position was renewed with an apology letter and a salary increase.
    Beware of impersonators,
    Dr. Utu can only be reached at:
    drutuherbalcure@gmail.com

    ReplyDelete
  6. I’d recommend using Dr. Utu Herbal Cure topically for instant pain and itch relief as well as accelerated healing of lesions and permanently stopping oral and genital herpes virus outbreaks. I have tried just about everything from acyclovir suppressive therapy to different natural oils, extracts, and other natural methods, some of which are EXTREMELY painful and exacerbate the problem (i.e. apple cider vinegar!). While vitamin E oil and suppressive therapy worked well for me, when I became pregnant I went back to trying to find a herbal cure. I was using vitamin E oil topically for a while but it was thin and difficult to use and only seemed to prevent further outbreaks rather than getting rid of it. I contacted Dr. Utu Herbal Cure through my friend. To my surprise, I could tell my outbreak was starting to heal within only a few hours! No more itching or pain! Dr. Utu Herbal Cure that I used was liquid herbs in bottles, so it was very easy to use. It simply whiffs, but it works so I don’t care! The best part is I successfully delivered a herpes-free beautiful daughter without further medication. Anyone who’s tried Dr. Utu Herbal Cure knows just how quickly those treatments can add up. So give it a try! Anyone can reach Dr. Utu through drutuherbalcure@gmail.com
    +2349072733661

    ReplyDelete