Unable to update rating (rating column) on host document using JavaScript Object Model API inside sharepoint hosted apps
Hi Everyone,
We are developing SharePoint hosted apps for Office 365, for that we are going
to implement document rating functionality inside Sharepoint app. The host web contain document library (“Documents”) and from apps we need to rate each document. The rating functionality working fine with CQWP in team site using
JavaScript Object Model API.
But the same code is not working inside apps and giving error:-
If we are using app context than error will be:-
"List does not exist.
The page you selected contains a list that does not exist. It may have been deleted by another user."
And for Host context than error will be:-
"Unexpected response data from server."
Please help on this
Please see below code..
'use strict';
var web, list, listItems, hostUrl, videoId, output = "";
var videoLibrary = "Documents";
var context, currentContext;
var lists, listID;
var list, parentContext;
var scriptbase;
(function () {
// This code runs when the DOM is ready and creates a context object which is
// needed to use the SharePoint object model
$(document).ready(function () {
hostUrl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
context = SP.ClientContext.get_current();
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);
function sharePointReady() {
scriptbase = hostUrl + "/_layouts/15/";
// Load the js files and continue to the successHandler
$.getScript(scriptbase + "SP.Runtime.js", function () {
$.getScript(scriptbase + "SP.js", function () {
$.getScript(scriptbase + "SP.Core.js", function () {
$.getScript(scriptbase + "reputation.js", function () {
$.getScript(scriptbase + "sp.requestexecutor.js", execCrossDomainRequest);
//Query list from hostweb
function execCrossDomainRequest() {
//Load the list from hostweb
parentContext = new SP.AppContextSite(context, hostUrl);
web = parentContext.get_web();
list = web.get_lists().getByTitle(videoLibrary);
context.load(list, 'Title', 'Id');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name="Modified" Ascending="FALSE"/></OrderBy></Query><RowLimit>1</RowLimit></View>');
listItems = list.getItems(camlQuery);
context.load(listItems);
context.executeQueryAsync(onQuerySucceeded, onQueryFailed);
//Process the image library
function onQuerySucceeded() {
var lstID = list.get_id();
var ctx = new SP.ClientContext(hostUrl);
var ratingValue = 4;
EnsureScriptFunc('reputation.js', 'Microsoft.Office.Server.ReputationModel.Reputation', function() {
Microsoft.Office.Server.ReputationModel.Reputation.setRating(ctx, lstID, 1, ratingValue);
ctx.executeQueryAsync(RatingSuccess, RatingFailure);
function onQueryFailed(sender, args) {
alert('Failed' + args.get_message());
function failed(sender, args) {
alert("failed because:" + args.get_message());
function RatingSuccess() {
alert('rating set');
//displaystar();
function RatingFailure(sender, args) {
alert('Rating failed : : ' + args.get_message());
//Gets the query string paramter
function getQueryStringParameter(paramToRetrieve) {
var params;
params = document.URL.split("?")[1].split("&");
for (var i = 0; i < params.length; i = i + 1) {
var singleParam = params[i].split("=");
if (singleParam[0] == paramToRetrieve) return singleParam[1];
Thanks & Regards
Sanjay
Thank you in advance! :-)
Hi,
According to your post, my understanding is that you want to update list column in SharePoint hosted apps using JavaScript Client Object Model.
Based on the error message, it seems not retrieve the list object in context. I suggest you debug the code step by step using Internet Explorer Developer Tools to
find the problem.
Here are some demos about using JavaScript Client Object Model in SharePoint hosted app:
http://blogs.msdn.com/b/officeapps/archive/2012/09/04/using-the-javascript-object-model-jsom-in-apps-for-sharepoint.aspx
http://sharepoint.stackexchange.com/questions/55334/how-to-access-list-in-sharepoint-hosted-app
http://www.dotnetcurry.com/showarticle.aspx?ID=1028
Best regards
Zhengyu Guo
TechNet Community Support
Similar Messages
-
The below mentioned code works sometimes and doesn't most of the time. What is the real best way to update multi select managed metadata fields?
Microsoft.SharePoint.Client.File file = site.GetFileByServerRelativeUrl("/sites/myspsite/Documents/Presentation2.pptx");
clientContext.Load(file);
clientContext.ExecuteQuery();
ListItem currentItem = file.ListItemAllFields;
clientContext.Load(currentItem);
clientContext.ExecuteQuery();
currentItem["Country"] = "-1;#India|1d13cfe9-d6f4-4bd3-a6c7-4b46a81f2a96;#-1;#China|9c1dff73-82db-44b1-8d70-f4258dd24e47;#-1;#USA|b9295c0b-67d4-4dc5-99d4-e88af888de48";
currentItem["Title"] = "Demo Doc";
currentItem.Update();
clientContext.ExecuteQuery();
file.CheckIn("test check-in", CheckinType.MajorCheckIn);
clientContext.ExecuteQuery();
Anuradha!!Hi,
Here are two blog for your reference:
How to Work with Managed Metadata Columns by Using the SharePoint Client Object Model
http://blogs.msdn.com/b/sharepointdev/archive/2011/11/18/how-to-work-with-managed-metadata-columns-by-using-the-sharepoint-client-object-model-kaushalendra-kumar.aspx
SharePoint 2010 Code Tips – Setting a Managed Metadata Field with the Client Object Model
http://sharepointfieldnotes.blogspot.com/2011/08/sharepoint-2010-code-tips-setting.html
Best Regards
Dennis Guo
TechNet Community Support -
dears, i have purchased a new macbook pro with lion os, then after a while for a notification to update the iPhoto app, and when i tried to update it said that unable to update, then i uninstalled it, then i tried to install it but it said these apps connot be installed on this computer!!!!!
what should i do
this problem started to annoy me, as am not able to edit any photo.
pls help ASAPThanks a lot i followed the instructions for safe mode (i found out that i was pressing the C button after restarting) i did whats written there but the repair couldn't be performed so in addition i needed to re-formate the HD so i erased the volume and then repaired the disk--> quite disk utilities --> start the installation from the installation DVD.
Thanks really appreciating your help -
Setting the default value to taxonomy column in sharepoint 2010 using client object model
I am creating a metadata column and I want to set its default value in sharepoint 2010 using client object model. Can anyone help me?
My code for creating metadata column is as below:
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
List list = site.Lists.GetByTitle("LibraryName");
FieldCollection collField = list.Fields;
string fieldSchema = "<Field Type='TaxonomyFieldType' DisplayName='SoftwareColumn' Name='SoftwareColumn' />";
collField.AddFieldAsXml(fieldSchema, true, AddFieldOptions.DefaultValue);
//oneField.DefaultValue = "ASP.NET|4c984b91-b308-4884-b1f1-aee5d7ed58b2"; // wssId[0].ToString() + ";#" + term.Name + "|" + term.Id.ToString().ToLower();
clientContext.Load(collField);
clientContext.ExecuteQuery();Hi,
Please try the code like this:
ClientContext clientContext = new ClientContext("http://yoursite/");
List list = clientContext.Web.Lists.GetByTitle("List1_mmsfield");
clientContext.Load(list);
clientContext.ExecuteQuery();
FieldCollection fields = list.Fields;
clientContext.Load(fields);
clientContext.ExecuteQuery();
Field f = fields.GetByTitle("mms");
clientContext.Load(f);
clientContext.ExecuteQuery();
Console.WriteLine(f.Title + "---" + f.DefaultValue);
//2;#A2|a0a95267-b758-4e4d-8c39-067069fd2eef
//1;#A1|641f5726-992c-41c8-9ddc-204a60b88584
f.DefaultValue = "1;#A1|641f5726-992c-41c8-9ddc-204a60b88584";
f.Update();
clientContext.Load(f);
clientContext.ExecuteQuery();
Console.WriteLine(f.Title + "---" + f.DefaultValue);
Best regards
Patrick Liang
TechNet Community Support -
I want to change 'Modified By' column value of a file that is being uploaded using Client Object Model in SharePoint 2013. The problem is that the version of the file is changing. Kindly help me. The code that I am using is:
using (System.IO.Stream fileStream = System.IO.File.OpenRead(m_strFilePath))
Microsoft.SharePoint.Client.File.SaveBinaryDirect(m_clientContext, str_URLOfFile, fileStream, true);
Microsoft.SharePoint.Client.File fileUploaded = m_List.RootFolder.Files.GetByUrl(str_URLOfFile);
m_clientContext.Load(fileUploaded);
m_clientContext.ExecuteQuery();
User user1 = m_Web.EnsureUser("User1");
User user2 = m_Web.EnsureUser("User2");
ListItem item = fileUploaded.ListItemAllFields;
fileUploaded.CheckOut();
item["UserDefinedColumn"] = "UserDefinedValue1";
item["Title"] = "UserDefinedValue2";
item["Editor"] = user1;
item["Author"] = user2;
item.Update();
fileUploaded.CheckIn(string.Empty, CheckinType.OverwriteCheckIn);
m_clientContext.ExecuteQuery();Hi talib2608,
Chris is correct for this issue, when calling update using ListItem.update method, it will increase item versions, using SystemUpdate and UpdateOverwriteVersion will update the list item overwrite version.
these two methods are not available in CSOM/REST, only server object model is available for this.
Thanks,
Qiao Wei
TechNet Community Support -
How to get text from column labels in pivot using javascript?
Hi, is it possible to get text from column labels in pivot using javascript? How?
You don't get a response from a URLRequest, you get the response from a URLLoader:
View this sample page for URLRequest and URLLoader and I think it'll make more sense to you.
http://help.adobe.com/en_US/air/reference/html/flash/net/URLRequest.html#URLRequest() -
Getting errors while updating links in Indesign document using javascript
Hi,
We are updating the links in InDesign document using javascript. After running the script, we are getting the below errors in Adobe InDesign CC debug.
When closing the document for first time we are getting the below mentioned errors,
ASSERT 'fRefCount == 0' in c:\development\citius\source\components\database3\revisioneddatabase\SaLRICache.tpp at line 230 failed.
Erased item list not empty at block delete time
blockUID = 10486786 not freed
Internal error: 904 items were leaked!
After that we are opening the same document for second time, then we are getting the below mentioned errors,
ASSERT 'ts_DBPubFile->PlacementUIDIsAvailable(uid)' in c:\development\citius\source\components\database3\revisioneddatabase\SaLRIUtils.tpp at line 195 failed.
DB failed to create UID!
ASSERT 'this->FindInIDRangeList(fLastCreatedBlockUID) >= 0' in c:\development\citius\source\components\database3\revisioneddatabase\SaLRICache.tpp at line 476 failed.
ASSERT 'fLastCreatedBlockUID != kInvalidUID && fLastCreatedItemID != 0' in c:\development\citius\source\components\database3\revisioneddatabase\SaLRICache.tpp at line 467 failed.
ASSERT '(SaLRIUtils<SnapshotID , SnapshotInfo>::ts_DB)->IsValidUID(itemUID)' in ..\..\..\source\components\database3\revisioneddatabase\SnapshotCache.cpp at line 55 failed.
Please help us to solve this error in InDesign debug.
Thanks,
Vimala LYou're probably better off raising this in the SDK forum.
-
Unable to update the VAT_CODE column through supplier sites API
Hi,
I'm unable to update the vat code column of the ap_supplier_sites_all table using the ap_vendor_pub_pkg.update_vendor_site API.Oracle application instance 12.1.3 and OS linux.Please find the code below.I'm able to update other feilds,but not the vat_code.Please help on this.
Thanks,
Abhilash
CREATE OR REPLACE PACKAGE BODY APPS.xx_wo172304_test
AS
PROCEDURE xx_vat_wo172304 (
errbuf OUT VARCHAR2
, retcode OUT VARCHAR2
IS
CURSOR cur_vat
IS
SELECT site.*
FROM apps.ap_suppliers supp, apps.ap_supplier_sites_all site
WHERE site.vat_code IN
('CZ OEUS 20', 'CZ OEUZ 20', 'CZ OJCD 20', 'CZ OT20', 'CZ-20-EDC', 'OEUS20', 'OEUZ20', 'OPP20E'
, 'OS20', 'OT20')
AND supp.vendor_id = site.vendor_id
AND site.org_id IN (608, 1508, 2396, 2397)
AND site.vendor_site_id =68154;
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
l_vat_code ap_supplier_sites_all.VAT_CODE%TYPE;
l_vendor_site_id ap_supplier_sites_all.vendor_site_id%TYPE;
x_return_status VARCHAR2 (100) := NULL;
x_msg_data VARCHAR2 (1000) := NULL;
x_msg_count NUMBER := NULL;
l_error_reason VARCHAR2 (2000) := NULL;
l_user_id number := FND_GLOBAL.USER_ID;
l_last_update_login number := FND_GLOBAL.LOGIN_ID;
l_program_application_id number := FND_GLOBAL.prog_appl_id;
l_program_id number := FND_GLOBAL.conc_program_id;
l_request_id number := FND_GLOBAL.conc_request_id;
BEGIN
-- mo_global.init ('SQLAP');
FOR rec_vat IN cur_vat LOOP
IF rec_vat.org_id = 608 THEN
IF rec_vat.vat_code = 'OEUS20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUS21';
ELSIF rec_vat.vat_code = 'OEUZ20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUZ21';
ELSIF rec_vat.vat_code = 'OPP20E' THEN
l_vendor_site_rec.vat_code := 'CZ OPP21E';
ELSIF rec_vat.vat_code = 'OS20' THEN
l_vendor_site_rec.vat_code := 'CZ OS21';
ELSIF rec_vat.vat_code = 'OT20' THEN
l_vendor_site_rec.vat_code := 'CZ OS21';
END IF;
ELSIF rec_vat.org_id = 1508 THEN
IF rec_vat.vat_code = 'CZ OJCD 20' THEN
l_vendor_site_rec.vat_code := 'CZ OJCD21';
ELSIF rec_vat.vat_code = 'CZ OEUS 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUS21';
ELSIF rec_vat.vat_code = 'CZ OEUZ 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUZ21';
ELSIF rec_vat.vat_code = 'CZ OT20' THEN
l_vendor_site_rec.vat_code := 'CZ OT21';
END IF;
ELSIF rec_vat.org_id = 2396 THEN
IF rec_vat.vat_code = 'CZ OEUZ 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUZ 21';
ELSIF rec_vat.vat_code = 'CZ OJCD 20' THEN
l_vendor_site_rec.vat_code := 'CZ OJCD 21';
ELSIF rec_vat.vat_code = 'CZ OT20' THEN
l_vendor_site_rec.vat_code := 'CZ OT21';
ELSIF rec_vat.vat_code = 'CZ-20-EDC' THEN
l_vendor_site_rec.vat_code := 'CZ-21-EDC';
END IF;
ELSIF rec_vat.org_id = 2397 THEN
IF rec_vat.vat_code = 'CZ OEUS 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUS 21';
ELSIF rec_vat.vat_code = 'CZ OEUZ 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUZ 21';
ELSIF rec_vat.vat_code = 'CZ OJCD 20' THEN
l_vendor_site_rec.vat_code := 'CZ OJCD 21';
ELSIF rec_vat.vat_code = 'CZ OT20' THEN
l_vendor_site_rec.vat_code := 'CZ OT21';
ELSIF rec_vat.vat_code = 'CZ-20-EDC' THEN
l_vendor_site_rec.vat_code := 'CZ-21-EDC';
END IF;
END IF;
l_vendor_site_id := rec_vat.vendor_site_id;
l_vendor_site_rec.org_id := rec_vat.org_id;
l_vendor_site_rec.vendor_id := rec_vat.vendor_id;
--l_vendor_site_rec.vendor_site_code:='318581-MOR. KRU';
l_vendor_site_rec.rfq_only_site_flag := 'Y';
-- l_vendor_site_rec.last_update_date := SYSDATE;
l_vendor_site_rec.last_updated_by := 1134; MARTIN.ROUNDS
-- DBMS_OUTPUT.put_line ('VAT CODE:' || l_vendor_site_rec.vat_code);
--DBMS_OUTPUT.put_line ('Vendor Site Id:' || l_vendor_site_id);
fnd_file.put_line (fnd_file.LOG
, 'VAT CODE:' || l_vendor_site_rec.vat_code
fnd_file.put_line (fnd_file.LOG
, 'Vendor ID:' || rec_vat.vendor_id
fnd_file.put_line (fnd_file.LOG
, 'Vendor Site Id:' || l_vendor_site_id
fnd_file.put_line (fnd_file.LOG
, 'RFQ ONLY SITE FLAG:' || l_vendor_site_rec.rfq_only_site_flag
ap_vendor_pub_pkg.update_vendor_site (p_api_version => 1
, x_return_status => x_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
, p_vendor_site_rec => l_vendor_site_rec
, p_vendor_site_id => l_vendor_site_id
); --p_calling_prog IN VARCHAR2 DEFAULT 'NOT ISETUP'
-- pos_vendor_pub_pkg.update_vendor_site (p_vendor_site_rec => l_vendor_site_rec
-- , x_return_status => x_return_status
-- , x_msg_count => x_msg_count
-- , x_msg_data => x_msg_data
-- ap_vendor_sites_pkg.update_row(
-- p_vendor_site_rec => l_vendor_site_rec,
-- p_last_update_date => sysdate,
-- p_last_updated_by => l_user_id,
-- p_last_update_login => l_last_update_login,
-- p_request_id => l_request_id ,
-- p_program_application_id => l_program_application_id,
-- p_program_id => l_program_id,
-- p_program_update_date => sysdate,
-- p_vendor_site_id => l_vendor_site_id);
fnd_file.put_line (fnd_file.LOG
, 'Return Status:' || x_return_status
IF x_return_status <> fnd_api.g_ret_sts_success THEN
IF x_msg_count >= 1 THEN
FOR i IN 1 .. x_msg_count LOOP
IF l_error_reason IS NULL THEN
l_error_reason :=
l_error_reason
|| ','
|| SUBSTR (fnd_msg_pub.get (p_encoded => fnd_api.g_false)
, 1
, 255
|| SQLERRM;
ELSE
l_error_reason :=
l_error_reason
|| ','
|| SUBSTR (fnd_msg_pub.get (p_encoded => fnd_api.g_false)
, 1
, 255
|| SQLERRM;
END IF;
--DBMS_OUTPUT.put_line ('Supplier Site API Error-' || l_error_reason);
fnd_file.put_line (fnd_file.LOG
, 'Supplier Site API Error-' || l_error_reason
END LOOP;
END IF;
ELSIF x_return_status='S' THEN
--DBMS_OUTPUT.put_line ('Supplier Site API Success-' || l_error_reason);
fnd_file.put_line (fnd_file.LOG
, 'Supplier Site API Success-' || l_error_reason
END IF;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
--DBMS_OUTPUT.put_line ('Error-' || SQLERRM);
fnd_file.put_line (fnd_file.LOG
, 'Error-' || SQLERRM
END xx_vat_wo172304;
END xx_wo172304_test;Hi,
I'm unable to update the vat code column of the ap_supplier_sites_all table using the ap_vendor_pub_pkg.update_vendor_site API.Oracle application instance 12.1.3 and OS linux.Please find the code below.I'm able to update other feilds,but not the vat_code.Please help on this.
Thanks,
Abhilash
CREATE OR REPLACE PACKAGE BODY APPS.xx_wo172304_test
AS
PROCEDURE xx_vat_wo172304 (
errbuf OUT VARCHAR2
, retcode OUT VARCHAR2
IS
CURSOR cur_vat
IS
SELECT site.*
FROM apps.ap_suppliers supp, apps.ap_supplier_sites_all site
WHERE site.vat_code IN
('CZ OEUS 20', 'CZ OEUZ 20', 'CZ OJCD 20', 'CZ OT20', 'CZ-20-EDC', 'OEUS20', 'OEUZ20', 'OPP20E'
, 'OS20', 'OT20')
AND supp.vendor_id = site.vendor_id
AND site.org_id IN (608, 1508, 2396, 2397)
AND site.vendor_site_id =68154;
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
l_vat_code ap_supplier_sites_all.VAT_CODE%TYPE;
l_vendor_site_id ap_supplier_sites_all.vendor_site_id%TYPE;
x_return_status VARCHAR2 (100) := NULL;
x_msg_data VARCHAR2 (1000) := NULL;
x_msg_count NUMBER := NULL;
l_error_reason VARCHAR2 (2000) := NULL;
l_user_id number := FND_GLOBAL.USER_ID;
l_last_update_login number := FND_GLOBAL.LOGIN_ID;
l_program_application_id number := FND_GLOBAL.prog_appl_id;
l_program_id number := FND_GLOBAL.conc_program_id;
l_request_id number := FND_GLOBAL.conc_request_id;
BEGIN
-- mo_global.init ('SQLAP');
FOR rec_vat IN cur_vat LOOP
IF rec_vat.org_id = 608 THEN
IF rec_vat.vat_code = 'OEUS20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUS21';
ELSIF rec_vat.vat_code = 'OEUZ20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUZ21';
ELSIF rec_vat.vat_code = 'OPP20E' THEN
l_vendor_site_rec.vat_code := 'CZ OPP21E';
ELSIF rec_vat.vat_code = 'OS20' THEN
l_vendor_site_rec.vat_code := 'CZ OS21';
ELSIF rec_vat.vat_code = 'OT20' THEN
l_vendor_site_rec.vat_code := 'CZ OS21';
END IF;
ELSIF rec_vat.org_id = 1508 THEN
IF rec_vat.vat_code = 'CZ OJCD 20' THEN
l_vendor_site_rec.vat_code := 'CZ OJCD21';
ELSIF rec_vat.vat_code = 'CZ OEUS 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUS21';
ELSIF rec_vat.vat_code = 'CZ OEUZ 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUZ21';
ELSIF rec_vat.vat_code = 'CZ OT20' THEN
l_vendor_site_rec.vat_code := 'CZ OT21';
END IF;
ELSIF rec_vat.org_id = 2396 THEN
IF rec_vat.vat_code = 'CZ OEUZ 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUZ 21';
ELSIF rec_vat.vat_code = 'CZ OJCD 20' THEN
l_vendor_site_rec.vat_code := 'CZ OJCD 21';
ELSIF rec_vat.vat_code = 'CZ OT20' THEN
l_vendor_site_rec.vat_code := 'CZ OT21';
ELSIF rec_vat.vat_code = 'CZ-20-EDC' THEN
l_vendor_site_rec.vat_code := 'CZ-21-EDC';
END IF;
ELSIF rec_vat.org_id = 2397 THEN
IF rec_vat.vat_code = 'CZ OEUS 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUS 21';
ELSIF rec_vat.vat_code = 'CZ OEUZ 20' THEN
l_vendor_site_rec.vat_code := 'CZ OEUZ 21';
ELSIF rec_vat.vat_code = 'CZ OJCD 20' THEN
l_vendor_site_rec.vat_code := 'CZ OJCD 21';
ELSIF rec_vat.vat_code = 'CZ OT20' THEN
l_vendor_site_rec.vat_code := 'CZ OT21';
ELSIF rec_vat.vat_code = 'CZ-20-EDC' THEN
l_vendor_site_rec.vat_code := 'CZ-21-EDC';
END IF;
END IF;
l_vendor_site_id := rec_vat.vendor_site_id;
l_vendor_site_rec.org_id := rec_vat.org_id;
l_vendor_site_rec.vendor_id := rec_vat.vendor_id;
--l_vendor_site_rec.vendor_site_code:='318581-MOR. KRU';
l_vendor_site_rec.rfq_only_site_flag := 'Y';
-- l_vendor_site_rec.last_update_date := SYSDATE;
l_vendor_site_rec.last_updated_by := 1134; MARTIN.ROUNDS
-- DBMS_OUTPUT.put_line ('VAT CODE:' || l_vendor_site_rec.vat_code);
--DBMS_OUTPUT.put_line ('Vendor Site Id:' || l_vendor_site_id);
fnd_file.put_line (fnd_file.LOG
, 'VAT CODE:' || l_vendor_site_rec.vat_code
fnd_file.put_line (fnd_file.LOG
, 'Vendor ID:' || rec_vat.vendor_id
fnd_file.put_line (fnd_file.LOG
, 'Vendor Site Id:' || l_vendor_site_id
fnd_file.put_line (fnd_file.LOG
, 'RFQ ONLY SITE FLAG:' || l_vendor_site_rec.rfq_only_site_flag
ap_vendor_pub_pkg.update_vendor_site (p_api_version => 1
, x_return_status => x_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
, p_vendor_site_rec => l_vendor_site_rec
, p_vendor_site_id => l_vendor_site_id
); --p_calling_prog IN VARCHAR2 DEFAULT 'NOT ISETUP'
-- pos_vendor_pub_pkg.update_vendor_site (p_vendor_site_rec => l_vendor_site_rec
-- , x_return_status => x_return_status
-- , x_msg_count => x_msg_count
-- , x_msg_data => x_msg_data
-- ap_vendor_sites_pkg.update_row(
-- p_vendor_site_rec => l_vendor_site_rec,
-- p_last_update_date => sysdate,
-- p_last_updated_by => l_user_id,
-- p_last_update_login => l_last_update_login,
-- p_request_id => l_request_id ,
-- p_program_application_id => l_program_application_id,
-- p_program_id => l_program_id,
-- p_program_update_date => sysdate,
-- p_vendor_site_id => l_vendor_site_id);
fnd_file.put_line (fnd_file.LOG
, 'Return Status:' || x_return_status
IF x_return_status <> fnd_api.g_ret_sts_success THEN
IF x_msg_count >= 1 THEN
FOR i IN 1 .. x_msg_count LOOP
IF l_error_reason IS NULL THEN
l_error_reason :=
l_error_reason
|| ','
|| SUBSTR (fnd_msg_pub.get (p_encoded => fnd_api.g_false)
, 1
, 255
|| SQLERRM;
ELSE
l_error_reason :=
l_error_reason
|| ','
|| SUBSTR (fnd_msg_pub.get (p_encoded => fnd_api.g_false)
, 1
, 255
|| SQLERRM;
END IF;
--DBMS_OUTPUT.put_line ('Supplier Site API Error-' || l_error_reason);
fnd_file.put_line (fnd_file.LOG
, 'Supplier Site API Error-' || l_error_reason
END LOOP;
END IF;
ELSIF x_return_status='S' THEN
--DBMS_OUTPUT.put_line ('Supplier Site API Success-' || l_error_reason);
fnd_file.put_line (fnd_file.LOG
, 'Supplier Site API Success-' || l_error_reason
END IF;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
--DBMS_OUTPUT.put_line ('Error-' || SQLERRM);
fnd_file.put_line (fnd_file.LOG
, 'Error-' || SQLERRM
END xx_vat_wo172304;
END xx_wo172304_test; -
i am unable to update my apps i get this message...
There was an error in the App Store. Please try again later. (18)...
this has been happeing for weekshttp://www.apple.com/support/mac/app-store/contact.html?form=account
-
I am unable to update my album art on my iMac since I started using Match (and after upgrading to Yosemite 10.10.3). A message advises that it's not possible to removed old artwork if it's embedded. How can I 'unembed' old cover art and replace?
Normally artwork recovered with iTunes is stored as a separate artwork file and iTunes refers to that file to display artwork when you click on a track. However, if you then copy the file to another player the artwork file is left behind and the track will not display the artwork on the other player. To get around this it is possible to embed the artwork in the music file itself so it always travels with the file. Artwork can be embedded by you or files from third party sources may arrive with embedded artwork. iTunes apparently now won't replace artwork for such files. You can accomplish this by completely deleting artwork for a file or set of files in Get Info, then getting iTunes to fetch artwork which will then be set as a reference file rather than being embedded.
I use an old iTunes so unless you are using an ancient iTunes it won't help for me to give you great details. To erase artwork I simply get info on a series of files and check the box next to the artwork box without adding any artwork and close. To do it for single file I Get Info, go to the artwork display tab and click delete. Here's a Windows reference for a newer iTunes (but the "old Get Info" reference is for early iTunes 12 and no longer works with newer):I cannot delete embedded album artwork in iTunes 12 -
Unable to Update PO Customerdata tab at Item level using BAPI_PO_CHANGE
Dear Experts,
I am unable to Update PO customer tab data at item level using BAPI :BAPI_PO_CHANGE.
I am passing the data structure through EXTENSIONOUT is refered with BAPIPAREX structure.
Can any one help on this.
Best regards,
Venkata Siva.Hi Venkat,
Check this note 1033925.[Using Extension|Update EKKO table for the custom field through BAPI;
Regards,
Madhu. -
Assigning External content type field column value using Client Object Model
I have a problem assinging External column value to ListItem object with client object model-based application I'm developing. To be precise, I am able to retrieve data related to external content type by reading external list created from this content type
but I don't know how to properly use it to assign value to this field. By doing some research on my own I concluded that BDC ID column from external list is the way to go since it uniquely defines selected row from external list but that doesn't
tell me much since I don't know what to do with it. Currently I ended up with partial solution - to assign plain string value of picker column but that makes this value visible only in "View Properties" option on Sharepoint and not in "Edit Properties"
which pritty much makes sence since it isn't properly related to rest of the data in specific row. Does someone have a better solution for this?
Igor S.I think I understand your problem.
In my example I have an external data column "Beneficiary Name", using a Beneficiary external content type (accessing a table of beneficiaries in a SQL table).
I want to set the "Beneficiary Name" property using the client object model. I know the name of the beneficiary but not the ID value.
It is a fairly simple solution. You just need to identify the name of the property SharePoint assigns to the ID field, in my case it is called "Beneficiary_ID". Then set the two properties as follows:
thisItem["Beneficiary_Name"] = "Charitable Trust";
thisItem["Beneficiary_ID"] = -1;
thisItem.Update();
Setting the ID property to -1 causes the server to do an automatic lookup for the ID from the value assigned to the item. -
How to update list item using client object model without changing created/modified dates?
Hello All,
I want to update list item using the SharePoint Client Object
Model without updating the created / modified date. Is it possible?
Please help.
Thanks.Using the SystemUpdate method should do the trick, according
to its literature.
Additionally, would something like this be of any use for you? Taken from this
Stack Exchange thread: -
public static class SPListItemExtensions
/// <summary>
/// Provides ability to update list item without firing event receiver.
/// </summary>
/// <param name="item"></param>
/// <param name="doNotFireEvents">Disables firing event receiver while updating item.</param>
public static void Update(this SPListItem item, bool doNotFireEvents)
SPItemEventReceiverHandling rh = new SPItemEventReceiverHandling();
if (doNotFireEvents)
try
rh.DisableEventFiring();
item.Update();
finally
rh.EnableEventFiring();
else
item.Update();
/// <summary>
/// Provides ability to update list item without firing event receiver.
/// </summary>
/// <param name="item"></param>
/// <param name="incrementListItemVersion"></param>
/// <param name="doNotFireEvents">Disables firing event receiver while updating item.</param>
public static void SystemUpdate(this SPListItem item, bool incrementListItemVersion, bool doNotFireEvents)
SPItemEventReceiverHandling rh = new SPItemEventReceiverHandling();
if (doNotFireEvents)
try
rh.DisableEventFiring();
item.SystemUpdate(incrementListItemVersion);
finally
rh.EnableEventFiring();
else
item.SystemUpdate(incrementListItemVersion);
/// <summary>
/// Provides ability to update list item without firing event receiver.
/// </summary>
/// <param name="item"></param>
/// <param name="doNotFireEvents">Disables firing event receiver while updating item.</param>
public static void SystemUpdate(this SPListItem item, bool doNotFireEvents)
SPItemEventReceiverHandling rh = new SPItemEventReceiverHandling();
if (doNotFireEvents)
try
rh.DisableEventFiring();
item.SystemUpdate();
finally
rh.EnableEventFiring();
else
item.SystemUpdate();
private class SPItemEventReceiverHandling : SPItemEventReceiver
public SPItemEventReceiverHandling() { }
new public void DisableEventFiring()
base.DisableEventFiring();
new public void EnableEventFiring()
base.EnableEventFiring();
Steven Andrews
SharePoint Business Analyst: LiveNation Entertainment
Blog: baron72.wordpress.com
Twitter: Follow @backpackerd00d
My Wiki Articles:
CodePlex Corner Series
Please remember to mark your question as "answered" if this solves (or helps) your problem. -
'duplicate column name'-Exception when using identical objects
Hi all,
we're currently experiencing problems when using one single object instance for two different members of a mapped class. Here is an excerpt from our ToplinkMapping.java which shows the relevant parts:
public ClassDescriptor buildQuotationDefDescriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
descriptor.descriptorIsAggregate();
descriptor.setJavaClass(de.hvb.ha.data.QuotationDef.class);
// Descriptor Properties.
descriptor.setAlias("QuotationDef");
AggregateObjectMapping commonQtyMapping = new AggregateObjectMapping();
commonQtyMapping.setAttributeName("commonQty");
commonQtyMapping.setReferenceClass(de.hvb.ha.data.type.VolumeDT.class);
commonQtyMapping.setIsNullAllowed(false);
commonQtyMapping.addFieldNameTranslation("commonQty_value->DIRECT", "value->DIRECT");
descriptor.addMapping(commonQtyMapping);
AggregateObjectMapping wideningQtyMapping = new AggregateObjectMapping();
wideningQtyMapping.setAttributeName("wideningQty");
wideningQtyMapping.setReferenceClass(de.hvb.ha.data.type.VolumeDT.class);
wideningQtyMapping.setIsNullAllowed(false);
wideningQtyMapping.addFieldNameTranslation("wideningQty_value->DIRECT", "value->DIRECT");
descriptor.addMapping(wideningQtyMapping);
well, if we now assign one object-instance of VolumeDT to both members, i.e. like:
VolumeDT vol = new VolumeDT();
quotationDef.commonQty = vol;
quotationDef.wideningQty = vol;
we end up in the mentioned SQL-Exception, because toplink produces the following SQL-Statement:
UPDATE T_QUOTATIONTARGET SET WIDENING_QUANTITY = 0.0, WIDENING_QUANTITY = 0.0 WHERE …
but we've expected something like:
UPDATE T_QUOTATIONTARGET SET COMMON_QUANTITY = 0.0, WIDENING_QUANTITY = 0.0 WHERE …
Any idea we can prevent this behavior and still use one object-reference for both members??
Appreciate any help!Thanks for the reply but unfortunately the mentioned change didn't fixed the problem. The sql-statement produced by toplink still looks like the one mentioned above. Moreover, the mentioned change couldn't be managed by the Workbench (which we use in the project to create the mappings), could it?
We currently use TopLink Version 10.1.3.3.
Since you've asked I post the relevant parts of the Parent-Mapping (and again its Parent), so sorry for the verbose post:
public ClassDescriptor buildQuotationORMWrapperDescriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
descriptor.setJavaClass(de.hvb.ha.server.businessobjects.techapi.instrument.toplink.quotation.QuotationORMWrapper.class);
descriptor.addTableName("T_QUOTATION");
descriptor.addPrimaryKeyFieldName("T_QUOTATION.SEQ_KEY");
// Descriptor Properties.
descriptor.useSoftCacheWeakIdentityMap();
descriptor.setIdentityMapSize(300);
descriptor.useRemoteSoftCacheWeakIdentityMap();
descriptor.setRemoteIdentityMapSize(300);
descriptor.setSequenceNumberFieldName("T_QUOTATION.SEQ_KEY");
descriptor.setSequenceNumberName("Quotation");
descriptor.setAlias("QuotationORMWrapper");
// Query Manager.
descriptor.getQueryManager().checkCacheForDoesExist();
OneToManyMapping quotationDefsMapping = new OneToManyMapping();
quotationDefsMapping.setAttributeName("quotationDefs");
quotationDefsMapping.setReferenceClass(de.hvb.ha.server.businessobjects.techapi.instrument.toplink.quotation.QuotationDefORMWrapper.class);
quotationDefsMapping.dontUseIndirection();
quotationDefsMapping.privateOwnedRelationship();
quotationDefsMapping.useCollectionClass(java.util.ArrayList.class);
quotationDefsMapping.addAscendingOrdering("orderBy");
quotationDefsMapping.addTargetForeignKeyFieldName("T_QUOTATIONTARGET.SEQ_KEY", "T_QUOTATION.SEQ_KEY");
descriptor.addMapping(quotationDefsMapping);
and now the parent of QuotationORMWrapper:
public ClassDescriptor buildPersistentInstrumentDescriptor() {
RelationalDescriptor descriptor = new RelationalDescriptor();
descriptor.setJavaClass(de.hvb.ha.server.businessobjects.techapi.instrument.toplink.PersistentInstrument.class);
descriptor.addTableName("T_INSTRUMENT");
descriptor.addPrimaryKeyFieldName("T_INSTRUMENT.INSTR_ID");
descriptor.addPrimaryKeyFieldName("T_INSTRUMENT.INSTR_KEYTYPE");
// Descriptor Properties.
descriptor.useSoftCacheWeakIdentityMap();
descriptor.setIdentityMapSize(300);
descriptor.useRemoteSoftCacheWeakIdentityMap();
descriptor.setRemoteIdentityMapSize(300);
descriptor.setAlias("PersistentInstrument");
OneToOneMapping quotationMapping = new OneToOneMapping();
quotationMapping.setAttributeName("quotation");
quotationMapping.setReferenceClass(de.hvb.ha.server.businessobjects.techapi.instrument.toplink.quotation.QuotationORMWrapper.class);
quotationMapping.useBasicIndirection();
quotationMapping.privateOwnedRelationship();
quotationMapping.addTargetForeignKeyFieldName("T_QUOTATION.INSTR_ID", "T_INSTRUMENT.INSTR_ID");
quotationMapping.addTargetForeignKeyFieldName("T_QUOTATION.INSTR_KEYTYPE", "T_INSTRUMENT.INSTR_KEYTYPE");
descriptor.addMapping(quotationMapping)
I hope I don't missed any relevant parts. By the way, where could I log a bug for this issue and can it be considered a bug?
Thanks in advance!
Message was edited by:
user630939 -
CAML query in Workflow inside sharepoint hosted app
Hi,
I am building a sharepoint hosted app for sharepoint online.The app includes a list workflow.One of the activity in the workflow is to query another list within the app web, to get count of items where a condition is met.Can anyone please guide me how this
can be achieved?
Thanks!Hello Steve,
Thanks for the Reply
Following code helped me in creating the Subsite successfully in host web
Var hostWebUrl;
Var appWebUrl;
Var context;
Var newSubsite;
function () {
try
hostWebUrl = GetQueryString("SPHostUrl");
appWebUrl = GetQueryString ("SPAppWebUrl");
var layoutsRoot = hostWebUrl +
'/_layouts/15/';
$.getScript(layoutsRoot + "SP.Runtime.js",
function () {
$.getScript(layoutsRoot + "SP.js", CreateSubsite);});
catch(ex)
alert("message" + ex.message);
function GetQueryString (name) {
name = name.replace(/[\[]/,
"\\\[").replace(/[\]]/,
var regex =
new RegExp("[\\?&]"
+ name + "=([^&#]*)"),
results = regex.exec(location.search);
return results ==
null ?
"" : decodeURIComponent(results[1].replace(/\+/g,
// Function to create subsite
function CreateSubsite () {
context = new SP.ClientContext(appWebUrl);
var hostContext =
new SP.AppContextSite(context, hostWebUrl);
var webCreateInfo =
new SP.WebCreationInformation();
//set values
webCreateInfo.set_description("New Subsite Created");
webCreateInfo.set_language(1033);
webCreateInfo.set_title("NewSubSite");
webCreateInfo.set_url("SubsiteURL");
webCreateInfo.set_useSamePermissionsAsParentSite(true);
webCreateInfo.set_webTemplate("STS#0");
this.web = hostContext.get_web();
newSubsite = this.web.get_webs().add(webCreateInfo);
context.load(newSubsite);
context.executeQueryAsync(
Function.createDelegate(this,successHandler),Function.createDelegate(this,errorHandler));
function successHandler() {
alert("subsite created successfully");
function errorHandler(sender, args) {
alert("Could not complete cross-domain call: " + args.get_message());
Vishnu
Maybe you are looking for
-
Are itunes lps of the same quality as the analog
The question is this : an analog format weather a computer reel to reel or an anlog lp contains much more data then it's digital counterpart. how does itune LP compare to its LP version.
-
UME LDAP configuration XML file
Dear Experts- I am configuring multiple LDAP as ume for EP 7.0 EHP2 . I am following the the document below. http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8036faa9-3d95-2c10-e596-c7c97082f07e?QuickLink=index&overridelayout=true I
-
XMII Widget version 1.1 available for download...
Read all about it in my blog : <a href="/people/abesh.bhattacharjee/blog/2007/03/07/xmii-generic-widget-v11-available-now-for-download">xMII Generic Widget v1.1 available now for download...</a>
-
Custom Production for Export sales
Dear Experts I Have a scenario of custom production as follows. 1. Receive Order from the Export Customer. 2. Customer will send the input materials as free of charge. 3. Company will process the material and sell the Output material to the customer.
-
SCOM 2012 Install: Second MS blank drop down on DB name
I sucessfully configured my SCOM 2012 enviroment but when trying to add a second MS I get a blank drop down in the database name under "configure the operational database". I can connect succesfully to the sql server and instance in the install wizar