This topic contains 6 replies, has 0 voices, and was last updated by KCSF Bud 9 years, 3 months ago.
-
AuthorPosts
-
July 21, 2015 at 5:24 am #6922
KCSF BudI am quite the beginner on Suite Talk and am trying see if someone might point me in the right direction. We are trying to a) simply show a saved search on a monitor in a persistent way (doesn’t log out, its a schedule) and b) eventually be able to interact with that saved search via a bar code scanner to set a custom transaction field on work orders.
I am sure there are a variety of avenues to accomplish this and I have a basic understanding of SuiteScript/JS, but would like to accomplish this using Web Services. I am getting a crash course on XML, PHP, C#, SOAP, WSDL, etc. but that is going to take some time. I don’t yet have a firm grasp on how all those things interact. It would be tremendously helpful if someone could lay out what the basic steps might look like to create the solution we need (based on limited information that I have given, I know)? This is partially to solve a problem but also a starter project to learn how SuiteTalk works. Thanks in advance.
This is a cached copy. Click here to see the original post. -
July 21, 2015 at 7:28 am #6923
snebes1Honestly, this will all be above your head until you get the concepts down. You can use PHP and the Netsuite Toolkit for PHP to accomplish what you need (you don’t need to know XML, C#, SOAP and WSDL, they are used, but not by you directly).
You might be better off using an Excel Web Query. From the help:
To create an Excel Web Query:Start the Report Builder by clicking Customize on any report or by clicking an Edit link next to a report name on a list of saved reports.
On the Report Builder page, click More Options.
Check the Allow Web Query box.
Click Save.
Verify that you want to overwrite the previously saved version of the report.If you do not want to overwrite the previous version, click the Cancel button, rename the report and click Save As to save the report with a different name.
After the report runs, select Export-Excel Web Query in the footer.The report is saved as an .iqy file.
In the File Download window, you can click Open or Save if you are running on a PC. If you are running on a Mac, save the file.If you have saved an .iqy file on a PC, you have to double-click it to get it to run in Microsoft® Excel.
If you have saved an .iqy file on a Mac, you must first start Microsoft® Excel, then manually import the file by going to Data > Get External Data > Run Saved Query, and selecting the .iqy file.When the .iqy file opens in Microsoft® Excel, in the Enter Parameter Value window, enter the email address you use to log in to your NetSuite account (or if you did not create the Web query, the email address of the user who did), check the option if you want, and click OK.Your data is loaded into Microsoft® Excel.
You can click Refresh Data to retrieve the latest data from your NetSuite account. -
July 21, 2015 at 7:49 am #6924
fredpopeI would download the PHP toolkit and see if the sample applications don’t get you on the way of what you want.
The simplest approach would be to create a saved search and then access that saved search from the PHP toolkit.
-
July 21, 2015 at 8:07 am #6925
KCSF BudOK making some progress w/PHP toolkit. Starting to see how I would’ve been re-inventing the wheel by creating some of this from scratch. I was able to get at least one of the samples to work in a browser (get_customer), but am having trouble using the saved_search sample as a starting point. This is basically the same as the sample code save for the require once statement (which worked as shown on other tests) and the search id.
PHP Code:
savedSearchId = “83”;
$request = new SearchRequest();
$request->searchRecord = $search;$searchResponse = $service->search($request);
if (!$searchResponse->searchResult->status->isSuccess) {
echo “SEARCH ERROR”;
} else {
echo “SEARCH SUCCESS, records found: ” . $searchResponse->searchResult->totalRecords . “n”;
$records = $searchResponse->searchResult->searchRowList->searchRow;
foreach ($records as $record) {
echo “Name: ” . $record->basic->name->searchValue . “n”;
}}
?>
I just get the ‘Search Error’ message returned. Not entirely sure that ‘CustomRecordSearchAdvanced’ is what I want, the search is a list of work orders with some custom fields included. I’m sure I’ll figure it out after banging on it for a while, but let me know if you see anything.
Leo
-
July 21, 2015 at 6:07 pm #6926
KCSF BudUpdate: Looks like this calls for TransactionSearchAdvanced(). I can successfully get the total record count, going to take some more work to be able to pull the results.
PHP Code:
$records = $searchResponse->searchResult->searchRowList->searchRow;
foreach ($records as $record) {
echo “Name: ” . $record->basic->name->searchValue . “n”;Maybe someone could point me in the right direction for how this should look for TransactionSearchAdvanced? The saved search is a list of work orders, I do not care what piece of data I return back. Can be internal ID for now. Thanks.
-
July 23, 2015 at 6:06 pm #6927
KCSF BudTotally stuck here.
PHP Code:
savedSearchId = “123”;
$request = new SearchRequest();
$request->searchRecord = $search;$searchResponse = $service->search($request);
if (!$searchResponse->searchResult->status->isSuccess) {
echo “SEARCH ERROR”;
} else {
echo “SEARCH SUCCESS, records found: ” . $searchResponse->searchResult->totalRecords . “n”;
$records = $searchResponse->searchResult->searchRowList->searchRow;
//echo var_dump($records[5]->basic);
foreach ($records as $record) {
echo “Name: ” . $record->basic->name->searchValue . “n”;
}}
?>
Result:
SEARCH SUCCESS, records found: 9
With the non-object error listed 9 times (once per record).
The name field is definitely NOT a joined field and exists on the search (which is a list of Estimate/Quotes). Have tried many other fields, many different iterations.
I am starting to think I have set up the PHP toolkit/Wamp server incorrectly? i could file a case but I imagine its my mistake somewhere…
-
July 26, 2015 at 10:09 am #6928
KCSF BudJust to close this thread – I am starting to get this to work. Some of the results are being returned as arrays.
I’ve seen this posted on many threads, and really helped turn the corner to see how to get what I needed (along with schema browser):
print ‘
'; print_r($searchResponse); print '
‘;
-
AuthorPosts
You must be logged in to reply to this topic.