How to create calculated column with data from same list - sharepoint-2010

I have a list where user can request amount of 1000 either one time or two time, if user request a amount, sharepoint automatically check with previous amount and subtract from 1000.
suppose: A request 500 one time, next time if i create a list it will check the previous amount and let me know that i can only request 500 max.

Unfortunately, calculated column formulas can only access values from columns on the same list item.
To query the list and retrieve values from other columns, here are a few different options you could consider, depending on your comfort level with the various technologies:
Custom Workflow (created using SharePoint Designer or a third-party product like Nintex Workflow or K2).
A custom list event handler (created using Visual Studio)
A custom form (using InfoPath or a third-party product like Nintex Forms)
Custom JavaScript on the New Item form that would override the PreSaveAction() method, query the list (using the SharePoint JavaScript Client Side Object Model, SPServices, or REST web services), and return True or False depending on whether you want to allow the item to be created or not

Related

Business Dynamics 365 API - Not able to get Web/ecommerce enabled items only

Using Dynamics 365 APIs, able to get all the items created on Microsoft - Business Control. But there is an option to make the item visible on the Web/commerce. Through API not able to get a parameter that specifies whether the web is on the Web or not. As a result, returning all the items created but the Client requirement is to display the items that are web/commerce-enabled.
https://ansit-tarannum.tinytake.com/msc/NzU4NjA2MF8yMDU0OTM1OA
It will be highly helpful if anyone can help with this.
https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_item_get
I went through all the APIs but didn't find any parameter that indicates the Web-published items.
I am expecting to get that specific parameter that distinguish between published and not published items on Web/commerce.
Or any API that has this data along with mapping with item id.
Thanks
Tarannum

How to Collect dijit/form/combobox Selected Values in Repeat Control

An XPage is used to display the number of points a person has collected, and the number of points remaining (see below).
I have a repeat control which gets a collection of documents meeting a specific criteria. The last column in the control contains 5 digit/form/comboboxes, which are displayed or hidden, according to the number of fields on each document that contain data.
The layout contains gift cards worth a certain amount of points, and the person can select how many of each gift card they want. eg.
Company Available in Values of Points Required Quantity Requested
The Quantity Requested column contains the digit/form/comboboxes. As the person selects values in the checkbox, I want the number of points remaining to be recalculated.
The onChange event of the digit/form/comboboxes calls a function in an Output Script which calls an RPC, which in turn calls an SSJS function. The SSJS function cycles through the documents displayed in the repeat control, gathering the points required information. I then wanted it to also grab the Quantity Requested. I understand from a previous posting that because of the way the digit/form/combox is rendered, I can only get the value using CSJS with dijit.byId and perhaps putting the value in a hidden field and retrieving it from there.
I can't seem to wrap my head around how I will do this when the repeat control will make it possible for there to be many combobox1 and combobox2, etc.
The XPage is not bound to a form, because all the items are just calculated on the fly and then discarded.
What is the best way to do this?
The JSON RPC service can't interact with any changes made in the browser, see https://www.intec.co.uk/json-rpc-service-component-tree-manipulation-openlog/. This could be the cause of your problems.
You may be able to get around it by triggering a partial refresh (POST) before calling the JSON RPC. In theory that might work, because the component tree (server-side map of the XPage) would get updated by the partialRefreshPost and the updates picked up by the JSON RPC. It's possible though that the Restore View picks up a version of the XPage other than the one for the browser, I don't know. I've never investigated that.
It's been a while since I've worked with server java script, I have been doing it the managed bean way with ActionListeners. If you have the data in the UI, then can you avoid server side processing and do it client side?
You can also use the DOM XSP Object like XSP.setSubmittedValue to have a key value pair sent with your post request to the server side, you can only have one... it can be JSON or any other value you set it to from the client side javascript.
I figured out how to do this. If anyone wants the code, let me know and I'll provide it.

Fill web-form using information in another web form - Visual Basic?

Currently at my company, we are using a CRM to manage invoicing, sales orders, etc. We are also shipping a lot of items. So what I am trying to do is get the information from one web form (the invoice) to fill in the other web form (shipping web application) so there is less room for error when shipping. I would like it to just copy over the basic information like to and from address and PO#.
I found some information on it sending pre-inputted information using VB, but I would like it to grab what is in an ID of a form, since that will constantly be different.

How do I programmatically create a new TFS Task?

I'm looking to create a Visual Basic Windows Form Application which has similar input fields to the new task creation page on the browser version of TFS. the idea is to automate some of the form filling saving up on time (is, calculating time estimates based on dates taking into account work hours and weekends, automatically filling out fields)
When i search Google however i keep getting results like customizing TFS or how to make a new task using the interface, however what i am looking for is what classes i'm supposed to use to create a new task and then to save it or search current existing tasks.
So How do I programmatically create a new TFS Task if it's possible? (it should be, Visual Basic and TFS are both Microsoft)
There is an example on MSDN. See this page: "Create a Work Item By Using the Client Object Model for Team Foundation".
The core of the example is:
// Create the work item.
WorkItem userStory = new WorkItem(workItemType)
{
// The title is generally the only required field that doesn’t have a default value.
// You must set it, or you can’t save the work item. If you’re working with another
// type of work item, there may be other fields that you’ll have to set.
Title = "Recently ordered menu",
Description = "As a return customer, I want to see items that I've recently ordered."
};
// Save the new user story.
userStory.Save();

how to find out if a sharepoint list is created by end-user or created as part of site provisioning

I would like to find out whether a sharepoint list is created by end-user or created as part of site provisioning.
I want to show all lists created by end user into a dropdown. I could filter on template id = 100 but there are some system generated lists having templateId=100 and they end up in the dropdown list.
The SPList object does contain a Created property and the containing SPWeb does as well. Note that you won't be able to do a direct comparison because presumably it took many seconds (or even longer) to provision your site but if you did a fuzzy comparison of those two dates you should be able to separate user created vs. system provisioned lists.