2

I have created a Leave Request site within my organization. I have a list which hosts the 3 following leave types: Annual, Special and Sickness. I have a choice field in the list named "Leave Type" which has a dropdown of all 3 types.

I have 3 different New Request views and I am linking to these from promoted links on my homepage. I want the Leave Type to change for each view so that it is correct for each list entry.

Rather than a Form Load rule, I need some kind of View Load rule.

Can anyone advise?

  • Were you able to find a solution? – Michael Oct 2 '17 at 15:56
  • Did you help my answer? Mark it please. – Zdeněk Vinduška Feb 6 at 13:00
0

Why don't you just change your choice field to a static field based on the view? So if your user browses to the "Leave request: Annual Leave" view of your list, have the only option for leave as Annual. Same for your Sickness and Special.

If you wanted them to be able to change it, then the drop down list is the way to go, but I'm not sure you can set a rule to set default based on the view.

Hope that helps.

0

I hope I understand you correctly.

You are using InfoPath forms, so you are able to do this with Inputs Parameters to the forms. Here described with examples. After correct set you will be able to create 3 different links to the form with wanted selected value. After loading value from the input parameter, you can set the value of DropDown in InfoPath by this code:

#setNodeValue("/my:myFields/my:Form/my:LeaveType, "Annual");
#setNodeValue(XPath, ValueString);
public void setNodeValue(string path, string value)
    {
                XPathNavigator root, infopathNode;
                root = this.MainDataSource.CreateNavigator();
                infopathNode = null;
                infopathNode = root.SelectSingleNode(path, this.NamespaceManager);
                infopathNode.SetValue(value);
    }

Links will look like:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.