Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to modify a date attribute in a category

Status
Not open for further replies.

MarcHoeijmans

Programmer
Oct 16, 2006
1
NL
Hello,
How can I change a date attribute value in a category. Other attributes (string values) can I change. I retrieve the XML of a category and modify the nodes with Xpath instructions.
Regards,
Marc Hoeijmans
 
a snippet from some C# code where I use dates.I do not use the xml methods so don't know if it helps or not.It is a little contorted to undesratnd but since you are doing the string it may help you.This is a cut and paste from different places so not a very good example

Code:
//Initialize any LAPI Objects			
LLValue attrValuesPath = (new LLValue()).setAssocNotSet();
LAPI_ATTRIBUTES	attr3 = new LAPI_ATTRIBUTES(session);

System.DateTime testDate = new System.DateTime(intLLISS_YEAR, intLLISS_MONTH, intLLISS_DAY);//make up a time stamp
LLValueNET DateValue = new LLValueNET(testDate);
LLValue attrValues3 = (new LLValue()).setList();

attrValues3.add(DateValue);

//catVersion hold the template of the category,"Issue date" is a filed and I am putting a date value on it

if(attr3.AttrSetValues(catVersion, "Issue Date", LAPI_ATTRIBUTES.ATTR_DATAVALUES, attrValuesPath, attrValues3) != 0)
	{
	WriteErrors(session, "Adding Issue date Failed.");								
	}

//Follow it with the full call

if(doc.SetObjectAttributesEx(objID, catVersion) !=0)
		{
WriteErrors(session, "SetObjectAttributesEx failed.");	
		}


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top