Hi, Please find the file attached. OS is Unix.
With Regards, Anuj Dua -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arsl...@arslist.org] On Behalf Of Misi Mladoniczky Sent: Tuesday, May 18, 2010 12:52 PM To: arslist@ARSLIST.ORG Subject: Re: Critical: Getting ARERR 121 while Using C API ARSetEntry Hi, First you must give us some info or snippet from your code. Specifically the ARSetEntry-call in itself, and enough to understand how you are putting the Request ID list together. Secondly, the OS where you run your client can be useful. Best Regards - Misi, RRR AB, http://www.rrr.se Products from RRR Scandinavia: * RRR|License - Not enough Remedy licenses? Save money by optimizing. * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs. Find these products, and many free tools and utilities, at http://rrr.se. > Hello, > > While modifying ticket using C API "ARSetEntry", I am getting ARERR 121 > (Entry error in the Request ID list.) > > Please suggest what should be done. > > ARS configuration : 6.3 > > With Regards, > Anuj Dua > > > _______________________________________________________________________________ > UNSUBSCRIBE or access ARSlist Archives at www.arslist.org > attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are" > > -- > This message was scanned by ESVA and is believed to be clean. > > _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are" _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"
CreateBatch.pc
Description: CreateBatch.pc
/* FILE HEADER */ /* File Name : SDrifapi_modifyticket.c */ /* Description : This program will receive field Ids and values from */ /* applications & would insert a ticket in Remedy */ /* Author : */ #include<ar.h> #include<arerrno.h> #include<arextern.h> #include<arstruct.h> #include<stdio.h> #include<stdlib.h> #include<string.h> #include<time.h> #include<unistd.h> #include<SDrif_Structure.h> int RifCreateTicket(AREntryIdType *ticketId,struct IdValueList *L_idValLst, unsigned int NumOfItems, FILE *logfile) { ARNameType L_stSchema; ARFieldValueList L_fldList; ARStatusList status={0,NULL}; ARValueStruct L_stvalStruct[18]; ARFieldValueStruct L_stfieldvalstruct[18]; AREntryIdList IdLst; char sDateStr[11],sTimeStr[9], sDay[3],sMon[3], sYear[5],sHour[3], sMinute[3],sSecond[3]; char *sBackUpServer[10]; struct tm tmStruct; /* initializing TicketID with NULL */ // memset(L_TicketID,NULL,sizeof(AREntryIdType)); /* Since only 13 fields are mentioned in FGD still there are some other field */ /* which are mandatory for inserting a ticket in Remedy like - */ /* Support Priority, Case Type ,Call Source,Status so setting default values */ /* for these fields here */ /* enum L_Status {New=0,Assigned,Pending,Work_In_Progress,Resolved,Closed}; enum L_Status L_CallStatus=Resolved; enum L_Closure_Code {Successful=0,Successful_with_Problems,Unsuccessful,Automatically_Closed,Workaround_Requiring_RCA,By_Passed,User_not_Responded}; enum L_Closure_Code L_CallClosure_Code=Successful; */ int L_iCtri,L_iCtrj,iCtr; int L_iResult=0; int L_PreviousServerUp = FALSE; /* flag to check if the remedy server is up */ ARBoolean L_cadminFlag=0; int i=NumOfItems; int L_iStringCompare; IdLst.numItems=1; IdLst.entryIdList=(AREntryIdType *)malloc(sizeof(AREntryIdType)); IdLst.entryIdList=ticketId; fprintf(logfile,"[%d]: fields passed\n",NumOfItems); fprintf(logfile,"[%s]: TicketID\n",IdLst.entryIdList); /* This will call the Control Structure . */ /* Control Record contains information about the user and environment.*/ /* Paramaters are taken from RifHdr (Header File) */ /* In case of any failure it will write to Log file. */ memset(L_stvalStruct,NULL,sizeof(ARValueStruct)); memset(L_stfieldvalstruct,NULL,sizeof(ARFieldValueStruct)); memset(sDateStr,NULL,sizeof(sDateStr)); memset(sTimeStr,NULL,sizeof(sTimeStr)); memset(sDay,NULL,sizeof(sDay)); memset(sMon,NULL,sizeof(sMon)); memset(sYear,NULL,sizeof(sYear)); memset(sHour,NULL,sizeof(sHour)); memset(sMinute,NULL,sizeof(sMinute)); memset(sSecond,NULL,sizeof(sSecond)); /* It will check if ARinitialization is successful or not.In case of problem ** It will write into log file through function call if_arerror_exist ** To check whether server is up & Running it will call another API ** ARVerifyUser tries to establish contact with server and in case of problem ** returns Error Message to application through L_IdMsg structure */ fprintf(logfile,"Initializing session with primary server [%s]...\n", G_CtrlStruct.server); L_iResult=ARInitialization(&G_CtrlStruct,&status); if( L_iResult != 0 ) { L_PreviousServerUp = FALSE; fprintf(logfile,"ERROR [%d]: calling ARInitialization()...\n",L_iResult); fprintf(logfile,"ERROR MESSAGE: %s\n",(status.statusList)->messageText); fflush(logfile); } else { L_iResult = ARVerifyUser(&G_CtrlStruct,&L_cadminFlag,NULL,NULL,&status); if( L_iResult == 0 ) { L_PreviousServerUp = TRUE; } else { L_PreviousServerUp = FALSE; fprintf(logfile,"ERROR [%d]: calling ARVerifyUser()...\n",L_iResult); fprintf(logfile,"ERROR MESSAGE: %s\n",(status.statusList)->messageText); fflush(logfile); } } /* now establishing session with the backup server as primary is not up */ iCtr=0; sBackUpServer[iCtr]=strtok(G_BackupARServer,";"); do { if( L_PreviousServerUp == FALSE ) { fprintf(logfile,"[%s]: Initialization for BACKUP SERVER [%s]..\n",GetTime(), sBackUpServer[iCtr]); /* setting the backup server name */ strcpy(G_CtrlStruct.server,sBackUpServer[iCtr]); L_iResult=ARInitialization(&G_CtrlStruct,&status); if( L_iResult !=0 ) { L_PreviousServerUp = FALSE; fprintf(logfile,"ERROR [%d]: calling ARInitialization() for backup...\n", L_iResult); fprintf(logfile,"FATAL ERROR : Backup server is also DOWN !!!\n"); fprintf(logfile,"ERROR MESSAGE: %s\n",(status.statusList)->messageText); fflush(logfile); } else { L_iResult = ARVerifyUser(&G_CtrlStruct,&L_cadminFlag,NULL,NULL,&status); if( L_iResult == 0 ) { L_PreviousServerUp = TRUE; } else { L_PreviousServerUp = FALSE; fprintf(logfile,"ERROR [%d]: calling ARVerifyUser() for backup ...\n",L_iResult); fprintf(logfile,"FATAL ERROR : Backup server is also DOWN !!!\n"); fprintf(logfile,"ERROR MESSAGE: %s\n",(status.statusList)->messageText); fflush(logfile); } } } /* if previous server is not up then terminate session and return NULL */ }while((sBackUpServer[++iCtr]=strtok(NULL,";"))!=NULL); /* if backup server is no also up then terminate the session and return NULL */ if( L_PreviousServerUp == FALSE ) { ARTermination(&G_CtrlStruct,&status); return -1; } /* if backup server is not also up */ strcpy(L_stSchema,"HPD:HelpDesk"); //L_fldList.numItems = NumOfItems + 2; L_fldList.numItems = NumOfItems; /* Schema Name would be HPD:helpDesk since ticket is inserted in this form */ /* Now Running the loop the extract value from Application Structure and */ /* and put it in Remedy StructuresARValue Struct & ARFiledValueStruct */ /* This LOOP will run NumOfItems(no of fields passed by application */ for (L_iCtri = 0 ;L_iCtri<i;L_iCtri++) { /* LOOP Starts Here */ L_stfieldvalstruct[L_iCtri].fieldId=L_idValLst[L_iCtri].Id; switch(L_stfieldvalstruct[L_iCtri].fieldId) { /* SWITCH starts Here */ case 240000008 : /* For Worklog */ L_stvalStruct[L_iCtri].dataType=AR_DATA_TYPE_DIARY; L_stvalStruct[L_iCtri].u.diaryVal=(char*)malloc(4000*sizeof(char)); strcpy(L_stvalStruct[L_iCtri].u.diaryVal,L_idValLst[L_iCtri].Value); break; } /* SWITCH Ends Here */ } /* LOOP Ends Here */ /* L_stfieldvalstruct[i].fieldId=9; For Status */ /* L_stfieldvalstruct[i+1].fieldId=240000010; For Closure code */ /* L_stvalStruct[i].dataType=AR_DATA_TYPE_ENUM; L_stvalStruct[i+1].dataType=AR_DATA_TYPE_ENUM; L_stvalStruct[i].u.enumVal=L_CallStatus; L_stvalStruct[i+1].u.enumVal=L_CallClosure_Code; */ /*for (L_iCtri = 0 ;L_iCtri<i+2;L_iCtri++) */ for (L_iCtri = 0 ;L_iCtri<i;L_iCtri++) { L_stfieldvalstruct[L_iCtri].value=L_stvalStruct[L_iCtri]; } L_fldList.fieldValueList=L_stfieldvalstruct; /* ARCreateEntry API is called here ,it will create an Entry in Remedy & will */ L_iResult=ARSetEntry(&G_CtrlStruct, /* Control Structure */ L_stSchema, /* Schema Name */ &IdLst, /* AREntryIdList */ &L_fldList, /* ARFieldValueList Strcuture */ 0, /* Timestamping */ 0, &status); /* Status of this Function Call */ /*fprintf(logfile,"[%s]: TicketID\n",IdLst.entryIdList);*/ free(L_fldList.fieldValueList); free(L_stvalStruct); //IdLst.entryIdList=ticketId; if(L_iResult!=0) { fprintf(logfile,"ERROR [%d]: calling ARSetEntry()...\n",L_iResult); fprintf(logfile,"ERROR MESSAGE : %s Appended Text: %s\n",(status.statusList)->messageText, (status.statusList)->appendedText); fflush(logfile); } /* For Terminating the application and Capture the Error Message */ if( ARTermination(&G_CtrlStruct,&status) != 0 ) { fprintf(logfile,"ERROR [%d]: calling ARTermination()...\n",L_iResult); fprintf(logfile,"ERROR MESSAGE : %s\n",(status.statusList)->messageText); fflush(logfile); } if( L_iResult != 0 ) return -1; else return 1; } /* RifCreateTicket */