Tuesday, September 1, 2015

OnBase Unity C# Visual Studio: update a keyword value

Ok, from previous posts, we know how to do the following: create an app connection, get a doc ID, create a doc object. Once we have those, we can modify a keyword's value. Note: this is not the same as adding a keyword, which is what you want to do if one doesn't exist. Hope this helps...

                        // check whether document was locked
                        if (documentLock.Status == DocumentLockStatus.LockObtained)
                        {

                            KeywordModifier keyModifier = doc.CreateKeywordModifier();

                            KeywordType searchKeywordType = g_Application.Core.KeywordTypes.Find("Your Date");

                            // loop thru keyword records
                            foreach (KeywordRecord keyRecord in doc.KeywordRecords.FindAll(searchKeywordType))
                            {
                                // loop though keywords
                                foreach (Keyword keywordOld in keyRecord.Keywords.FindAll(searchKeywordType))
                                {

                                    // Find Keyword Type 
                                    KeywordType keywordType0 = core.KeywordTypes.Find("Your Date");

                                    // Create Keyword Object
                                    DateTime newdate1 = DateTime.ParseExact(strDate,"MM/dd/yyyy", null);
                                    string strDatex = newdate1.ToString("MM-dd-yyyy");
                                    DateTime NewDateValue = Convert.ToDateTime(strDatex);

                                    Keyword keywordNew = keywordType0.CreateKeyword(NewDateValue);
                        
                                    //update keyword
                                    keyModifier.UpdateKeyword(keywordOldkeywordNew);

                                  
                                }
                            }

                            //Apply changes
                            keyModifier.ApplyChanges();

                            //release doc lock
                            documentLock.Release();
                           }

10 comments:

  1. Good! Directly yo Favorites. I'm from México. Regards.

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

    ReplyDelete
  3. cleaning of villas in Riyadh
    شركة تنظيف بالرياض
    شركة تنظيف فلل بالرياض
    Our company, which has years of experience in the field of cleaning and is a pioneer in this area, especially the cleaning of villas, whatever the size
    https://www.allsaad.com/70-2/

    home cleaning company in Al-Kharj
    شركة تنظيف منازل بالخرج
    The company deals with a group of detergents information source and authorized by the Ministry of Health
    https://www.allsaad.com/شركة-تنظيف-منازل-بالخرج/

    Home cleaning company in Makkah
    شركة تنظيف منازل بمكة
    The company is a leader in the cleaning of all types and forms, especially cleaning houses
    https://www.allsaad.com/شركة-تنظيف-منازل-بمكة-2/

    Best steam cleaning company in Mecca
    شركة تنظيف بالبخار بمكة
    The company is keen on the health and safety of its customers, so it is used in the cleaning of steam devices for purification and sterilization, where the steam is heat on the bacteria and microbes that stick to the floors or walls and work to remove and cleanse the place
    https://www.allsaad.com/افضل-شركة-تنظيف-بالبخار-بمكة/

    Cleaning Company in Yanbu
    شركة تنظيف بينبع
    https://www.allsaad.com/شركة-تنظيف-بينبع-2/

    Furniture Transport Company in Yanbu
    شركة نقل اثاث بينبع
    The company deals with specialists in the field of furniture transfer, they are professional in the transfer of each piece in a special way easy to maintain
    https://www.allsaad.com/شركة-نقل-اثاث-بينبع-2/

    ReplyDelete

  4. Cleaning Company in Yanbu
    شركة تنظيف بينبع
    The summer and the high temperatures with a great laziness in the cleaning of the place causing the emergence of insects and rodents badly and the consequent spread of diseases, so the company deal with the staff of the distinctive cleaning complete place and are keen to provide them with the latest equipment and advanced technology to enable them to carry out cleaning operations In an integrated manner
    https://fajr-sate3.com/cleaning-company-yanbu/


    Furniture transfer company in Madinah
    شركة نقل اثاث بالمدينة المنورة
    The company offers the best workers trained to the highest level of furniture to move scientifically without damage or the occurrence of any scratch is encapsulated and carried in a correct way and put it in cars special for the transfer of furniture and is characterized by dry completely from the inside does not cause any damage to furniture as well as good ventilation, Offers prices for all categories
    https://fajr-sate3.com/furniture-moving-medina/


    Cleaning company in Medina
    شركة تنظيف بالمدينة المنورة
    The company always relies on the best in providing its services to reach the highest quality and best service
    https://fajr-sate3.com/cleaning-company-medina

    Furniture Transport Company in Yanbu
    شركة نقل اثاث بينبع
    "

    The company follows a set of steps organized in the process of moving furniture in order to ensure the safety of all pieces and the company is keen to provide all the modern devices used in the transfer process to ensure the quality of services provided to its customers
    https://fajr-sate3.com/furniture-movers-yanbu/

    ReplyDelete

  5. Cleaning company in Medina
    شركة تنظيف بالمدينة المنورة
    Cleaning types and each type needs to experience and quality in its performance and the use of materials and detergents suitable for each type until we get the best results and this is what our company is concerned with it is dealing with a knowledgeable and experienced staff of all types of cleaning methods and correct and safe in its performance
    https://www.cleanriyadh.com/cleaning-company-in-medina/


    Furniture Transport Company in Yanbu
    شركة نقل اثاث بينبع The company provides a wide range of special and modern devices that are used in the dismantling and installation of furniture professionally and workers are cleaning the dust completely before and after the process of jaw, because the furniture will be wrapped in the house before the transfer to ensure the safety of different pieces
    https://www.cleanriyadh.com/furniture-moving-company-yanbu/

    Cleaning company in Yanbu
    شركة تنظيف بينبع
    The company always relies on the best in providing its services to reach the highest quality and best service
    https://www.cleanriyadh.com/cleaning-company-yanbu/

    Safrat Cleaning Company in Riyadh
    شركة الصفرات للتنظيف بالرياض
    Al Safrat Cleaning Company in Riyadh provides a wide range of detergents that remove the most difficult stains easily and without leaving any traces or damage to the color, whether cleaning is done on fabrics and furnishings or carpets and rugs
    https://www.cleanriyadh.com/شركة-الصفرات-للتنظيف-بالرياض/

    Al - Safrat Company for Insect Control in Riyadh
    شركة الصفرات لمكافحة الحشرات بالرياض
    Insects are one of the most important things that need attention and control very quickly because they spread very quickly when any of them are discovered at home. Therefore, the house must be fully and continuously maintained to prevent the entry of any insects from the outside. Place
    https://www.cleanriyadh.com/شركة-الصفرات-لمكافحة-الحشرات-بالرياض/

    ReplyDelete

  6. https://mtgryonline.com/store/farfetch/

    https://cordba.com/farfetch-promo-code/

    https://coupooons.com/stores/فارفيتش-farfetch/

    https://www.youtube.com/watch?v=GCpsnmMgCAo

    https://www.youtube.com/watch?v=M-8-6bUIIoA

    https://www.youtube.com/watch?v=PpkJSbsriKM

    https://www.youtube.com/watch?v=2OwcGbVB14M

    https://www.youtube.com/watch?v=PxcAz_HLmcs

    ReplyDelete