calling list<pc> _pclist = new list<pc>(); ...add pc pclist.. writexml<list<pc>>(_pclist, "ss.xml"); function public static void writexml<t>(t o, string filename) { string filepath= environment.getfolderpath(environment.specialfolder.applicationdata) + "\\genweb2\\adsnopper\\" + filename; xmldocument xmldoc = new xmldocument(); xpathnavigator nav = xmldoc.createnavigator(); using (xmlwriter writer = nav.appendchild()) { xmlserializer ser = new xmlserializer(typeof(list<t>), new xmlrootattribute("therootelementname")); ser.serialize(writer, o); // error } file.writealltext(filepath,xmldoc.innerxml); } inner exception unable cast object of type 'system.collections.generic.list 1[pc]' type 'system.collections.generic.list 1[system.collections.generic.list`1[pc]]'. please help the problem line xmlserializer ser = new xmlserializ...
in form have date field gets current date in mm/dd/yyyy format , field auto-generates number. i want populate field in following format: yyyy-mm-dd-autogenreate number . where year , month , date current dates of form. how do this? , not @ coding if achieved through java script please specific possible. assuming field doesn't have populated when load new entity, add onsave event form: var datefieldvalue= xrm.page.getattribute('datefieldname').getvalue(); var autonum = xrm.page.getattribute('autonumfieldname').getvalue(); /* date formatting guido preite's answer https://community.dynamics.com/crm/f/117/p/109891/218598.aspx#218598 */ // create yyyy-mm-dd string var year = datefieldvalue.getfullyear()+""; var month = (datefieldvalue.getmonth()+1)+""; var day = datefieldvalue.getdate()+""; var dateformat = year + "-" + month + "-" + day; xrm.page.getattribute('otherfield').se...
Comments
Post a Comment