Order Name J Script

Hi

I want to automatically populate the order name to customer name + date. 
This is the script I have but it shows the dayand time etc. I want to format 
the date such that it is dd-mm-yy format. How do i go about this please?

var lookupItem = new Array;
lookupItem = crmForm.all.customerid.DataValue;
var d = new Date();

if (lookupItem[0] != null)
{
 crmForm.all.name.DataValue = lookupItem[0].name +" : " + d;

}
0
SnowWhite (57)
7/22/2008 5:00:00 AM
crm 35858 articles. 1 followers. Follow

2 Replies
741 Views

Similar Articles

[PageSpeed] 24

You might want to take a look at the snippets below to munipulate
datetimes.

http://snippets.dzone.com/posts/show/932

Darren Liu, Microsoft CRM MVP
Crowe
http://www.crowecrm.com

On Jul 22, 12:00=A0am, Snow White <SnowWh...@discussions.microsoft.com>
wrote:
> Hi
>
> I want to automatically populate the order name to customer name + date.
> This is the script I have but it shows the dayand time etc. I want to for=
mat
> the date such that it is dd-mm-yy format. How do i go about this please?
>
> var lookupItem =3D new Array;
> lookupItem =3D crmForm.all.customerid.DataValue;
> var d =3D new Date();
>
> if (lookupItem[0] !=3D null)
> {
> =A0crmForm.all.name.DataValue =3D lookupItem[0].name +" : " + d;
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -

0
darrenliu (251)
7/22/2008 2:12:38 PM
You'll have to format the variable "d" because the Date() function is going 
to just give you the current date and time. Maybe this is will give you what 
you need:

var lookupItem = new Array;
lookupItem = crmForm.all.customerid.DataValue;
var d = new Date()
var day = d.getDate()
var month = d.getMonth() + 1
var year = d.getYear()
    
if (lookupItem[0] != null)
{
 crmForm.all.name.DataValue = lookupItem[0].name +" : " + month + "-" + day 
+ "-" + year;

}

HTH - Marc

"Snow White" wrote:

> Hi
> 
> I want to automatically populate the order name to customer name + date. 
> This is the script I have but it shows the dayand time etc. I want to format 
> the date such that it is dd-mm-yy format. How do i go about this please?
> 
> var lookupItem = new Array;
> lookupItem = crmForm.all.customerid.DataValue;
> var d = new Date();
> 
> if (lookupItem[0] != null)
> {
>  crmForm.all.name.DataValue = lookupItem[0].name +" : " + d;
> 
> }
0
Marc2832 (125)
7/22/2008 2:19:02 PM
Reply:

Similar Artilces:

Displaying Sheet Tabs Names in Cells
Can anyone tell me if there is a way for me to display the Name of a Sheet Tab in a cell. Take for example I have 4 worksheets, labelled Shawn, Kevin, Mary, & Data. In data, I want it to show the name of the worksheets. So in Cell A4 I would like it to say Shawn, then in B4 I can put Shawn's data in. Is there a function or a formula that allows me to do this. Thanks for any help. Hi Maybe this UDF will do for you. ------ Public Function TabI(TabIndex As Integer) As String Application.Volatile TabI = Sheets(TabIndex).Name End Function ------ Insert the function in...

Order Management Error
Hi All! We are testing if we can use BP3 for our customers to enter their orders, everything goes well until the point when we click the Check Out button to complete the order, then we get an error, "The order cannot be processed at this time. Please try again later.", then when we look at Event viewer to see the details, there's "The Microsoft Business Framework must be started using EnterpriseSession.Initialize()." on the description. Any ideas on how to get around this issue? Zama, Can you confirm the event is directly related to clicking the "Check Out&...

Tab order for purchase orders and sales orders
Is there a way to set the tab order while entering items in a purchase order and sales order. My client would like to be able to have the order taker be able to be prompted for a quantity while entering in line items to purchase orders and sales orders. Marc, For POS, enter the quantity first, then the * key, then the ILC So for 5 of 11212, enter 5*11212 <enter> For PO's see if QuickScan works better for you. -- * "Marc Arbesman" <MarcArbesman@discussions.microsoft.com> wrote in message news:05BD48AA-08BB-4CFE-A04D-46BBCC5B95CC@microsoft.com... Is there a w...

Use a range name in VB with IF Then Else statement
Thanks for looking at this one..... when writing a macro in visual basic, how would you write code to do something like this: IF "Named Range 1" is not equal to "Named Range 2" THEN (do a simple cut/copy/paste which I've allready figured out) ELSE END IF I can do this with range as cell address ("A2") but don,t know how to reference the Named Range. Thanks.... Spydor -- spydor ------------------------------------------------------------------------ spydor's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28438 View this t...

Modify back order transfer to order process
Got a question for anyone who is familiar with the transfer process from back order to order. I'd like to make a modification in that process to clear the PICTICNU and PCKSLPNO fields in SOP10100 for the new SOP order created. Currently those fields retain the values from the original SOP order. Has anyone made a similar mod? Any pointers? Thanks. -- Jim@TurboChef Jim - I am assuming you are on Version 8 or higher. Go to Tools - Setup - Sales - Sales Order Processing On this window, click on the numbers button - the last two options are Packing Slip and Picking Ticket. You pr...

"The certificate's CN Name does not match the passed value."
Recently my ISP sent out an email saying that I am supposed to change my email settings from pop.sbcglobal.yahoo.com to pop.att.yahoo.com from smtp.sbcglobal.yahoo.com to smtp.att.yahoo.com They also requested that I set up SSL on ports for pop and smtp. I did that and found that I couldn't get outgoing mail to work. I was not even able to get it to work when I switched back the smtp server to original setting. In the process of trouble shooting I installed another email client to see if it was Outlook that was causing the problem. When Eudora opened it ...

Purchase Orders Slowness
I just installed this module for version 8.00g7. Now when I access the company, it takes 2 to 3 minutes to log you on. The access time before was less than 40 secs. Does anybody have a clue? It created these views: CPO10113 CPO10114 CPO10600 Also I noticed when you change user in the same company is fast. -- Thanks in advance. Luis Sorry I forgot to tell that the module is Purchase Orders Enhancenments. -- Thanks in advance. Luis "Luis" wrote: > I just installed this module for version 8.00g7. > Now when I access the company, it takes 2 to 3 minutes to log you on. >...

Back Order Work Order
Hello, When adding an item with 0 inventory to a sale I get a prompt to create a back order. When I add the same exact item to a work order there is no prompt to create a back order. Is that correct? I expect to have some back orders on work orders is there a work around method (or maybe I am missing a fix)? Thank you, Jim This is a multi-part message in MIME format. ------=_NextPart_000_0572_01C89517.067BEB30 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable JimF, In RMS' mind, an order, is an order, is an order, and not a sale. --=20...

Documentation on field scripts / Availability of GP source code
I can find information in SDK about global and form scripts, but I am unable to find anything about field scripts changes from GP 8.0 to 9.0. I am working on moving a plug-in which calls a field change script. This script is erroring out when used in the plug-in in GP 9.0. Also, do they still makes the GP code available? Thanks, Pat I believe GP code is only available to ISVs. "Pat McNally" wrote: > I can find information in SDK about global and form scripts, but I am unable > to find anything about field scripts changes from GP 8.0 to 9.0. I am > working on mov...

Access Form Script Examples...
Just for kicks and giggles, anyone know of websites that have good examples of scripts you can do with access forms!? I am looking for ideas, and examples that I can encorporate different types of things into the access form that I have here, since I am in the midst of redesigning it. The only one that I know of, which is worth mentioning is http://home.comcast.net/~cccsolutions/accesstips.html, hosted by Al Campagna, who has helped my out tramendously... What are you trying to accomplish? I, and most of the Access folk of my acquaintance, don't add glitz and glitter to forms just &qu...

Sales Order unfulfillment
We have customer send us projections of what they would be buying thru next sixth months. We would like to block (allocate) this quantities for this particular customer. At the moment we create a fake order and we put all of these items on this order. When we receive actual orders, we unallocate the fake order for the quantity on the master order, create a brand new order again put the unallocated quantity on the new order. Can we simplify this process? If so, how? Third party solutions? System: GP 8.0 SP1 SQL 2000 Modules: SOP, Inventory, POP, RM, PM, GL We have thought about creating a new...

i have #name? at my control
i have #name? at my control. I cobined these functions (iif(), left(), right(),count() ,integer() and the concatenation sign(&)) to change numbers into texts on a form . It woked well as i wanted . after a perioud of using my system perfictly I faced this problem. i began trubleshooting to determine the cause . the cases noted by "help" missed the problem .i removed the ms_office and reset it up and checked the refernces and unchecked the microsft missing refernces. but the problem still faceing me . i copied my system in another computer is worked well. them i formated m...

Purchase order
can we have the site ids addresses show on the po deliver to: address PO form. If, so how? -- Crystal Roach Crystal, This requires a modification of the PO form in Report Writer. Change the Ship To address field to reflect the Site address. Hope this helps, Frank Hamelly MCP-GP, MCT, MVP East Coast Dynamics www.eastcoast-dynamics.com blog: www.gp2themax.blogspot.com The site ID address field does not appear in RW for POs. Do I need to link tables? If so, what tables and how. -- Crystal Roach "Frank Hamelly, MCP-GP, MCT, MVP" wrote: > Crystal, > > This requ...

Unidrv's function order?!
Hi all I have some questions about Unidrv (GPD's minidriver + OEMDLL). Could somebody please answer my question? Now I'm making Unidrv driver for miniprinter (like Epson's TM88III) with ESC/POS command. I completed printing with only image (maybe raster data), so I added device font in it. Then I have got bad print result, which I am, researching driver's action and its execution sequence. My driver does execute device font module first and then image. Exactly, like below 1. When I print test_RASTERFIRST.doc to my miniprinter, functions' order is like below. ...

Associate a purchase order with a work order or back order
When creating a purchase order, I would like to create one purchase order for only my outstnading work orders, and/or create a purchase order for only those items which were backordered from the POS screen. Better yet, I would like a one-to-one relationship, where I can create a purchase order for a specific work order or back order. However, there doesn't seem to be that level of filtering. The closest I can get it "Generate based on re-order information". That lumps work order items, back order items, and replenishment of low inventory items all together, which makes our...

VB script using XCOPY
Hello I'm writing a script that copies files from one folder to another, and I'm using XCOPY. wshshell.run "cmd /c XCOPY " & ..... but how do I get the DOS shell window to open when I run this command ?? THanks "Bill" <someplace@somewhere.com> wrote in message news:eLfYVcu7KHA.720@TK2MSFTNGP05.phx.gbl... > Hello > > I'm writing a script that copies files from one folder to another, and I'm > using XCOPY. > wshshell.run "cmd /c XCOPY " & ..... > > > but how do I get the DOS she...

open purchase orders
We are brand new to RMS, and have question that is nagging us. Is there a way to get a report that shows what is currently on order, preferably able to sort by department and category? MP wrote: > We are brand new to RMS, and have question that is nagging us. Is there a > way to get a report that shows what is currently on order, preferably able to > sort by department and category? > > Try with this code... //--- Report Summary --- // Begin ReportSummary ReportType = reporttypeItems ReportTitle = "Documenti Magazzino" PageOrientation = pageori...

sort order
hi guys, i'm trying to import from several sheets with tables of names into another sheet using: =sheet1!D1 =sheet1!D2 --> =sheet5!D10 etc... in the respective cells of the new sheet... this seems fine. the only prob is the empty cells from the reference sheets are shown in the new sheet as 0. when i do a sort (eg: a-z) i get all the 0 entries first then the start of the names. ideally i would like to not show these values as 0 (rather as empty cells), but if i could change the sort order to have numerals after alphabet that would suffice. regards harold Harold Try =if...

Find all roots of a high-order equation
The math behide this solution is quite simple: if a polynomial equation f(x)=0 has roots, let's say x1,x2,��xn,then f(x) can be converted to another format as (x-x1)*(x-x2)*(x-x3)*�...*(x-xn) = 0 So what we do here is use goal-seek to find it's first root(x1) then use f(x) / (x-x1) as a new equation, easy to say the new one is (x-x2)*(x-x3)*�...*(x-xn) = 0 repeat the procedure above,we can get all the roots one by one. +-------------------------------------------------------------------+ |Filename: Find all the roots of High-Order Polynomial Equation by Dragon.Pan.zip| |Download: h...

Purchase Order from Sales Order
We are trying to use the 'Purchase' button on the sales transaction entry screen to generate an order for our second site. Even when the Sales order default site and line item site is correct, the PO generated is for our main site. Can someone tell me what setup I need to change so that we can change the site in the Purchase Order preview window? I am trying to understand your post. Is the site ID on the purchase order created off of and linked to the sales order different than what is on the sales order? We use the SOP-POP link feature about 700 times a month, and I do not ...

Macro to Save File with the name in a specified cell #2
Thanks Bob - just what I was looking for. :cool -- ElsiePO ----------------------------------------------------------------------- ElsiePOA's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=390 View this thread: http://www.excelforum.com/showthread.php?threadid=27018 ...

Freight should track with orders when transferred to invoices
If you enter freight into an order it is eliminated when you transfer it to an invoice. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=daa29d15-4590-44c2-b642-80f7ee6d4bc4...

Contact Full Name Doesn't sort properly
I recently changed from "First Last" to "Last, First" in the system settings. I updated the ContactBase and the SysUser tables to take of of the existing records. I noticed when I type in a quick find search on the contacts it doesn't sort properly. It sorts by the last name, then the first name then about 1/2 way down, I notice there are some records out of alphabetical order. I double checked the Quick Find Query and the sort column is set to the full name. Not sure how/why it's not truly sorting on full name (yes, they are all active records) When you...

checking work order
hey everyone, we have a candy warehouse and we have salesman on the road making work orders all the time. the thing i want to ask is, is there anyway we can check the items that our customer want are the same item that our order pullers pull. thank you ...

Org Chart in Order
I have a list of companies for an org chart and I want to bring them into Visio 2007 to create an org chart and in the order they are entered. They being created in random order. Unfortunately it is by design (improves drawing performance), al "Eric Kaplan" <Eric Kaplan@discussions.microsoft.com> wrote in message news:41AFCDCF-8E6C-4089-B7F2-2CFE174E4D06@microsoft.com... > I have a list of companies for an org chart and I want to bring them into > Visio 2007 to create an org chart and in the order they are entered. They > being created in random order. ...