CRM - Time Rule - Date and duration difference in XML

Hi All,
Please provide your input on the below query .
Objective
To create a date rule in CRM system, the date rule is created using XML . The date  should be output of date - duration , omitting the weekends ( saturday and sunday ) .
Input
The input is  date ( lets says - 25.07.2014) and duration is 5 days . The output should be the input date - duration ,if there is any weekend which is falling between the input date and duration ,it will not count the weekend as number of days and provide the result .
Please find the example ,In the below code
VarTimeExp = 25.07.2014
ConstDuraExp = 5days
VarTimeExp will contain the output/result =  Date provided in the ZRC04_01 - Duration of 5 days in ConstDuraExp.
Result = 20.07.2014 . It is considering the weekends in counting number of days
Expected result - 18.07.2014, should not consider the weekends
Note -  The factory calendar is already set and badi is implemented
Case 1
<?xml version="1.0"?>
<TimeRule>
   <TimeRuleSource>
      <ruleline>
         <AssignTimeExp displaytype="AssignTime">
            <VarTimeExp displayType="VarTime"  name="RESULT"   position='B'>
              <VarObjectExp displaytype="VarObject"  name="ZXXX001"/>
            </VarTimeExp>
            <MoveTimeExp displaytype="MoveTime" direction="-">
               <VarTimeExp displayType="VarTime"  name="ZRC04_01"  position="B">
                <VarObjectExp displaytype="VarObject"   name="ZXXX001"/>
               </VarTimeExp>
               <VarDuraExp displaytype="VarDura"  name="ZRC04_D4" timeunit="DAY">
                  <VarObjectExp displaytype="VarObject"   name="ZXXX001"/>
               </VarDuraExp>
            </MoveTimeExp>
         </AssignTimeExp>
      </ruleline>
   </TimeRuleSource>
</TimeRule>
but when i implement the Case 1  code i am not getting the desire result . Please find the screen shot .
Please provide your input on the above scenario and do let me know if you need more information from my end .
Thanks
OM

Hi All,
The issue is resolved .The above rule will work perfectly fine , only we have to provide the missing configration in the system . Please find the same below
Also if you want to have constant duration then the above configration is also not required the rule will work without the above configration . Please find the rule written - when you have constant duration .
<?xml version="1.0"?>
<TimeRule>
   <TimeRuleSource>
      <ruleline>
         <AssignTimeExp displaytype="AssignTime">
            <VarTimeExp displayType="VarTime"
                               name="RESULT"
                           position='B'>
              <VarObjectExp displaytype="VarObject"
                                name="ZXXX001"/>
            </VarTimeExp>
            <MoveTimeExp displaytype="MoveTime" direction="-">
               <VarTimeExp displayType="VarTime"
                                  name="ZRC04_01"
                                  position="B">
                 <VarObjectExp displaytype="VarObject"
                                name="ZXXX001"/>
               </VarTimeExp>
               <ConstDuraExp displaytype="ConstDura"
                                duration="5" timeunit="DAY">
                  <VarObjectExp displaytype="VarObject"
                                name="ZXXX001"/>
               </ConstDuraExp>
            </MoveTimeExp>
         </AssignTimeExp>
      </ruleline>
   </TimeRuleSource>
</TimeRule>
Thanks,
OM

