How do I get the internal id of a project task using web services .net?

I would like to get the internal id of a project task based on the project id and task id.

Rookie Asked on March 5, 2020 in SuiteTalk.
Add Comment
1 Answer(s)

Here is my solution. In case anyone else is looking for the same.  MyResult is a class to hold the results.

 

private ProjectTaskResult getInternalIDs(string projectNum, int taskNum)
{
if(taskNum > 0)
{
taskNum–;
}else
{
taskNum = 0;
}
TokenLogin login = new TokenLogin();
NetSuiteService service2 = new NetSuiteService();
service2 = login.getService();
Utilities util = new Utilities();
JobSearch job = new JobSearch();
job.basic = new JobSearchBasic();
job.basic.externalIdString = new SearchStringField();
job.basic.externalIdString.@operator = SearchStringFieldOperator.@is;
job.basic.externalIdString.operatorSpecified = true;
job.basic.externalIdString.searchValue = projectNum;
JobSearchAdvanced jobSearch = new JobSearchAdvanced();
jobSearch.savedSearchId = “1868”;
jobSearch.criteria = job;

SearchResult result = service2.search(jobSearch);
ProjectTaskResult myResult = new ProjectTaskResult();
if (result.searchRowList.Count() > 0)
{
myResult._projectInternalID = ((NetSuiteFilePrepImports.com.netsuite.webservices.JobSearchRow)result.searchRowList[0]).basic.internalId[0].searchValue.internalId;
myResult._taskInternalID = ((NetSuiteFilePrepImports.com.netsuite.webservices.JobSearchRow)result.searchRowList[taskNum]).projectTaskJoin.internalId[0].searchValue.internalId;
}else
{
myResult._projectInternalID = “0”;
myResult._taskInternalID = “0”;
}

return myResult;
}

Rookie Answered on March 10, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor