how can i change item state from ready to Delivering? - google-ad-manager

how can i change item state from ready to Delivering?

The status of a line item can not be amended manually, it is determined by Ad Manager. Status is updated automatically.
A 'ready' line item concerns line items that will start later or just got activated.
The 'delivering' status concerns line items that started to deliver allready.
Here are the detailed status Ad Manager handles.

Related

Oracle APEX - success message being displayed if no changes were made on the form

On my page a I have a PL/SQL process that updates the database. If the process is successful, I want to display a success message. The way I am doing this now is by setting a Success Message property of my process to a page item that contains success message - &P1_SUCCESS_MSG.
I also set Error property of my process to &P1_ERROR_MSG..
Both P1_SUCCESS_MSG and P1_ERROR_MSG gets set inside the process. Now the issue I have is when the user clicks the Save button, thus activating the process, without changing anything one the form. The success message is displayed regardless if any changes were made. I was wondering if there is an easy way to check if the form was changed and prevent the success message from being displayed if not changes were made to the database
If success message is displayed, it means that :P1_SUCCESS_MSG has value. Why? It should be empty by default and set only if procedure completes successfully and changes something.
For that purpose, I'd create a stored procedure with one (or two) OUT parameter(s); the same parameter might be used to inform user of what happened. That OUT parameter would be used to set :P1_SUCCESS_MSG item's value.
So, if something has been done, it would say e.g.
Procedure successfully completed.
Otherwise,
Nothing has been done.

Can I dynamically change the label of a Siebel button?