Similar Messages

  • Mapping of CRM Territory Hierarchy data and BI Territory Hierarchy data

    Hello friends,
       I Want to know the easy way to compare the CRM Territory Hierarchy data and BI Territory Hierarchy data . Previously We had an issue with Territory Hierarchy data  and applied note on CRM side and it resolved. Now we want to see whether the Territory Hierarchy data is sync in between BI and CRM.
       Please let  me know if you have an idea what is the solution if both systems are out of SYNC.
    Thanks,
    SRI.

    Hi Raimon,
    Please check note-
    Note 460302 - CRM_MKTPL: Double message concerning BW update
    Regards,
    Anil

  • Extract Time from date and Time and Need XLMOD Funtion to find the Difference between Two Time.

    X6 = "1/5/15 5:16 AM" & NOW ....................difference by Only Time
    not date
    X6 date and Time will be changing, Its not Constant
                Dim myDateTime As DateTime = X6
                Dim myDate As String = myDateTime.ToString("dd/MM/yy")
                Dim myTime As String = myDateTime.ToString("hh:mm tt")
                Dim myDateTime1 As DateTime = Now
                Dim myDate1 As String = myDateTime1.ToString("dd/MM/yy")
                Dim myTime1 As String = myDateTime1.ToString("hh:mm tt")
    Need to use this function to find the Difference between Two Time. due to 12:00 AM isuue
    Function XLMod(a, b)
        ' This replicates the Excel MOD function
        XLMod = a - b * Int(a / b)
    End Function
    Output Required
     dim dd  = XLMod(myTime - myTime1)
    Problem is myTime & myTime1 is String Need to convert them into Time, Later use XLMOD Funtion.

    Induhar,
    As an addendum to this, I thought I'd add this in also: If you have two valid DateTime objects you might consider using a class which I put together a few years ago
    shown on a page of my website here.
    To use it, just instantiate with two DateTime objects (order doesn't matter, it'll figure it out) and you'll then have access to the public properties. For this example, I'm just showing the .ToString method:
    Option Strict On
    Option Explicit On
    Option Infer Off
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    Dim date1 As DateTime = Now
    Dim date2 As DateTime = #1/1/1970 2:35:00 PM#
    Dim howOld As New Age(date1, date2)
    MessageBox.Show(howOld.ToString, "Age")
    Stop
    End Sub
    End Class
    I hope that helps, if not now then maybe at some point in the future. :)
    Still lost in code, just at a little higher level.
      Thanx frank, can use this in Future....

  • Can I copy time capsule data and use new external HD

    Hi All-
    I've been scouring the net and cant seem to find an answer. Hopefully someone here can help.
    I have a Time Capsule that is nearly filled. It is giving me error messages each night it tries to backup saying that there is too much on my computer to backup.
    So, I went out and bought a 4TB Western Digital external drive. I want to copy all the data from the time capsule onto the new hard drive (so I dont loose any of my older backups) and then have the time capsule use that same WD drive as my new backup.
    I have seen there are ways to copy from time machine drives to new drives, but I was under the impression time machine uses a different kind of backup method than a time capsule. Is that true? Can someone point me to a place that explains how exactly I would copy the drive in the time capsule... (I understand I need to use Disk Util, but I cant get the TC drive to show up in that program)...
    Also, is there a way to instruct time capsule to stop using its own internal drive and use the drive connected to its USB for the backups? I think Apple's answer is no, but I dont know if thats really the case or not...
    Thanks much-
    Daber

    David Bertman wrote:
    The backup was via an ethernet cable from the mac to the TC. (I also have it set up to run via wifi. Would that affect things?) Would there be different symptoms if the backup had stalled midway through?
    Just trying to rule out a bad WIFI connection, and it will be much faster via Ethernet.
    I didnt repair the backups first (I'm not really sure how to do that --- is it through disk utils and repair permissions like a normal drive?) I get nervous messing around with the "Backups.backupdb" files so I generally leave them alone.
    Close. It's +*repair disk+*, not permissions. See #A5 in Time Machine - Troubleshooting (or use the link in *User Tips* at the top of this forum), for a brief explanation and instructions.
    If the backups on the TC were corrupted, that would have been copied to the external HD, potentially causing Time Machine to start a new set.
    But, I did enter time machine and saw that the old backups were there (and when I did your other suggestion of going to the browse option, it now shows two identically named backups -- one from the original TV and one from the new 4tb drive. But when I enter each they are separate backups -- the original one with the older backups and the new one with the single 1 day backup.
    That confirms it -- for whatever reason, Time Machine started a new set.
    You asked if there were two sparce bundles... I dont see any sparce bundles. I'm ONLY seeing the "backup.backups" folders when I mount the drives... Should I be seeing sparce bundles? Could that be an issue?
    The Backups.backupdb folder should be inside a sparse bundle named the same as your computer. All backups done over a network (via Ethernet or WIFI) are done that way; those done to a locally-connected drive have that folder at the top level of the drive.
    If you look at the external HD via the Finder, you'll see them; if you then double-click either, it will mount, and you can see the Backups.backupdb folder inside it. And you're right; be +*very careful+* not to move, change, or delete anything there.
    I'd suggest this: Turn Time Machine off, and use Airport Utility to disconnect the external from the TC (start Airport Utility, click +Manual Setup,+ then Disks in the toolbar, then +Disconnect all Users.+ Each user will then get a message).
    Then connect the external directly to your Mac. Repair the old sparse bundle, per #A5 (it will take a long time, but be much faster this way). If it has errors that Disk Utility can't fix, see the pink box in #A5.
    If there are no problems, or they're fixed, delete the new sparse bundle via the Finder. That may take a while. Then eject the disk, reconnect it to the Time Capsule, and do a "full reset" per #A4 in Troubleshooting. Then re-select the external as your TM volume, and start a backup. Open the external disk via the Finder; if Time Machine again creates a new sparse bundle, you're pretty much stuck with it making a separate set of backups.

  • My iPod 5thG don't work, it turns off all the time, the date and time is other, and I can't connect to the Wi-Fi

    Please I need help my iPod is not working I have problems for the internet, the date and time is other like if today is March 9,2014  and the time is 9:44 Pm it tells me that is March 11,2014  and the time 3:15 Am! And it turns of all the time!

    - Reset the iOS device. Nothing will be lost       
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                                
    iOS: How to back up                                                                                     
    - Restore to factory settings/new iOS device.                     
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar                                      

  • Extracting time from date and adding it to another date.

    Dear All,
    The values of two fields in my table are as follows:
    n_date n_time
    12/7/2007 1/1/1970 5:50:23 PM
    Both of these fields are of date data type.
    How can i add the time from n_time to n_date so that n_date will reflect a date with time added?
    The problem is that i want to sort on n_date and i am not getting result when two dates are having same values for n_date but different for n_time.
    How can i create a new expression for sorting these values?
    Thanks in advance.
    Regards,
    Sameer

    Hi,
    Check this.
    with data as
    ( select to_date('12/7/2007','dd/mm/yyyy') as ndate, to_date('1/1/1970 5:50:23','dd/mm/yyyy hh24:mi:ss') ntime from dual)
    select ndate + (ntime - trunc(ntime)) from data
    Regards
    RK

  • How to calculate Deadline Date and Time

    A support desk message has been created and support team has to respond in fixed time duration.
    Creation time of message and duration of response are available.
    How to calculate the exact time and date where this deadline expires using the factory calendar.

    java.util.Date date = java.util.Calendar.getInstance().getTime(); //retrieve a date object
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat(dd-MMM-yyyy);
    String s = df.format(date); //10-Aug-2001
    String t = "15042001";
    df.applyPattern("ddMMyyyy");
    d = df.parse(t);
    df.applyPattern("dd-MMM-yyyy");
    t = df.format(d); //15-Apr-2001Hey it's Friday, I'm bored

  • How do you date and time stamp pictures and videos using a EOS Rebel T3?

    I am needing to utilize date and time stamping on videos and photos in my work.  The pictures and videos must display time, a date, and reference number.  I have gone through the cd, owner's manuel and software manuel and I am unclear if I can perform this function. 

    While this is a relatively common feature on point & shoot cameras -- where the photo is thought of as a snapshot to document a memory in a person's life, among DSLR cameras it's not very common (I don't actually know of a DSLR that does this though I don't doubt that it may exist).  DSLR users are usually expecting a higher quality image -- so now the image is thought of more like art and less like a snapshot and the date/time in the corner distracts from the image.  Also they tend to be more advanced users who would be able to modify the image themselves so they have little need for such a feature.
    The camera does record the date & time... but it's in the EXIF data (information recorded into the image file but not displayed).  
    SO... there are programs that will just do this.  You'll need to do a search (I found several but have never tried one so I can't vouch for them).  I think there are Photoshop plug-ins that do this (assuming you have Photoshop). These programs allow you to define the info you want printed (including EXIF data such as date/time) and you get to pick the location, font, size, color, etc. and ultimately the location on the image where you'd like the info displayed.  They then add the info visibly onto the image for you and most support "batch" use (e.g. drop a whole folder of images on it and they'll do them all.)
    Tim Campbell
    5D II, 5D III, 60Da

  • How do I change the "Set Date and Time Automatically" server

    Is there a way to change System Preferences/Date & Time/Date & Time/Set date and time automatically from "Apple Americas/U.S. (time.apple.com)" to another time server instead?

    sig wrote:
    The menu has a drop down. But if you know the address of another time server I would think you can type it in.
    Yeah, that's not really a menu, but a "combo box", which is a combination of an edit field and pop-up menu. So you can choose from existing items or just type in whatever time server you want.
    charlie

  • Date and time missing in menu bar

    From time to time the date and time disappear from the menu bar.  Other times most of the items disappear from the menu bar.  What causes this?  Yes, a reboot puts them back but a reboot should not be necessary.  Any thoughts?

    Might be corrupted preferences ...
    Type or copy and paste the following:
    ~/Library/Preferences/com.apple.systemuiserver.plist
    Click Go then move the com.apple.systemuiserver.plist file to the Trash.
    Restart your Mac.
    Then monitor the time and date in the menu bar.

  • Date and Time sync 8 hours ahead!!

    Hey peepl...
    I'm not a complete vegetable when it comes to the MAC but my iMAC's problem has me mashed...
    I reformatted my hard drive recently so that I could put boot camp on (soiling my MAC with windows software!!) and then restored everything from my Time Machine backup but ever since I did that the time (and date) on my computer is 8 hours ahead of the real time even tho it's supposed to be syncing automatically with apple.asia...
    I know I can manually select the time in "Date and Time" in preferences but I prefer to keep it synced.
    I thought it was a problem with my firewall so I changed a few settings but it keeps on doing it.
    Can anyone help???? It's rather p@ss@ing me off

    Thanks for trying to help mate. I actually solved the problem late last night after noticing something. It seems that Windows in Boot Camp time was set 8 hours ahead which seems to have meant that every time if fixed the time on here, when I rebooted in windows in put it 8 hours further ahead.
    But it ALSO meant that when I tried to sync the time to apple.asia (for some strange and weird reason) the server returned that time as being correct (the one that was 8 hours ahead). I still don't understand it but at least (I think, and hope) it's fixed. :S
    thanks again for taking the time to try and help out Daniel...

  • File date and time

    how to retrieve the information about the date and the time of a file.
    I want to identify my files with
    filename + date.toString() + time.toString()
    It because some files may have the same name, but different date and time
    thanks in advance for it,
    Felipe

    File myFile = new File(path);
    long time = myFile.lastModified();
    // convert time to date and tme

  • Readind Date and Time from a folder.Urgent help please

    Folks,
    I need some help regd reading of date and time from a folder.
    I have a folder which has 5 files.
    I need to read these files along with the date and time
    The date and time has to be in the format:
    mm/dd/yy and the time in 11:55
    I am attaching my code below,
    The f.lastModified() doesnt display the data in the current format
    Can some one please please help me to get the data in the format defined above
    private void readFoldert(){
       String folder = "/images/";
       File f1 = new File(folder);
       ArrayList al = new ArrayList();
        if(f1.isDirectory()){
         String s[] = f1.list();
          for(int i=0; i<s.length;i++){
             al.add(s[i] + f1.lastModified);                    
    } // End of if.
           

    Here's how to format a time. I hope you can figure out how to format a date:import java.text.*;
    import java.util.*;
    public class Test {
        public static void main (String[] parameters) {
            Calendar calendar = new GregorianCalendar ();
            calendar.setTimeInMillis (new java.io.File ("c:\\windows").lastModified ());
            System.out.println (DateFormat.getTimeInstance (DateFormat.MEDIUM).format (calendar.getTime ()));
    }Kind regards,
      Levi

  • How do you change the date and time format in Pages

    I've tried changing the date and time format a number of times for Pages but it does not change.  I'm going to the System Preferences/Language and Text and Formats.  I make the changes click on OK and go back to Pages.  NO change.

    Hi Uncle,
    Page 116 of the Pages'09 User Guide: Control Click the date, Edit Date and Time.
    Date and time can also be in a table. Format the table cell.
    The User Guide is well worth a read. Download it from the Help menu in Pages.
    Regards,
    Ian.

  • The date and time on my iPhone 5s is incorrect when I select Set Automatically. How can I resolve this?

    My iMessage and FaceTime, among other apps, are unable to activate for some reason. Other forums have suggested I make sure my date and time are correct and are Set Automatically. I noticed that the time zone, date, and time are all incorrect. Any suggestions??

        I'm sorry this is happening, loucm. When did this start? Please try resetting Network Settings. You can go to Settings>General>Reset>Reset Network Settings
    Please keep us posted.
    Thank you,
    VanessaS_VZW
    Follow us on Twitter @VZWSupport

Maybe you are looking for

  • HOw to upload test files in XI directory

    Hi all, I want to upload test file from my local system to XI directory. how can i do this. There is one customized transaction cg3z for this . but consider that this is not available in my case. Is there any alternative way to upload the file in to

  • EDI X12 over File Protocol - Handling multiple Interchange Ids

    Hi I am having two types of EDI X12 payloads (with different names). With different Interchange Ids. In my Agreement I have give given one Interchange Id. my tip.properties: allTPInoneDirectory= true identifyFromTP= ANY oracle.tip.adapter.b2b.edi.ign

  • Macbook Pro 13" + Dell US2410

    Hello fellas, bought a dell 2410 2 weeks ago and find that when i edit stuffs on lightroom 3, it kind of lags as compared to when i am running LR3 on my macbook itself without using the external monitor. would like to ask if the graphic card on board

  • Lost iWeb text

    HELP. I have lost my iWeb text tonight. Is there any way to restore? I have regularly Time Machine backup

  • DRIVE 10 vs DISK WARRIOR. Emergency Measures

    I have a drive that I think is having a bit of an identity crisis. Not sure if the drive is the source of the problem but the symptoms are manifesting themselves on the drive. It's a 300GB Western Digital and is running on an external enclosure. I'm