In our Siebel 7.8 (high interactivity) application, we have a form applet with a Pause / Resume custom button which does the following, depending on the current record's status:
If the status is "queued" or "active", it switches it to "paused".
If the status is "paused", it switches it back to whatever it was before.
If the status is another one ("completed", "error", etc), the button is disabled.
Is it possible to change the label dynamically? So that it would read Pause in the first case, and Resume in the second.
Off the top of my head the only way I can think of doing this would be with a browser script placed both in the Applet_Load and Applet_ChangeRecord events, something like:
var button = this.FindActiveXControl("Name Of My Button Control");
var status = this.BusComp().GetFieldValue("Status");
if (status == "paused") {
button.innerHTML = "Resume";
} else if ((status == "queued") || (status == "active")) {
button.innerHTML = "Pause";
} else {
// the button will be disabled via PreCanInvokeMethod, but we hide it too
button.style.visibility = "hidden";
}
Even if that worked (it should, but I haven't tried it)... I really hate browser scripts in Siebel, they always bring more trouble than solutions. Besides, I still would have to deal with changing the label when the button is clicked too... maybe checking the Applet_InvokeMethod browser event as well.
Is there any way of changing a button's label, based on the current record data, without coding1? All I have found searching online is this trick to change the applet label based on a calculated field, but nothing for buttons.
1: By without coding, I mean not coding the label change myself. It would be perfectly fine if I have to write a business service method to be invoked by Siebel somehow.
There are a few options potentially available:
We did something similar, but we are in a later Siebel version with Open UI. So instead of Browser Script we added code to custom Presentation Model and Physical Renderer JavaScript files. Even though you don't wish to, if you had to resort to something similar using Browser Scripts, you might prefer this over manipulating the text of one button.
I created two button controls: One that displayed Tag and the other Untag. They both call the same method. I added a flag field to the BC. (You might could do the same with a calculated field that is based on certain [Status] values.) In the JS files I put code to check that flag field and then, based on the flag field value, display one button and hide the other.
I did not start with Siebel until 8.1, so I cannot recall if this would be available in 7.8. And this only works on Order Management Applets with a class of CSSSWEFrameListHC (which is why I said "potentially available" options):
There exists an Applet User Property called Hide Control n [See Siebel Developer's Reference v7.8 -> Ch 4: User Properties -> Setting Numbered Instances of a User Property for the use of n in User Properties.]
First, create two separate controls - one that displays Pause and the other Resume. The User Property could be used something like this:
Applet User Properties
Name Value
Hide Control 'Name Of My Pause Button Control', '[Status] = "paused"'
Hide Control 1 'Name Of My Resume Button Control', '[Status] = "queued" OR [Status] = "active"'
You could possibly OR all the other [Status] values into these if you wanted to hide it and not just disable it.
Use Toggle Applets. [See Configuring Siebel eBusiness Applications v7.7 -> Ch 13: Configuring Screens and Views -> Example of Configuring Applet Toggles.]
Copy your existing Applet that has Resume, and modify that button Control in the copy to display Pause. Name the new Applet something like My Form Applet - Pause Button.
Then in Tools drill into your existing Applet, click the Applet Toggle child object, add a New Record, and make it something like this:
If you want this to toggle immediately when the [Status] changes, you'll need to set Immediate Post Changes to TRUE on the [Status] field on the BC. (This could cause performance issues, so be mindful.) Otherwise the Applet won't toggle until the record is saved.
Or you could possibly create a calculated flag field on the BC based on [Status] values, set it's Immediate Post Changes to TRUE, and base the Applet Toggle on that field.
DISCLAIMER: Other than our version of #1, I have not attempted any of these.

Cancel loopback save event in the "before save" operation

We are in the process of building a cart with the loopback API.
When adding a product (ie. 12345) to a persistent database, I am checking to see if that item already exists in my "cart". If the item exists, I am incrementing the Quantity of that item. BUT, after incrementing I need to stop the item from being added to the cart.
In the "before save" operation hook, can I cancel the item from being added to the database. I need to be able to stop the save operation.
You should use findOrCreate() like #amuramoto suggests. But to answer your question, to cancel the save, call next() with an error:
next(err);
next(new Error('Why this is cancelled...'));
It's bad practice to call a save method inside a before save hook on the same model. Infinite looping can result very easily.
Try the findOrCreate operation hook instead. It will look for an existing model based on a filter and create a new model if it isn't found.
https://apidocs.strongloop.com/loopback/#persistedmodel-findorcreate

Force reload of dirty/invalid model in Ember

I am trying to build out edit functionality for a Goal record. On the Goal index page, there is an edit button next to each goal. When clicked, each field becomes editable. Upon clicking Save, the changes are saved to the server. So far so good.
There is also a Cancel button. When a user clicks it, I need to reset the state of the model to what it was before they changed things. goal.rollback() in the controller works fine for this. Except, if the user has already clicked Save but there were server side validation failures. In this case, attempting to rollback() throws Uncaught Error: Attempted to handle event `reloadRecord` on <App.Goal:ember123:1234> while in state root.loaded.updated.invalid.
If instead I try to goal.reloadRecord I get Uncaught Error: Attempted to handle event `reloadRecord` on <App.Goal:ember123:1234> while in state root.loaded.updated.invalid.
Same deal with goal.unloadRecord. I have tried massaging the state like this:
state = goal.get('currentState') #this code makes me sad.
state.isValid = true
state.isError = false
And like this:
goal.transitionTo('loaded.saved')
To no avail. Is make zero sense to me the reloading or unloading a record should be statefull.
Any assistance would be greatly appreciated. Again, I'm trying to take a dirty, invalid record in ember and get it back to a happy state either by rolling back changes, or just reloading it from the server.
EDIT: Ember-data v1.0.0-beta.3-4-g169793e, ember Version: 1.1.2
Here's a working example, change the color then hit save.
http://emberjs.jsbin.com/OxIDiVU/44/edit
PR submitted https://github.com/emberjs/data/pull/1590

Sitecore - Creating an New Item on the OnSavingItem Event redirects the Shell to the newly created Item

Got an annoying issue.
When a user edits a field on an item, we use a OnSavingItem event handler to create some new items elsewhere in the background as it were.
Problem is the item the users edited the field of gets redirected to the item we invisible created in the background.
We want it to stay where it is... Any ideas?
thanks
If you want to disable the transfer to the item you've just created you could also consider implementing the following code:
// Before we copy the item we put notifications on to make sure we won't be transfered to the newly created item
Sitecore.Client.Site.Notifications.Disabled = true;
// Your action comes here
Sitecore.Client.Site.Notifications.Disabled = false;
Are you using the
<event name="item:saved">
Handler? If so, don't forget that this event is fired on all the new items you create as well, potentially triggering a recursive event loop.
This answer came from the SiteCore forum ... credit goes to John West
I think you could use the item:saving event or the saveUI pipeline. Use the event if you need to handle changes that occur through APIs, or use the pipeline if you only need to handle changes that occur through the user interface.
You could also consider adding the logic to the field itself.
John West Sitecore Blog
item:saved is much heavier than a processor within the saveUI pipeline. For example, item:saved is triggered during publishing which is not what you really want. I always recommend handling such customizations either on the pipeline or workflow action level.